Resource DevstackUtils.robot
Resource KarafKeywords.robot
Resource L2GatewayOperations.robot
+Resource ODLTools.robot
Resource OVSDB.robot
Resource SetupUtils.robot
Resource SSHKeywords.robot
[Arguments] ${test_name}=${SUITE_NAME}.${TEST_NAME}
OpenStackOperations.Get OvsDebugInfo
BuiltIn.Run Keyword And Ignore Error DataModels.Get Model Dump ${HA_PROXY_IP} ${netvirt_data_models}
+ BuiltIn.run Keyword And Ignore Error ODLTools.Get EOS ${HA_PROXY_IP}
Run Keyword If "${FAIL_ON_EXCEPTIONS}"=="True" KarafKeywords.Fail If Exceptions Found During Test ${test_name}
Get Test Teardown Debugs For SFC
${rule_id} = BuiltIn.Should Match Regexp ${output} ${REGEX_UUID}
[Return] ${output} ${rule_id}
-Neutron Security Group Rule Create Legacy Cli
- [Arguments] ${Security_group_name} &{Kwargs}
- [Documentation] Creates neutron security rule with neutron request with or without optional params, here security group name is mandatory args, rule with optional params can be created by passing the optional args values ex: direction=${INGRESS_EGRESS}, Then these optional params are BuiltIn.Catenated with mandatory args, example of usage: "OpenStack Neutron Security Group Rule Create ${SGP_SSH} direction=${RULE_PARAMS[0]} ethertype=${RULE_PARAMS[1]} ..."
- BuiltIn.Run Keyword If ${Kwargs} BuiltIn.Log ${Kwargs}
- ${description} BuiltIn.Run Keyword If ${Kwargs} Collections.Pop From Dictionary ${Kwargs} description default=${None}
- ${direction} BuiltIn.Run Keyword If ${Kwargs} Collections.Pop From Dictionary ${Kwargs} direction default=${None}
- ${ethertype} BuiltIn.Run Keyword If ${Kwargs} Collections.Pop From Dictionary ${Kwargs} ethertype default=${None}
- ${port_range_max} BuiltIn.Run Keyword If ${Kwargs} Collections.Pop From Dictionary ${Kwargs} port_range_max default=${None}
- ${port_range_min} BuiltIn.Run Keyword If ${Kwargs} Collections.Pop From Dictionary ${Kwargs} port_range_min default=${None}
- ${protocol} BuiltIn.Run Keyword If ${Kwargs} Collections.Pop From Dictionary ${Kwargs} protocol default=${None}
- ${remote_group_id} BuiltIn.Run Keyword If ${Kwargs} Collections.Pop From Dictionary ${Kwargs} remote_group_id default=${None}
- ${remote_ip_prefix} BuiltIn.Run Keyword If ${Kwargs} Collections.Pop From Dictionary ${Kwargs} remote_ip_prefix default=${None}
- ${cmd} = BuiltIn.Set Variable neutron security-group-rule-create ${Security_group_name}
- ${cmd} = BuiltIn.Run Keyword If '${description}'!='None' BuiltIn.Catenate ${cmd} --description ${description}
- ... ELSE BuiltIn.Catenate ${cmd}
- ${cmd} = BuiltIn.Run Keyword If '${direction}'!='None' BuiltIn.Catenate ${cmd} --direction ${direction}
- ... ELSE BuiltIn.Catenate ${cmd}
- ${cmd} = BuiltIn.Run Keyword If '${ethertype}'!='None' BuiltIn.Catenate ${cmd} --ethertype ${ethertype}
- ... ELSE BuiltIn.Catenate ${cmd}
- ${cmd} = BuiltIn.Run Keyword If '${port_range_max}'!='None' BuiltIn.Catenate ${cmd} --port_range_max ${port_range_max}
- ... ELSE BuiltIn.Catenate ${cmd}
- ${cmd} = BuiltIn.Run Keyword If '${port_range_min}'!='None' BuiltIn.Catenate ${cmd} --port_range_min ${port_range_min}
- ... ELSE BuiltIn.Catenate ${cmd}
- ${cmd} = BuiltIn.Run Keyword If '${protocol}'!='None' BuiltIn.Catenate ${cmd} --protocol ${protocol}
- ... ELSE BuiltIn.Catenate ${cmd}
- ${cmd} = BuiltIn.Run Keyword If '${remote_group_id}'!='None' BuiltIn.Catenate ${cmd} --remote_group_id ${remote_group_id}
- ... ELSE BuiltIn.Catenate ${cmd}
- ${cmd} = BuiltIn.Run Keyword If '${remote_ip_prefix}'!='None' BuiltIn.Catenate ${cmd} --remote_ip_prefix ${remote_ip_prefix}
- ... ELSE BuiltIn.Catenate ${cmd}
- ${rc} ${output} = OperatingSystem.Run And Return Rc And Output ${cmd}
- ${rule_id} = BuiltIn.Should Match Regexp ${output} ${REGEX_UUID}
- BuiltIn.Log ${rule_id}
- BuiltIn.Should Be True '${rc}' == '0'
- [Return] ${output} ${rule_id}
-
Security Group Create Without Default Security Rules
[Arguments] ${sg_name} ${additional_args}=${EMPTY}
[Documentation] Create Neutron Security Group with no default rules, using specified name and optional arguments.
BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
[Return] ${resp.content}
+Get Neutron Network Rest
+ [Arguments] ${net_id}
+ [Documentation] Keyword to get the specific network details in Neutron (Using REST).
+ ${resp} = RequestsLibrary.Get Request session ${NETWORK_URL}/network/${net_id}
+ BuiltIn.Log ${resp.content}
+ BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
+ [Return] ${resp.content}
+
Create And Configure Security Group
[Arguments] ${sg-name}
[Documentation] Create Security Group with given name, and default allow rules for TCP/UDP/ICMP protocols.
BuiltIn.Set Suite Variable @{tcpdump_port_6653_conn_ids}
BuiltIn.Run Keyword If "${PRE_CLEAN_OPENSTACK_ALL}"=="True" OpenStack Cleanup All
OpenStackOperations.Add OVS Logging On All OpenStack Nodes
+ ClusterManagement.Dump_Local_Shards_For_Each_Member
OpenStack Suite Teardown
[Documentation] Wrapper teardown keyword that can be used in any suite running in an openstack environement
Stop Packet Capture On Nodes
[Arguments] ${conn_ids}=@{EMPTY}
Tcpdump.Stop Packet Capture on Nodes ${conn_ids}
+
+Server Live Migrate
+ [Arguments] ${vm_instance_name}
+ [Documentation] Keyword for live migration of VM instance
+ ... additional_agrs is to select particular migration(live/shared-migration/block-migration)
+ ... if the additional_agrs is not given default migration(shared-migration) will happen
+ ${output} = OpenStackOperations.OpenStack CLI nova live-migration ${vm_instance_name}
+
+Get Hypervisor Host Of Vm
+ [Arguments] ${vm_name}
+ [Documentation] Show server with neutron request.
+ ${output} = OpenStackOperations.OpenStack CLI openstack server show -f value -c OS-EXT-SRV-ATTR:host ${vm_name}
+ [Return] ${output}
+
+Check If Migration Is Complete
+ [Arguments] ${vm_name}
+ [Documentation] Show server and verify if task_state is not migrating
+ ${output} = OpenStackOperations.OpenStack CLI openstack server show ${vm_name} | grep "OS-EXT-STS:task_state"
+ BuiltIn.Should Not Contain ${output} migrating
+
+Modify OpenStack Configuration File
+ [Arguments] ${conn_id} ${file_name} ${section} ${key} ${value}
+ [Documentation] Use crudini to modify any parameter in any Openstack configuration File
+ SSHLibrary.Switch Connection ${conn_id}
+ ${output} ${rc} = SSHLibrary.Execute Command sudo crudini --verbose --set --inplace ${file_name} ${section} ${key} ${value} return_rc=True return_stdout=True
+ BuiltIn.Log ${output}
+ BuiltIn.Should Be True '${rc}' == '0'
+
+Restart DevStack Service
+ [Arguments] ${conn_id} ${service_name}
+ [Documentation] Restart the Openstack Service
+ SSHLibrary.Switch Connection ${conn_id}
+ ${output} ${rc} = SSHLibrary.Execute Command sudo systemctl restart devstack@${service_name}.service return_rc=True return_stdout=True
+ BuiltIn.Log ${output}
+ BuiltIn.Should Be True '${rc}' == '0'
+
+Get Network Segmentation Id
+ [Arguments] ${network_name}
+ [Documentation] Returns network segmentation id for the given network name.
+ ${output} = OpenStack CLI openstack network show ${network_name} | grep segmentation_id | awk '{print $4}'
+ @{list} = String.Split String ${output}
+ [Return] @{list}[0]