Add console arg back to keyword 66/76766/7
authorJamo Luhrsen <jluhrsen@redhat.com>
Mon, 8 Oct 2018 18:00:15 +0000 (11:00 -0700)
committergvrangan <venkatrangang@hcl.com>
Wed, 10 Oct 2018 07:18:31 +0000 (16:18 +0900)
https://git.opendaylight.org/gerrit/#/c/72108 removed this argument
and 3rd party/downstream CI using csit code is failing with the
hardcoded value of jenkins

Change-Id: I84e9e7ef1e341c1b935ca0e6e9eb8befe4a0f3f5
Signed-off-by: Jamo Luhrsen <jluhrsen@redhat.com>
csit/libraries/OpenStackOperations.robot
csit/suites/openstack/extensions/sfc.robot

index 7623803a8e3920636e72eef8fb32532206ff8a6a..69a5d37d4b536124ae51776ffcc53b2e1313afad 100644 (file)
@@ -334,15 +334,16 @@ Verify If Instance Is Arpingable From DHCP Namespace
     BuiltIn.Should Contain    ${output}    [${mac_uppercase}]
 
 Check If Instance Is Ready For Ssh Login Using PublicKey
-    [Arguments]    ${net_name}    ${vm_ip}    ${user}=centos    ${idfile}=/tmp/odlkey
+    [Arguments]    ${net_name}    ${vm_ip}    ${user}=centos    ${idfile}=/tmp/odlkey    ${console}=cirros
     [Documentation]    Ensure the VM is reachable from ssh as tests would require. This keyword will use publickey authentication
     ${output} =    Execute Command on VM Instance with PublicKey Auth    ${net_name}    ${vm_ip}    ifconfig    user=${user}    idfile=${idfile}
+    ...    console=${console}
     BuiltIn.Should Contain    ${output}    ${vm_ip}
 
 Check If Instance Is Ready For Ssh Login Using Password
-    [Arguments]    ${net_name}    ${vm_ip}    ${user}=cirros
+    [Arguments]    ${net_name}    ${vm_ip}    ${user}=cirros    ${console}=cirros
     [Documentation]    Ensure the VM is reachable from ssh as tests would require. This keyword will use password authentication
-    ${output} =    Execute Command on VM Instance    ${net_name}    ${vm_ip}    ifconfig
+    ${output} =    Execute Command on VM Instance    ${net_name}    ${vm_ip}    ifconfig    console=${console}
     BuiltIn.Should Contain    ${output}    ${vm_ip}
 
 Get VM IPs
@@ -442,13 +443,15 @@ Close Vm Instance
     ${output} =    DevstackUtils.Write Commands Until Prompt And Log    exit
 
 Check If Console Is VmInstance
+    [Arguments]    ${console}=cirros
     [Documentation]    Check if the session has been able to login to the VM instance
     ${output} =    Utils.Write Commands Until Expected Prompt    id    ${OS_SYSTEM_PROMPT}
-    BuiltIn.Should Not Contain    ${output}    jenkins
+    BuiltIn.Should Contain    ${output}    ${console}
 
 Exit From Vm Console
+    [Arguments]    ${console}=cirros
     [Documentation]    Check if the session has been able to login to the VM instance and exit the instance
-    ${rcode} =    BuiltIn.Run Keyword And Return Status    OpenStackOperations.Check If Console Is VmInstance
+    ${rcode} =    BuiltIn.Run Keyword And Return Status    OpenStackOperations.Check If Console Is VmInstance    ${console}
     BuiltIn.Run Keyword If    ${rcode}    DevstackUtils.Write Commands Until Prompt    exit
 
 Check Ping
