Subnet Broadcast Tests added. 75/74275/34
authorShivanand <shivanand.nandargi@gmail.com>
Fri, 20 Jul 2018 12:31:28 +0000 (05:31 -0700)
committerSam Hague <shague@redhat.com>
Tue, 14 Aug 2018 16:26:08 +0000 (16:26 +0000)
Change-Id: Ib7cb7bb379042bc2bb143d5083613832d9c85e5c
Signed-off-by: Shivanand <shivanand.nandargi@gmail.com>
csit/libraries/OvsManager.robot
csit/suites/openstack/securitygroup/security_group_l3bcast.robot

index 1c60b152a08709b89a0e8296b4b8eb492fa6a9b8..f3852fd9d8dae1549234c65febfec40bd5947556 100644 (file)
@@ -228,9 +228,9 @@ Get Packet Count From Table
     [Return]    ${packetcount}
 
 Get Packet Count In Table For IP
-    [Arguments]    ${os_compute_ip}    ${table_no}    ${ip_address}
+    [Arguments]    ${os_compute_ip}    ${table_no}    ${ip_address}    ${additional_args}=${EMPTY}
     [Documentation]    Capture packetcount for IP in Table
-    ${cmd} =    BuiltIn.Set Variable    sudo ovs-ofctl dump-flows br-int -OOpenFlow13 | grep table=${table_no} | grep ${ip_address}
+    ${cmd} =    BuiltIn.Set Variable    sudo ovs-ofctl dump-flows br-int -OOpenFlow13 | grep table=${table_no} | grep ${ip_address} ${additional_args}
     ${output} =    Utils.Run Command On Remote System And Log    ${os_compute_ip}    ${cmd}
     @{output_list} =    String.Split String    ${output}    \r\n
     ${flow} =    Collections.Get From List    ${output_list}    0
index cac298d9f5b3df42012f0482c5838b72ac9b9f04..2a121c59c9f84765e0465897410e10211de55d54 100644 (file)
@@ -37,20 +37,40 @@ ${PACKET_COUNT_CMB}    10
 ${PACKET_DIFF}    0
 ${PACKET_DIFF_CMB}    5
 ${BCAST_IP}       255.255.255.255
-${SUBNET1_BCAST_IP}    10.0.0.255
-${SUBNET2_BCAST_IP}    20.0.0.255
+${SUBNET1_BCAST_IP}    55.0.0.255
+${SUBNET2_BCAST_IP}    56.0.0.255
 ${ENABLE_BCAST}    echo 0 | sudo tee /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
 
 *** Test case ***
 Verify Network Broadcast traffic between the VMs hosted in Single Network
     [Documentation]    This TC is to verify Network Broadcast traffic between the VMs hosted in Same Network on same/different compute node
-    Wait Until Keyword Succeeds    30s    5s    Verify L3Broadcast With Antispoofing Table    ${OS_CMP1_IP}    ${EGRESS_ACL_TABLE}    ${BCAST_IP}
-    ...    @{VM_IPS}[0]    same
+    Wait Until Keyword Succeeds    30s    5s    Verify L3Broadcast With Antispoofing Table    ${OS_COMPUTE1_IP}    ${EGRESS_ACL_TABLE}    ${BCAST_IP}
+    ...    @{VM_IPS}[0]    same    pingsuccess
 
 Verify Network Broadcast traffic between the VMs hosted in Multi Network
     [Documentation]    This TC is to verify Network Broadcast traffic between the VMs hosted in Different Network on same/different compute node.
-    Wait Until Keyword Succeeds    30s    5s    Verify L3Broadcast With Antispoofing Table    ${OS_CMP1_IP}    ${EGRESS_ACL_TABLE}    ${BCAST_IP}
-    ...    @{VM_IPS}[3]    different
+    Wait Until Keyword Succeeds    30s    5s    Verify L3Broadcast With Antispoofing Table    ${OS_COMPUTE1_IP}    ${EGRESS_ACL_TABLE}    ${BCAST_IP}
+    ...    @{VM_IPS}[3]    different    pingsuccess
+
+Verify Subnet Broadcast traffic between the VMs hosted on same compute node in Single Network
+    [Documentation]    Verify L3-Subnet Broadcast traffic between the VMs hosted on same compute node in Single Network
+    Wait Until Keyword Succeeds    30s    5s    Verify L3Broadcast With Antispoofing Table    ${OS_COMPUTE1_IP}    ${EGRESS_ACL_TABLE}    ${SUBNET1_BCAST_IP}
+    ...    @{VM_IPS}[0]    same    pingsuccess    ${VM2_SUBMETA}    additional_args=| grep ${VM2_SUBMETA}
+
+Verify Subnet Broadcast traffic between the VMs hosted on Different compute node in Single Network
+    [Documentation]    Verify L3-Subnet Broadcast traffic between the VMs hosted on same compute node in Single Network
+    Wait Until Keyword Succeeds    30s    5s    Verify L3Broadcast With Antispoofing Table    ${OS_COMPUTE2_IP}    ${EGRESS_ACL_TABLE}    ${SUBNET1_BCAST_IP}
+    ...    @{VM_IPS}[0]    same    pingsuccess    ${VM3_SUBMETA}    additional_args=| grep ${VM3_SUBMETA}
+
+Verify Subnet Broadcast traffic between the VMs hosted on same compute node in Multi Network
+    [Documentation]    Verify L3-Subnet Broadcast traffic between the VMs hosted on same compute node in Multi Network
+    Wait Until Keyword Succeeds    30s    5s    Verify L3Broadcast With Antispoofing Table    ${OS_COMPUTE1_IP}    ${EGRESS_ACL_TABLE}    ${SUBNET2_BCAST_IP}
+    ...    @{VM_IPS}[0]    different    nosuccess    ${VM4_SUBMETA}    additional_args=| grep ${VM4_SUBMETA}
+
+Verify Subnet Broadcast traffic between the VMs hosted on Different compute node in Multi Network
+    [Documentation]    Verify L3-Subnet Broadcast traffic between the VMs hosted on Different compute node in Multi Network
+    Wait Until Keyword Succeeds    30s    5s    Verify L3Broadcast With Antispoofing Table    ${OS_COMPUTE2_IP}    ${EGRESS_ACL_TABLE}    ${SUBNET2_BCAST_IP}
+    ...    @{VM_IPS}[0]    different    nosuccess    ${VM5_SUBMETA}    additional_args=| grep ${VM5_SUBMETA}
 
 *** Keywords ***
 Start Suite
