X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FOpenStackOperations.robot;h=d2600c9951ef3d2e4e11177eb1961faa00911ae7;hb=f4d7fe300ae2a641250659b7cb6d26f0ab6ea668;hp=6c44afca88d0ac9351975041da3a611539a2f981;hpb=05b470e7f3b3e677b6667be7b48a50716d21708c;p=integration%2Ftest.git diff --git a/csit/libraries/OpenStackOperations.robot b/csit/libraries/OpenStackOperations.robot index 6c44afca88..d2600c9951 100644 --- a/csit/libraries/OpenStackOperations.robot +++ b/csit/libraries/OpenStackOperations.robot @@ -34,7 +34,8 @@ Get Tenant ID From Network [Arguments] ${network_uuid} [Documentation] Returns tenant ID by reading it from existing network. ${resp} = TemplatedRequests.Get_From_Uri uri=${CONFIG_API}/neutron:neutron/networks/network/${network_uuid}/ accept=${ACCEPT_EMPTY} session=session - ${tenant_id} = Utils.Extract Value From Content ${resp} /network/0/tenant-id strip + ${temp_vars} = BuiltIn.Set Variable ['network'][0]['tenant-id'] + ${tenant_id} = Utils.Extract Value From Content ${resp} ${temp_vars} [Return] ${tenant_id} Create Network @@ -388,8 +389,9 @@ Check If Instance Is Ready For Ssh Login Using PublicKey BuiltIn.Should Contain ${output} ${vm_ip} Check If Instance Is Ready For Ssh Login Using Password - [Arguments] ${net_name} ${vm_ip} ${user}=cirros ${password}=cubswin:) ${console}=cirros + [Arguments] ${net_name} ${vm_ip} ${user}=cirros ${password}=${EMPTY} ${console}=cirros [Documentation] Ensure the VM is reachable from ssh as tests would require. This keyword will use password authentication + ${password} BuiltIn.Set Variable If "${password}"=="${EMPTY}" ${PASSWORD_CIRROS_${OPENSTACK_BRANCH}} ${output} = Execute Command on VM Instance ${net_name} ${vm_ip} ifconfig ${user} ${password} ... console=${console} BuiltIn.Should Contain ${output} ${vm_ip} @@ -521,7 +523,7 @@ Check Ping [Documentation] Run Ping command on the IP available as argument ${ethertype} = String.Get Regexp Matches ${ip_address} ${IP_REGEX} ${ping} = BuiltIn.Set Variable If ${ethertype} ping ping6 - ${cmd} = BuiltIn.Set Variable rc=0; for count in `seq 1 ${ping_tries}`; do ${ping} -W1 -t${ttl} -c1 ${ip_address}; rc=$?; if [ $rc -eq 0 ]; then break; fi; done; echo ping_rc=$rc + ${cmd} = BuiltIn.Set Variable rc=0; for count in `seq 1 ${ping_tries}`; do ${ping} -W1 -t${ttl} -c5 ${ip_address}; rc=$?; if [ $rc -eq 0 ]; then break; fi; done; echo ping_rc=$rc ${output} = Utils.Write Commands Until Expected Regexp ${cmd} ping_rc=\\d+ 120 BuiltIn.Log output: ${output} BuiltIn.Should Contain ${output} 64 bytes @@ -538,9 +540,10 @@ Check Metadata Access BuiltIn.Should Contain ${output} 200 Execute Command on VM Instance - [Arguments] ${net_name} ${vm_ip} ${cmd} ${user}=cirros ${password}=cubswin:) ${cmd_timeout}=30s + [Arguments] ${net_name} ${vm_ip} ${cmd} ${user}=cirros ${password}=${EMPTY} ${cmd_timeout}=30s ... ${console}=cirros [Documentation] Login to the vm instance using ssh in the network, executes a command inside the VM and returns the ouput. + ${password} BuiltIn.Set Variable If "${password}"=="${EMPTY}" ${PASSWORD_CIRROS_${OPENSTACK_BRANCH}} OpenStackOperations.Get ControlNode Connection ${net_id} = OpenStackOperations.Get Net Id ${net_name} ${output} = Utils.Write Commands Until Expected Prompt sudo ip netns exec qdhcp-${net_id} ssh ${user}@${vm_ip} -o MACs=hmac-sha1 -o ConnectTimeout=5 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o PreferredAuthentications=password password: @@ -570,9 +573,10 @@ Copy File To VM Instance With PublicKey Auth BuiltIn.Should Be True '${rc}' == '0' Test Operations From Vm Instance - [Arguments] ${net_name} ${src_ip} ${dest_ips} ${user}=cirros ${password}=cubswin:) ${ttl}=64 + [Arguments] ${net_name} ${src_ip} ${dest_ips} ${user}=cirros ${password}=${EMPTY} ${ttl}=64 ... ${ping_should_succeed}=True ${check_metadata}=True ${console}=cirros ${ping_tries}=3 [Documentation] Login to the vm instance using ssh in the network. + ${password} BuiltIn.Set Variable If "${password}"=="${EMPTY}" ${PASSWORD_CIRROS_${OPENSTACK_BRANCH}} OpenStackOperations.Get ControlNode Connection ${net_id} = OpenStackOperations.Get Net Id ${net_name} ${output} = Utils.Write Commands Until Expected Prompt sudo ip netns exec qdhcp-${net_id} ssh -o MACs=hmac-sha1 -o ConnectTimeout=5 -o StrictHostKeyChecking=no ${user}@${src_ip} -o UserKnownHostsFile=/dev/null password: 10s @@ -595,8 +599,9 @@ Test Operations From Vm Instance Test Netcat Operations From Vm Instance [Arguments] ${net_name} ${vm_ip} ${dest_ip} ${additional_args}=${EMPTY} ${port}=12345 ${user}=cirros - ... ${password}=cubswin:) + ... ${password}=${EMPTY} [Documentation] Use Netcat to test TCP/UDP connections to the controller + ${password} BuiltIn.Set Variable If "${password}"=="${EMPTY}" ${PASSWORD_CIRROS_${OPENSTACK_BRANCH}} ${client_data} BuiltIn.Set Variable Test Client Data ${server_data} BuiltIn.Set Variable Test Server Data OpenStackOperations.Get ControlNode Connection @@ -951,34 +956,34 @@ Get L2gw Connection Id Neutron Port List Rest [Documentation] Keyword to get all ports details in Neutron (Using REST). ${resp} = RequestsLibrary.Get Request session ${PORT_URL} - BuiltIn.Log ${resp.content} + BuiltIn.Log ${resp.text} BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 - [Return] ${resp.content} + [Return] ${resp.text} Get Neutron Port Rest [Arguments] ${port_id} [Documentation] Keyword to get the specific port details in Neutron (Using REST). ${resp} = RequestsLibrary.Get Request session ${CONFIG_API}/${GET_PORT_URL}/${port_id} - BuiltIn.Log ${resp.content} + BuiltIn.Log ${resp.text} BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 - [Return] ${resp.content} + [Return] ${resp.text} Update Port Rest [Arguments] ${port_id} ${json_data} [Documentation] Keyword to update ${port_id} with json data received in ${json_data} (Using REST). BuiltIn.Log ${json_data} ${resp} = RequestsLibrary.Put Request session ${CONFIG_API}/${GET_PORT_URL}/${port_id} ${json_data} - BuiltIn.Log ${resp.content} + BuiltIn.Log ${resp.text} BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 - [Return] ${resp.content} + [Return] ${resp.text} 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.Log ${resp.text} BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 - [Return] ${resp.content} + [Return] ${resp.text} Create And Configure Security Group [Arguments] ${sg-name} @@ -1344,7 +1349,7 @@ Verify Expected Default Tables On Nodes [Arguments] ${node_ips}=@{OS_ALL_IPS} [Documentation] Verify if Default Table Entries are programmed on all Nodes ${resp} = RequestsLibrary.Get Request session ${CONFIG_NODES_API} - Utils.Log Content ${resp.content} + Utils.Log Content ${resp.text} ${failed_node_list} = BuiltIn.Create List FOR ${node_ip} IN @{node_ips} ${failed_table_list} = Verify Expected Default Tables ${node_ip}