@@ -472,25 +475,26 @@ Check Metadata Access
 
 Execute Command on VM Instance
     [Arguments]    ${net_name}    ${vm_ip}    ${cmd}    ${user}=cirros    ${password}=cubswin:)    ${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.
     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:
     ${output} =    Utils.Write Commands Until Expected Prompt    ${password}    ${OS_SYSTEM_PROMPT}
-    ${rcode} =    BuiltIn.Run Keyword And Return Status    OpenStackOperations.Check If Console Is VmInstance
+    ${rcode} =    BuiltIn.Run Keyword And Return Status    OpenStackOperations.Check If Console Is VmInstance    ${console}
     ${output} =    BuiltIn.Run Keyword If    ${rcode}    Utils.Write Commands Until Expected Prompt    ${cmd}    ${OS_SYSTEM_PROMPT}    timeout=${cmd_timeout}
-    [Teardown]    Exit From Vm Console
+    [Teardown]    Exit From Vm Console    ${console}
     [Return]    ${output}
 
 Execute Command on VM Instance With PublicKey Auth
-    [Arguments]    ${net_name}    ${vm_ip}    ${cmd}    ${user}=centos    ${idfile}=/tmp/odlkey
+    [Arguments]    ${net_name}    ${vm_ip}    ${cmd}    ${user}=centos    ${idfile}=/tmp/odlkey    ${console}=cirros
     [Documentation]    Login to the vm instance using ssh publickey in the network, executes a command inside the VM and returns the ouput.
     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 -i ${idfile} ${user}@${vm_ip} -o MACs=hmac-sha1 -o ConnectTimeout=5 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o PreferredAuthentications=publickey    prompt=${OS_SYSTEM_PROMPT}    timeout=60s
-    ${rcode} =    BuiltIn.Run Keyword And Return Status    OpenStackOperations.Check If Console Is VmInstance
+    ${rcode} =    BuiltIn.Run Keyword And Return Status    OpenStackOperations.Check If Console Is VmInstance    ${console}
     ${output} =    BuiltIn.Run Keyword If    ${rcode}    Utils.Write Commands Until Expected Prompt    ${cmd}    ${OS_SYSTEM_PROMPT}
-    [Teardown]    Exit From Vm Console
+    [Teardown]    Exit From Vm Console    ${console}
     [Return]    ${output}
 
 Copy File To VM Instance With PublicKey Auth
@@ -503,13 +507,13 @@ Copy File To VM Instance With PublicKey Auth
 
 Test Operations From Vm Instance
     [Arguments]    ${net_name}    ${src_ip}    ${dest_ips}    ${user}=cirros    ${password}=cubswin:)    ${ttl}=64
-    ...    ${ping_should_succeed}=True    ${check_metadata}=True
+    ...    ${ping_should_succeed}=True    ${check_metadata}=True    ${console}=cirros
     [Documentation]    Login to the vm instance using ssh in the network.
     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
     ${output} =    Utils.Write Commands Until Expected Prompt    ${password}    ${OS_SYSTEM_PROMPT}
-    ${rcode} =    BuiltIn.Run Keyword And Return Status    OpenStackOperations.Check If Console Is VmInstance
+    ${rcode} =    BuiltIn.Run Keyword And Return Status    OpenStackOperations.Check If Console Is VmInstance    ${console}
     BuiltIn.Run Keyword If    ${rcode}    Utils.Write Commands Until Expected Prompt    ifconfig    ${OS_SYSTEM_PROMPT}
     BuiltIn.Run Keyword If    ${rcode}    Utils.Write Commands Until Expected Prompt    route -n    ${OS_SYSTEM_PROMPT}
     BuiltIn.Run Keyword If    ${rcode}    Utils.Write Commands Until Expected Prompt    route -A inet6    ${OS_SYSTEM_PROMPT}
@@ -522,7 +526,7 @@ Test Operations From Vm Instance
     \    ...    ELSE    OpenStackOperations.Check No Ping    ${dest_ip}    ttl=${ttl}
     ${ethertype} =    String.Get Regexp Matches    ${src_ip}    ${IP_REGEX}
     BuiltIn.Run Keyword If    ${rcode} and "${check_metadata}" and ${ethertype} == "True"    OpenStackOperations.Check Metadata Access
-    [Teardown]    Exit From Vm Console
+    [Teardown]    Exit From Vm Console    ${console}
 
 Test Netcat Operations From Vm Instance
     [Arguments]    ${net_name}    ${vm_ip}    ${dest_ip}    ${additional_args}=${EMPTY}    ${port}=12345    ${user}=cirros
@@ -542,9 +546,9 @@ Test Netcat Operations From Vm Instance
     BuiltIn.Should Match Regexp    ${nc_output}    ${server_data}
 
 Ping Other Instances