@@ -134,15 +154,15 @@ Get Submetadata
     \    Return From Keyword if    ${metadata_check_status} == True    ${meta}
 
 Verify L3Broadcast With Antispoofing Table
-    [Arguments]    ${OS_COMPUTE_IP}    ${EGRESS_ACL_TABLE}    ${BCAST_IP}    ${vm_ip}    ${subnet_var}
+    [Arguments]    ${OS_COMPUTE_IP}    ${EGRESS_ACL_TABLE}    ${BCAST_IP}    ${vm_ip}    ${subnet_var}    ${ping_response}='pingsuccess'
+    ...    ${vm_submeta}=''    ${additional_args}=${EMPTY}
     [Documentation]    Verify the l3 broadcast requests are hitting to antispoofing table in same subnet
-    ${get_pkt_count_before_bcast} =    OvsManager.Get Packet Count In Table For IP    ${OS_COMPUTE_IP}    ${EGRESS_ACL_TABLE}    ${BCAST_IP}
+    ${get_pkt_count_before_bcast} =    OvsManager.Get Packet Count In Table For IP    ${OS_COMPUTE_IP}    ${EGRESS_ACL_TABLE}    ${BCAST_IP}    additional_args=| grep ${vm_submeta}
     ${output} =    OpenStackOperations.Execute Command on VM Instance    @{NETWORKS}[0]    ${vm_ip}    ping -c ${PACKET_COUNT} ${BCAST_IP}
-    BuiltIn.Should Contain    ${output}    ${PING_REGEXP}
-    ${bcast_egress} =    Utils.Run Command On Remote System And Log    ${OS_COMPUTE_IP}    ${DUMP_FLOW} | grep table=${EGRESS_ACL_TABLE} | grep ${BCAST_IP}
-    ${get_pkt_count_after_bcast} =    OvsManager.Get Packet Count In Table For IP    ${OS_COMPUTE_IP}    ${EGRESS_ACL_TABLE}    ${BCAST_IP}
+    BuiltIn.Run Keyword If    '${ping_response}'=='pingsuccess'    BuiltIn.Should Contain    ${output}    ${PING_REGEXP}
+    ...    ELSE    BuiltIn.Should Contain    ${output}    ${NO_PING_REGEXP}
+    ${bcast_egress} =    Utils.Run Command On Remote System And Log    ${OS_COMPUTE_IP}    ${DUMP_FLOW} | grep table=${EGRESS_ACL_TABLE} | grep ${BCAST_IP} ${additional_args}
+    ${get_pkt_count_after_bcast} =    OvsManager.Get Packet Count In Table For IP    ${OS_COMPUTE_IP}    ${EGRESS_ACL_TABLE}    ${BCAST_IP}    additional_args=| grep ${vm_submeta}
     ${pkt_diff} =    Evaluate    int(${get_pkt_count_after_bcast})-int(${get_pkt_count_before_bcast})
-    ${pkt_diff_expected} =    BuiltIn.Set Variable If    "${OPENSTACK_TOPO}" == "1cmb-0ctl-0cmp"    ${PACKET_DIFF_CMB}    ${PACKET_DIFF}
-    ${pkt_count} =    BuiltIn.Set Variable If    "${OPENSTACK_TOPO}" == "1cmb-0ctl-0cmp"    ${PACKET_COUNT_CMB}    ${PACKET_COUNT}
-    BuiltIn.Run Keyword If    '${subnet_var}' == 'same'    Should Be Equal As Numbers    ${pkt_diff}    ${pkt_count}
-    ...    ELSE    Should Be True    ${pkt_diff} == ${pkt_diff_expected}
+    BuiltIn.Run Keyword If    '${subnet_var}' == 'same'    Should Be Equal As Numbers    ${pkt_diff}    ${PACKET_COUNT}
+    ...    ELSE    Should Be True    ${pkt_diff}==0