X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FOpenStackOperations.robot;h=b43ee7aeaeb3f990f376a6525a7f9cc837defe9c;hb=09a995a3a18ba1e05da0a5fe74d5a358d06da31e;hp=9fc431d06f1b7eaeda44f503df17645206f279b0;hpb=293646a0b064801271ff868cb2b5b7f321f89caa;p=integration%2Ftest.git diff --git a/csit/libraries/OpenStackOperations.robot b/csit/libraries/OpenStackOperations.robot index 9fc431d06f..b43ee7aeae 100644 --- a/csit/libraries/OpenStackOperations.robot +++ b/csit/libraries/OpenStackOperations.robot @@ -1,6 +1,7 @@ *** Settings *** Documentation Openstack library. This library is useful for tests to create network, subnet, router and vm instances Library Collections +Library Process Library OperatingSystem Library RequestsLibrary Library SSHLibrary @@ -489,8 +490,8 @@ Show Router Interface [Return] ${output} Add Router Gateway - [Arguments] ${router_name} ${external_network_name} - ${output} = OpenStack CLI openstack router set ${router_name} --external-gateway ${external_network_name} + [Arguments] ${router_name} ${external_network_name} ${additional_args}=${EMPTY} + ${output} = OpenStack CLI openstack router set ${router_name} --external-gateway ${external_network_name} ${additional_args} Remove Interface [Arguments] ${router_name} ${interface_name} @@ -500,7 +501,7 @@ Remove Interface Remove Gateway [Arguments] ${router_name} [Documentation] Remove external gateway from the router. - BuiltIn.Log openstack router unset ${router_name} --external-gateway + ${output} = OpenStack CLI openstack router unset ${router_name} --external-gateway Update Router [Arguments] ${router_name} ${cmd} @@ -508,9 +509,10 @@ Update Router ${output} = OpenStack CLI openstack router set ${router_name} ${cmd} Show Router - [Arguments] ${router_name} ${options} + [Arguments] ${router_name} ${additional_args}=${EMPTY} [Documentation] Show information of a given router. Router name and optional fields should be sent as arguments. - ${output} = OpenStack CLI openstack router show ${router_name} + ${output} = OpenStack CLI openstack router show ${router_name} ${additional_args} + [Return] ${output} Delete Router [Arguments] ${router_name} @@ -548,11 +550,14 @@ Get OvsDebugInfo \ OpenStackOperations.Get DumpFlows And Ovsconfig ${conn_id} Get Test Teardown Debugs - [Arguments] ${test_name}=${SUITE_NAME}.${TEST_NAME} + [Arguments] ${test_name}=${SUITE_NAME}.${TEST_NAME} ${fail}=${FAIL_ON_EXCEPTIONS} + ODLTools.Get All test_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} + KarafKeywords.Fail If Exceptions Found During Test ${test_name} fail=${fail} + +Get Suite Debugs + Get Test Teardown Debugs test_name=${SUITE_NAME} fail=False Get Test Teardown Debugs For SFC [Arguments] ${test_name}=${TEST_NAME} @@ -947,17 +952,18 @@ OpenStack CLI Get List OpenStack CLI [Arguments] ${cmd} [Documentation] Run the given OpenStack ${cmd} and log the output. - ${rc} ${output} = OperatingSystem.Run And Return Rc And Output ${cmd} - BuiltIn.Log ${output} - BuiltIn.Should Be True '${rc}' == '0' - [Return] ${output} + ${result} = Process.Run Process ${cmd} shell=True + BuiltIn.Log ${result.stdout} + BuiltIn.Log ${result.stderr} + BuiltIn.Should Be True '${result.rc}' == '0' + [Return] ${result.stdout} OpenStack CLI With No Log [Arguments] ${cmd} [Documentation] Run the given OpenStack ${cmd} and do not log the output. - ${rc} ${output} = OperatingSystem.Run And Return Rc And Output ${cmd} - BuiltIn.Should Be True '${rc}' == '0' - [Return] ${output} + ${result} = Process.Run Process ${cmd} shell=True + BuiltIn.Should Be True '${result.rc}' == '0' + [Return] ${result.stdout} OpenStack Cleanup All [Documentation] Cleanup all Openstack resources with best effort. The keyword will query for all resources @@ -1003,7 +1009,7 @@ OpenStack Suite Setup 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 + Run_Keyword_If_At_Least_Oxygen Wait Until Keyword Succeeds 60 2 ClusterManagement.Check Status Of Services Is OPERATIONAL @{NETVIRT_DIAG_SERVICES} Verify Expected Default Tables On Nodes OpenStack Suite Teardown @@ -1011,6 +1017,9 @@ OpenStack Suite Teardown ... to clean up all openstack resources. For example, all instances, networks, ports, etc will be listed and ... and deleted. As other global cleanup tasks are needed, they can be added here and the suites will all ... benefit automatically. + # TODO: followup patch will add the list of vms to pass to Show Debugs + # OpenStackOperations.Show Debugs @{NET_1_VMS} @{NET_2_VMS} + OpenStackOperations.Get Suite Debugs OpenStack Cleanup All OpenStackOperations.Stop Packet Capture On Nodes ${tcpdump_port_6653_conn_ids} SSHLibrary.Close All Connections @@ -1102,16 +1111,25 @@ Get Network Segmentation Id 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} + ${failed_node_list} = BuiltIn.Create List : FOR ${node_ip} IN @{node_ips} - \ Verify Expected Default Tables ${node_ip} + \ ${failed_table_list} = Verify Expected Default Tables ${node_ip} + \ ${failed_table_list_size} = BuiltIn.Get Length ${failed_table_list} + \ BuiltIn.Run Keyword If ${failed_table_list_size} > 0 Collections.Append To List ${failed_node_list} ${node_ip} + Builtin.Should Be Empty ${failed_node_list} Verify Expected Default Tables [Arguments] ${ovs_ip} [Documentation] Verify if Default Table Entries are programmed on specific Node - ${flow_dump} = Utils.Write Commands Until Expected Prompt sudo ovs-ofctl dump-flows ${INTEGRATION_BRIDGE} -OOpenFlow13 ${DEFAULT_LINUX_PROMPT_STRICT} + ${flow_dump} = Utils.Run Command On Remote System ${ovs_ip} sudo ovs-ofctl dump-flows ${INTEGRATION_BRIDGE} -OOpenFlow13 BuiltIn.Log ${flow_dump} + ${failed_table_list} = BuiltIn.Create List : FOR ${table} IN @{DEFAULT_FLOW_TABLES} - \ Builtin.Should Match Regexp ${flow_dump} .*table=${table}.*priority=0 + \ ${rc} = Builtin.Run Keyword And Return Status Builtin.Should Not Match Regexp ${flow_dump} .*table=${table}.*priority=0 + \ BuiltIn.Run Keyword If ${rc} Collections.Append To List ${failed_table_list} ${table} + [Return] ${failed_table_list} Get Project Id [Arguments] ${project_name}