Remove redundant ovs debug
[integration/test.git] / csit / libraries / OpenStackOperations.robot
index 0f89dc8be1a1838e6b6828def714847455854ef4..bab2598fa78f07e89aeae2e36dabb7ab9d2f7b74 100644 (file)
@@ -269,6 +269,8 @@ Verify VMs Received DHCP Lease
     \    ${dhcp_ip_line}=    Write Commands Until Prompt    nova console-log ${vm} | grep "^nameserver"    30s
     \    Log    ${dhcp_ip_line}
     \    @{dhcp_ip}    Get Regexp Matches    ${dhcp_ip_line}    [0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}
+    \    ${dhcp_ip_length}    Get Length    ${dhcp_ip}
+    \    Run Keyword If    ${dhcp_ip_length}<=0    Append To List    ${dhcp_ip}    None
     \    Log    ${dhcp_ip}
     ${dhcp_length}    Get Length    ${dhcp_ip}
     Return From Keyword If    ${dhcp_length}==0    ${ip_list}    ${EMPTY}
@@ -523,23 +525,22 @@ Get DumpFlows And Ovsconfig
     SSHLibrary.Open Connection    ${openstack_node_ip}    prompt=${DEFAULT_LINUX_PROMPT}
     Utils.Flexible SSH Login    ${OS_USER}    ${DEVSTACK_SYSTEM_PASSWORD}
     SSHLibrary.Set Client Configuration    timeout=${default_devstack_prompt_timeout}
-    Write Commands Until Expected Prompt    ip -o link    ]>
-    Write Commands Until Expected Prompt    ip -o addr    ]>
-    Write Commands Until Expected Prompt    ip route    ]>
-    Write Commands Until Expected Prompt    arp -an    ]>
-    ${nslist}=    Write Commands Until Expected Prompt    ip netns list | awk '{print $1}'    ]>
+    Write Commands Until Expected Prompt    ip -o link    ${DEFAULT_LINUX_PROMPT_STRICT}
+    Write Commands Until Expected Prompt    ip -o addr    ${DEFAULT_LINUX_PROMPT_STRICT}
+    Write Commands Until Expected Prompt    ip route    ${DEFAULT_LINUX_PROMPT_STRICT}
+    Write Commands Until Expected Prompt    arp -an    ${DEFAULT_LINUX_PROMPT_STRICT}
+    ${nslist}=    Write Commands Until Expected Prompt    ip netns list | awk '{print $1}'    ${DEFAULT_LINUX_PROMPT_STRICT}
     @{lines}    Split To Lines    ${nslist}
     : FOR    ${line}    IN    @{lines}
-    \    Write Commands Until Expected Prompt    sudo ip netns exec ${line} ip -o link    ]>
-    \    Write Commands Until Expected Prompt    sudo ip netns exec ${line} ip -o addr    ]>
-    \    Write Commands Until Expected Prompt    sudo ip netns exec ${line} ip route    ]>
-    Write Commands Until Expected Prompt    sudo ovs-vsctl show    ]>
-    Write Commands Until Expected Prompt    sudo ovs-vsctl list Open_vSwitch    ]>
-    Write Commands Until Expected Prompt    sudo ovs-ofctl show br-int -OOpenFlow13    ]>
-    Write Commands Until Expected Prompt    sudo ovs-ofctl dump-ports-desc br-int -OOpenFlow13    ]>
-    Write Commands Until Expected Prompt    sudo ovs-ofctl dump-flows br-int -OOpenFlow13    ]>
-    Write Commands Until Expected Prompt    sudo ovs-ofctl dump-groups br-int -OOpenFlow13    ]>
-    Write Commands Until Expected Prompt    sudo ovs-ofctl dump-group-stats br-int -OOpenFlow13    ]>
+    \    Write Commands Until Expected Prompt    sudo ip netns exec ${line} ip -o link    ${DEFAULT_LINUX_PROMPT_STRICT}
+    \    Write Commands Until Expected Prompt    sudo ip netns exec ${line} ip -o addr    ${DEFAULT_LINUX_PROMPT_STRICT}
+    \    Write Commands Until Expected Prompt    sudo ip netns exec ${line} ip route    ${DEFAULT_LINUX_PROMPT_STRICT}
+    Write Commands Until Expected Prompt    sudo ovs-vsctl show    ${DEFAULT_LINUX_PROMPT_STRICT}
+    Write Commands Until Expected Prompt    sudo ovs-vsctl list Open_vSwitch    ${DEFAULT_LINUX_PROMPT_STRICT}
+    Write Commands Until Expected Prompt    sudo ovs-ofctl show br-int -OOpenFlow13    ${DEFAULT_LINUX_PROMPT_STRICT}
+    Write Commands Until Expected Prompt    sudo ovs-ofctl dump-flows br-int -OOpenFlow13    ${DEFAULT_LINUX_PROMPT_STRICT}
+    Write Commands Until Expected Prompt    sudo ovs-ofctl dump-groups br-int -OOpenFlow13    ${DEFAULT_LINUX_PROMPT_STRICT}
+    Write Commands Until Expected Prompt    sudo ovs-ofctl dump-group-stats br-int -OOpenFlow13    ${DEFAULT_LINUX_PROMPT_STRICT}
 
 Get Karaf Log Type From Test Start
     [Arguments]    ${ip}    ${test_name}    ${type}    ${user}=${ODL_SYSTEM_USER}    ${password}=${ODL_SYSTEM_PASSWORD}    ${prompt}=${ODL_SYSTEM_PROMPT}
@@ -578,7 +579,7 @@ Get OvsDebugInfo
 Get Test Teardown Debugs
     [Arguments]    ${test_name}=${TEST_NAME}
     Get OvsDebugInfo
-    Get Model Dump    ${HA_PROXY_IP}
+    Run Keyword And Ignore Error    Get Model Dump    ${HA_PROXY_IP}
     Get Karaf Log Events From Test Start    ${test_name}
 
 Get Suite Teardown Debugs
@@ -728,3 +729,18 @@ Create Neutron Port With Additional Params
     Log    ${port_id}
     Close Connection
     [Return]    ${OUTPUT}    ${port_id}
+
+Get Ports MacAddr
+    [Arguments]    ${portName_list}
+    [Documentation]    Retrieve the port MacAddr for the given list of port name and return the MAC address list.
+    ${devstack_conn_id}=    Get ControlNode Connection
+    Switch Connection    ${devstack_conn_id}
+    ${MacAddr-list}    Create List
+    : FOR    ${portName}    IN    @{portName_list}
+    \    ${output} =    Write Commands Until Prompt    neutron port-list | grep "${portName}" | awk '{print $6}'    30s
+    \    Log    ${output}
+    \    ${splitted_output}=    Split String    ${output}    ${EMPTY}
+    \    ${macAddr}=    Get from List    ${splitted_output}    0
+    \    Log    ${macAddr}
+    \    Append To List    ${MacAddr-list}    ${macAddr}
+    [Return]    ${MacAddr-list}