-    [Arguments]    ${list_of_external_dst_ips}
+    [Arguments]    ${list_of_external_dst_ips}    ${console}=cirros
     [Documentation]    Check reachability with other network's instances.
-    ${rcode} =    BuiltIn.Run Keyword And Return Status    OpenStackOperations.Check If Console Is VmInstance
+    ${rcode} =    BuiltIn.Run Keyword And Return Status    OpenStackOperations.Check If Console Is VmInstance    ${console}
     : FOR    ${dest_ip}    IN    @{list_of_external_dst_ips}
     \    OpenStackOperations.Check Ping    ${dest_ip}
 
index a00cd3920ad54b751da467f3f01dbb868e260f16..d39cdde4394cff9c46c3dc64150268c60c4f0834 100644 (file)
@@ -232,7 +232,7 @@ Check Vm Instances Have Ip Address And Ready For Test
     BuiltIn.Set Suite Variable    @{NET1_VM_IPS}
     BuiltIn.Set Suite Variable    ${SF1_IP}
     BuiltIn.Wait Until Keyword Succeeds    300s    60s    OpenStackOperations.Check If Instance Is Ready For Ssh Login Using PublicKey    @{NETWORKS}[0]    ${SF1_IP}    user=ubuntu
-    ...    idfile=/tmp/odlsfctest
+    ...    idfile=/tmp/odlsfctest    console=ubuntu
     BuiltIn.Wait Until Keyword Succeeds    300s    60s    OpenStackOperations.Check If Instance Is Ready For Ssh Login Using Password    @{NETWORKS}[0]    @{NET1_VM_IPS}[0]
     BuiltIn.Wait Until Keyword Succeeds    300s    60s    OpenStackOperations.Check If Instance Is Ready For Ssh Login Using Password    @{NETWORKS}[0]    @{NET1_VM_IPS}[1]
     OpenStackOperations.Show Debugs    @{NET_1_VMS}
@@ -248,17 +248,17 @@ Start Applications on VM Instances For Test
     BuiltIn.Comment    Copy vxlan_tool script to SFC VM
     OpenStackOperations.Copy File To VM Instance With PublicKey Auth    @{NETWORKS}[0]    ${SF1_IP}    /tmp/vxlan_tool.py    user=${CLOUD_USER_NAME}    idfile=/tmp/odlsfctest
     BuiltIn.Comment    Bring up the second Interface for egress
-    Execute Command on VM Instance with PublicKey Auth    @{NETWORKS}[0]    ${SF1_IP}    sudo ifconfig ens3 up    user=${CLOUD_USER_NAME}    idfile=/tmp/odlsfctest
+    Execute Command on VM Instance with PublicKey Auth    @{NETWORKS}[0]    ${SF1_IP}    sudo ifconfig ens3 up    user=${CLOUD_USER_NAME}    idfile=/tmp/odlsfctest    console=ubuntu
 
 Start Vxlan Tool in SF
     [Arguments]    ${network}    ${sf_vm_ip}    ${args}=${EMPTY}
     [Documentation]    Starts the tool in the SF VM's
-    Execute Command on VM Instance with PublicKey Auth    ${network}    ${sf_vm_ip}    nohup sudo python3 /tmp/vxlan_tool.py ${args} &    user=ubuntu    idfile=/tmp/odlsfctest
+    Execute Command on VM Instance with PublicKey Auth    ${network}    ${sf_vm_ip}    nohup sudo python3 /tmp/vxlan_tool.py ${args} &    user=ubuntu    idfile=/tmp/odlsfctest    console=ubuntu
 
 Stop Vxlan Tool in SF
     [Arguments]    ${network}    ${sf_vm_ip}
     [Documentation]    Starts the tool in the SF VM's
-    Execute Command on VM Instance With PublicKey Auth    ${network}    ${sf_vm_ip}    sudo pkill python3    user=ubuntu    idfile=/tmp/odlsfctest
+    Execute Command on VM Instance With PublicKey Auth    ${network}    ${sf_vm_ip}    sudo pkill python3    user=ubuntu    idfile=/tmp/odlsfctest    console=ubuntu
 
 Access Http And Check Status
     [Arguments]    ${vm_ip}    ${curl_command}    ${ret_code}    ${cmd_timeout}=30s