From f1e6f63879710d7899107eb32880549a7edbe1c5 Mon Sep 17 00:00:00 2001 From: JayaPr Date: Wed, 20 Mar 2019 22:28:10 +0530 Subject: [PATCH] Add ping test in aclrecovery suite Add ping test in aclrecovery suite. The previous suite was checking for flows table, Modified it to check for ping. Change-Id: I9eb4756506963f58207d0b575a78ba68d16c31d9 Signed-off-by: JayaPr --- .../aclservicerecovery.robot | 56 +++++++++---------- csit/testplans/netvirt-1node-openstack.txt | 1 + .../netvirt-1node-tdd-wip-openstack.txt | 1 - 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/csit/suites/netvirt/aclservicerecovery/aclservicerecovery.robot b/csit/suites/netvirt/aclservicerecovery/aclservicerecovery.robot index 1ffafa3c1c..ef6bf620d5 100644 --- a/csit/suites/netvirt/aclservicerecovery/aclservicerecovery.robot +++ b/csit/suites/netvirt/aclservicerecovery/aclservicerecovery.robot @@ -16,7 +16,6 @@ Library String Resource ../../../libraries/DevstackUtils.robot Resource ../../../libraries/Genius.robot Resource ../../../libraries/KarafKeywords.robot -Resource ../../../variables/netvirt/Variables.robot Resource ../../../libraries/OVSDB.robot Resource ../../../libraries/OvsManager.robot Resource ../../../libraries/OpenStackOperations.robot @@ -41,24 +40,31 @@ ACL Service Recovery CLI ${count_before} = OvsManager.Get Dump Flows Count ${OS_CMP1_CONN_ID} ${INGRESS_ACL_REMOTE_ACL_TABLE} ${node_id} = OVSDB.Get DPID ${OS_CMP1_IP} ${resp} = RequestsLibrary.Delete Request session ${CONFIG_NODES_API}/node/openflow:${node_id}/flow-node-inventory:table/${INGRESS_ACL_REMOTE_ACL_TABLE} - Should Be Equal As Strings ${resp.status_code} 200 - Wait Until Keyword Succeeds 30s 5s Verify ACL Flows Should Not Contain ${OS_CMP1_CONN_ID} ${INGRESS_ACL_REMOTE_ACL_TABLE} + BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 + OpenStackOperations.Ping From DHCP Should Not Succeed @{acl_sr_networks}[0] @{ACL_SR_NET_1_VM_IPS}[0] + ${flow_after_delete} = OvsManager.Get Dump Flows Count ${OS_CMP1_CONN_ID} ${INGRESS_ACL_REMOTE_ACL_TABLE} + BuiltIn.Should Be Equal As Strings ${flow_after_delete} 0 ${output} = Issue_Command_On_Karaf_Console srm:recover service acl - Should Contain ${output} RPC call to recover was successful - Wait Until Keyword Succeeds 30s 5s Verify Flow Counts Are Same ${count_before} ${INGRESS_ACL_REMOTE_ACL_TABLE} + BuiltIn.Should Contain ${output} RPC call to recover was successful + OpenStackOperations.Ping Vm From DHCP Namespace @{acl_sr_networks}[0] @{ACL_SR_NET_1_VM_IPS}[0] + BuiltIn.Wait Until Keyword Succeeds 30s 5s Verify Flow Counts Are Same ${count_before} ${INGRESS_ACL_REMOTE_ACL_TABLE} ACL Instance Recovery CLI [Documentation] This test case covers ACL instance recovery. ${count_before} = OvsManager.Get Dump Flows Count ${OS_CMP1_CONN_ID} ${EGRESS_LEARN_ACL_FILTER_TABLE} ${node_id} = OVSDB.Get DPID ${OS_CMP1_IP} Write Commands Until Expected Prompt sudo ovs-ofctl del-flows br-int -OOpenflow13 "table=${EGRESS_LEARN_ACL_FILTER_TABLE},icmp" ${DEFAULT_LINUX_PROMPT_STRICT} - Wait Until Keyword Succeeds 30s 5s Verify ACL Flows Should Not Contain ${OS_CMP1_CONN_ID} ${EGRESS_LEARN_ACL_FILTER_TABLE} icmp + Wait Until Keyword Succeeds 30s 5s OVSDB.Verify Dump Flows For Specific Table ${OS_CMP1_IP} ${EGRESS_LEARN_ACL_FILTER_TABLE} False + ... |grep icmp + OpenStackOperations.Ping From DHCP Should Not Succeed @{acl_sr_networks}[0] @{ACL_SR_NET_1_VM_IPS}[0] ${output} = OpenStack CLI openstack security group show ${acl_sr_security_group} | awk '/ id / {print $4}' ${splitted_output} = String.Split String ${output} ${EMPTY} ${instance_id} = Collections.Get from List ${splitted_output} 0 ${output} = Issue_Command_On_Karaf_Console srm:recover instance acl-instance ${instance_id} - Should Contain ${output} RPC call to recover was successful - Wait Until Keyword Succeeds 30s 5s Verify ACL Flows Should Contain ${OS_CMP1_CONN_ID} ${EGRESS_LEARN_ACL_FILTER_TABLE} icmp + BuiltIn.Should Contain ${output} RPC call to recover was successful + OpenStackOperations.Ping Vm From DHCP Namespace @{acl_sr_networks}[0] @{ACL_SR_NET_1_VM_IPS}[0] + Wait Until Keyword Succeeds 30s 5s OVSDB.Verify Dump Flows For Specific Table ${OS_CMP1_IP} ${EGRESS_LEARN_ACL_FILTER_TABLE} True + ... ${EMPTY} icmp Wait Until Keyword Succeeds 30s 5s Verify Flow Counts Are Same ${count_before} ${EGRESS_LEARN_ACL_FILTER_TABLE} ACL Interface Recovery CLI @@ -69,13 +75,17 @@ ACL Interface Recovery CLI ${count_before} = OvsManager.Get Dump Flows Count ${OS_CMP1_CONN_ID} ${EGRESS_ACL_TABLE} port_mac=${port_mac} ${node_id} OVSDB.Get DPID ${OS_CMP1_IP} Write Commands Until Expected Prompt sudo ovs-ofctl del-flows br-int -OOpenflow13 "table=${EGRESS_ACL_TABLE},dl_dst=${port_mac}" ${DEFAULT_LINUX_PROMPT_STRICT} - Wait Until Keyword Succeeds 30s 5s Verify ACL Flows Should Not Contain ${OS_CMP1_CONN_ID} ${EGRESS_ACL_TABLE} ${port_mac} + OpenStackOperations.Ping From DHCP Should Not Succeed @{acl_sr_networks}[0] @{ACL_SR_NET_1_VM_IPS}[0] + Wait Until Keyword Succeeds 30s 5s OVSDB.Verify Dump Flows For Specific Table ${OS_CMP1_IP} ${EGRESS_LEARN_ACL_FILTER_TABLE} False + ... |grep ${port_mac} ${output} = OpenStack CLI openstack port show ${acl_sr_net_1_ports[0]} |awk '/ id / {print$4}' ${splitted_output} = String.Split String ${output} ${EMPTY} ${interface_id} = Collections.Get from List ${splitted_output} 0 ${output} = Issue_Command_On_Karaf_Console srm:recover instance acl-interface ${interface_id} - Should Contain ${output} RPC call to recover was successful - Wait Until Keyword Succeeds 30s 5s Verify ACL Flows Should Contain ${OS_CMP1_CONN_ID} ${EGRESS_ACL_TABLE} ${port_mac} + BuiltIn.Should Contain ${output} RPC call to recover was successful + OpenStackOperations.Ping Vm From DHCP Namespace @{acl_sr_networks}[0] @{ACL_SR_NET_1_VM_IPS}[0] + Wait Until Keyword Succeeds 30s 5s OVSDB.Verify Dump Flows For Specific Table ${OS_CMP1_IP} ${EGRESS_ACL_TABLE} True + ... ${EMPTY} ${port_mac} Wait Until Keyword Succeeds 30s 5s Verify Flow Counts Are Same ${count_before} ${EGRESS_ACL_TABLE} port_mac=${port_mac} *** Keywords *** @@ -83,23 +93,7 @@ Verify Flow Counts Are Same [Arguments] ${count_before} ${table_id} ${port_mac}="" [Documentation] Verify flows count should be same as before and after for a table id with a given port mac. ${count_after} = OvsManager.Get Dump Flows Count ${OS_CMP1_CONN_ID} ${table_id} port_mac=${port_mac} - Should Be Equal As Numbers ${count_before} ${count_after} - -Verify ACL Flows Should Not Contain - [Arguments] ${conn_id} ${table_id} ${acl_var}=${None} - [Documentation] Verify dump flows should not be having the table id. - SSHLibrary.Switch Connection ${conn_id} - ${output} = Write Commands Until Expected Prompt sudo ovs-ofctl dump-flows br-int -OOpenFlow13 | grep table=${table_id} ${DEFAULT_LINUX_PROMPT_STRICT} - BuiltIn.Run Keyword If '${acl_var}'=='None' Should Not Contain ${output} table=${table_id} - ... ELSE Should Not Contain ${output} ${acl_var} - -Verify ACL Flows Should Contain - [Arguments] ${conn_id} ${table_id} ${acl_var}=${None} - [Documentation] Verify dump flows should be having the table id. - SSHLibrary.Switch Connection ${conn_id} - ${output} = Write Commands Until Expected Prompt sudo ovs-ofctl dump-flows br-int -OOpenFlow13 | grep table=${table_id} ${DEFAULT_LINUX_PROMPT_STRICT} - BuiltIn.Run Keyword If '${acl_var}'=='None' Should Contain ${output} table=${table_id} - ... ELSE Should Contain ${output} ${acl_var} + BuiltIn.Should Be Equal As Numbers ${count_before} ${count_after} Suite Setup [Documentation] Create Basic setup for the feature. Creates single network, subnet, two ports and two VMs. @@ -113,3 +107,9 @@ Suite Setup BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${PORT_URL} ${acl_sr_net_1_ports} OpenStackOperations.Create Vm Instance With Port On Compute Node ${acl_sr_net_1_ports[0]} ${acl_sr_net_1_vms[0]} ${OS_CMP1_HOSTNAME} sg=${acl_sr_security_group} OpenStackOperations.Create Vm Instance With Port On Compute Node ${acl_sr_net_1_ports[1]} ${acl_sr_net_1_vms[1]} ${OS_CMP2_HOSTNAME} sg=${acl_sr_security_group} + @{ACL_SR_NET_1_VM_IPS} ${net1_dhcp_ip} = OpenStackOperations.Get VM IPs @{acl_sr_net_1_vms} + BuiltIn.Set Suite Variable @{ACL_SR_NET_1_VM_IPS} + BuiltIn.Should Not Contain ${ACL_SR_NET_1_VM_IPS} None + BuiltIn.Should Not Contain ${net1_dhcp_ip} None + OpenStackOperations.Ping Vm From DHCP Namespace @{acl_sr_networks}[0] @{ACL_SR_NET_1_VM_IPS}[0] + OpenStackOperations.Ping Vm From DHCP Namespace @{acl_sr_networks}[0] @{ACL_SR_NET_1_VM_IPS}[1] diff --git a/csit/testplans/netvirt-1node-openstack.txt b/csit/testplans/netvirt-1node-openstack.txt index 1436e308fc..2cc937078b 100644 --- a/csit/testplans/netvirt-1node-openstack.txt +++ b/csit/testplans/netvirt-1node-openstack.txt @@ -6,6 +6,7 @@ integration/test/csit/suites/openstack/connectivity/live_migration.robot integration/test/csit/suites/openstack/securitygroup/neutron_security_group.robot integration/test/csit/suites/openstack/securitygroup/security_group_l3bcast.robot integration/test/csit/suites/openstack/securitygroup/acl.robot +integration/test/csit/suites/netvirt/aclservicerecovery/aclservicerecovery.robot integration/test/csit/suites/netvirt/vpnservice/vpn_basic.robot integration/test/csit/suites/netvirt/vpnservice/vpn_basic_ipv6.robot integration/test/csit/suites/netvirt/elan/elan.robot diff --git a/csit/testplans/netvirt-1node-tdd-wip-openstack.txt b/csit/testplans/netvirt-1node-tdd-wip-openstack.txt index 68270326fa..3a7e6b223b 100644 --- a/csit/testplans/netvirt-1node-tdd-wip-openstack.txt +++ b/csit/testplans/netvirt-1node-tdd-wip-openstack.txt @@ -4,7 +4,6 @@ integration/test/csit/suites/netvirt/vpnservice/vpn_basic_dualstack_one_router.robot integration/test/csit/suites/netvirt/vpnservice/vpn_basic_dualstack_subnet_routing.robot integration/test/csit/suites/netvirt/host_route/host_route_handling.robot -integration/test/csit/suites/netvirt/aclservicerecovery/aclservicerecovery.robot integration/test/csit/suites/netvirt/snatdnat/snat_dnat.robot integration/test/csit/suites/netvirt/bgpmultipath/l3vpn_bgp_multipath.robot integration/test/csit/suites/netvirt/multibgpvpn/multi_vpn_bgp.robot -- 2.36.6