Modifications for OF_Tunnels to support Aluminium release 21/93821/3
authorSrinivas Rachakonda <srinivas.rachakonda@gmail.com>
Fri, 13 Nov 2020 09:17:23 +0000 (14:47 +0530)
committerJamo Luhrsen <jluhrsen@gmail.com>
Mon, 30 Nov 2020 16:36:07 +0000 (16:36 +0000)
Signed-off-by: Srinivas Rachakonda <srinivas.rachakonda@gmail.com>
Change-Id: Ieab937d11e1e0d489b4078097a20c4a4702874aa

csit/suites/genius/OF_Tunnels.robot

index b98479f5f65ee1e494770843ad400bf7d8025212..fe02b8cf2fa37ddb0842859050035b8cad7b2015 100644 (file)
@@ -24,7 +24,6 @@ Resource          ../../variables/netvirt/Variables.robot
 *** Variables ***
 ${FLOWS_FILTER_TABLE0}    | grep table=0
 ${FLOWS_FILTER_TABLE95}    | grep table=95
 *** Variables ***
 ${FLOWS_FILTER_TABLE0}    | grep table=0
 ${FLOWS_FILTER_TABLE95}    | grep table=95
-${TEP_SHOW_OF_PORTS}    tep:show-ofports
 
 *** Test Cases ***
 Create and Verify OFT TEPs
 
 *** Test Cases ***
 Create and Verify OFT TEPs
@@ -76,8 +75,10 @@ OFT Verify Vteps Created
     BuiltIn.Wait Until Keyword Succeeds    60    5    Genius.Get ITM    ${DEFAULT_TRANSPORT_ZONE}    ${switch_data}
     ${tep_show_output} =    BuiltIn.Wait Until Keyword Succeeds    60    5    KarafKeywords.Issue Command On Karaf Console    ${TEP_SHOW}
     BuiltIn.Should Contain Any    ${tep_show_output}    ${DEFAULT_TRANSPORT_ZONE}    VXLAN    @{switch_data}
     BuiltIn.Wait Until Keyword Succeeds    60    5    Genius.Get ITM    ${DEFAULT_TRANSPORT_ZONE}    ${switch_data}
     ${tep_show_output} =    BuiltIn.Wait Until Keyword Succeeds    60    5    KarafKeywords.Issue Command On Karaf Console    ${TEP_SHOW}
     BuiltIn.Should Contain Any    ${tep_show_output}    ${DEFAULT_TRANSPORT_ZONE}    VXLAN    @{switch_data}
+    BuiltIn.Wait Until Keyword Succeeds    60    5    Genius.Update Dpn id List And Get Tunnels    odl-interface:tunnel-type-vxlan    dpn-teps-state    ${dpn_id_list}
+    BuiltIn.Wait Until Keyword Succeeds    60    5    Genius.Verify Response Code Of Dpn End Point Config API    ${dpn_id_list}
     ${num_switches} =    BuiltIn.Get Length    ${dpn_id_list}
     ${num_switches} =    BuiltIn.Get Length    ${dpn_id_list}
-    BuiltIn.Wait Until Keyword Succeeds    60    5    OFT Verify Tunnel Status as UP    ${num_switches}
+    BuiltIn.Wait Until Keyword Succeeds    60    5    Genius.Verify Tunnel Status As Up    ${num_switches}
     BuiltIn.Wait Until Keyword Succeeds    40    10    OFT OVS Verify Tunnels Created    @{tools_ip_list}
     ${tools_system_len} =    BuiltIn.Get Length    ${tools_ip_list}
     FOR    ${tools_system_index}    IN RANGE    ${tools_system_len}
     BuiltIn.Wait Until Keyword Succeeds    40    10    OFT OVS Verify Tunnels Created    @{tools_ip_list}
     ${tools_system_len} =    BuiltIn.Get Length    ${tools_ip_list}
     FOR    ${tools_system_index}    IN RANGE    ${tools_system_len}
@@ -85,7 +86,12 @@ OFT Verify Vteps Created
         Collections.Remove From List    ${tun_ip_list}    ${tools_system_index}
         ${ports_output} =    Utils.Run Command On Remote System And Log    ${tools_ip_list}[${tools_system_index}]    sudo ovs-ofctl -Oopenflow13 dump-ports-desc ${Bridge}
         ${port_numbers} =    String.Get Regexp Matches    ${ports_output}    (\\d+).of.*    ${1}
         Collections.Remove From List    ${tun_ip_list}    ${tools_system_index}
         ${ports_output} =    Utils.Run Command On Remote System And Log    ${tools_ip_list}[${tools_system_index}]    sudo ovs-ofctl -Oopenflow13 dump-ports-desc ${Bridge}
         ${port_numbers} =    String.Get Regexp Matches    ${ports_output}    (\\d+).of.*    ${1}
-        BuiltIn.Wait Until Keyword Succeeds    40    10    OFT OVS Verify Ingress Flows Created per Switch    ${tools_ip_list}[${tools_system_index}]    ${tun_ip_list}    ${port_numbers}
+        BuiltIn.Wait Until Keyword Succeeds    40    10    OFT OVS Verify Ingress Flows Created per Switch    ${tools_ip_list}[${tools_system_index}]    ${tun_ip_list}
+        ...    ${port_numbers}
+        BuiltIn.Wait Until Keyword Succeeds    40    10    OFT OVS Verify Egress Flows Created per Switch    ${tools_ip_list}[${tools_system_index}]    ${tun_ip_list}
+        ...    ${port_numbers}
+        BuiltIn.Wait Until Keyword Succeeds    40    10    OFT OVS Verify Ingress Flows Created per Switch    ${tools_ip_list}[${tools_system_index}]    ${tun_ip_list}
+        ...    ${port_numbers}
     END
 
 OFT OVS Verify Tunnels Created
     END
 
 OFT OVS Verify Tunnels Created
@@ -101,6 +107,9 @@ OFT OVS Verify Ingress Flows Created per Switch
     [Documentation]    Verify if Ingress flow rules are created in OVS for a given switch.
     ${flows_table0_output} =    Utils.Run Command On Remote System And Log    ${tools_ip}    sudo ovs-ofctl -OOpenFlow13 dump-flows ${Bridge} ${FLOWS_FILTER_TABLE0}
     BuiltIn.Should Not Contain    ${flows_table0_output}    tun_src=${tools_ip},
     [Documentation]    Verify if Ingress flow rules are created in OVS for a given switch.
     ${flows_table0_output} =    Utils.Run Command On Remote System And Log    ${tools_ip}    sudo ovs-ofctl -OOpenFlow13 dump-flows ${Bridge} ${FLOWS_FILTER_TABLE0}
     BuiltIn.Should Not Contain    ${flows_table0_output}    tun_src=${tools_ip},
+    FOR    ${tun_src}    IN    @{tun_src_list}
+        BuiltIn.Should Contain    ${flows_table0_output}    tun_src=${tun_src},
+    END
     FOR    ${port_number}    IN    @{port_numbers}
         BuiltIn.Should Contain    ${flows_table0_output}    in_port=${port_number}
     END
     FOR    ${port_number}    IN    @{port_numbers}
         BuiltIn.Should Contain    ${flows_table0_output}    in_port=${port_number}
     END
@@ -129,7 +138,7 @@ OFT Verify Vteps Deleted
     [Documentation]    Verify if OFT Vteps are created successfully or not for given Tools IPs and DPN-IDs.
     ${deleted_tep_len} =    BuiltIn.Get Length    ${dpn_id_list}
     ${existing_tep_len} =    BuiltIn.Evaluate    ${NUM_TOOLS_SYSTEM}-${deleted_tep_len}
     [Documentation]    Verify if OFT Vteps are created successfully or not for given Tools IPs and DPN-IDs.
     ${deleted_tep_len} =    BuiltIn.Get Length    ${dpn_id_list}
     ${existing_tep_len} =    BuiltIn.Evaluate    ${NUM_TOOLS_SYSTEM}-${deleted_tep_len}
-    BuiltIn.Run Keyword If    ${existing_tep_len} > 0    BuiltIn.Wait Until Keyword Succeeds    60    5    OFT Verify Tunnel status as UP    ${existing_tep_len}
+    BuiltIn.Run Keyword If    ${existing_tep_len} > 0    BuiltIn.Wait Until Keyword Succeeds    60    5    Genius.Verify Tunnel Status As Up    ${existing_tep_len}
     ${tep_show_output} =    KarafKeywords.Issue Command On Karaf Console    ${TEP_SHOW}
     ${tep_show_state_output} =    KarafKeywords.Issue Command On Karaf Console    ${TEP_SHOW_STATE}
     FOR    ${tools_system_index}    IN RANGE    ${deleted_tep_len}
     ${tep_show_output} =    KarafKeywords.Issue Command On Karaf Console    ${TEP_SHOW}
     ${tep_show_state_output} =    KarafKeywords.Issue Command On Karaf Console    ${TEP_SHOW_STATE}
     FOR    ${tools_system_index}    IN RANGE    ${deleted_tep_len}
@@ -141,7 +150,8 @@ OFT Verify Vteps Deleted
         ${dst_dpn_id_list} =    BuiltIn.Create List    @{DPN_ID_LIST}
         Collections.Remove From List    ${dst_dpn_id_list}    ${tools_system_index}
         BuiltIn.Wait Until Keyword Succeeds    60    5    OFT Verify Vteps Deleted at Dpn Teps State per Interface    ${dpn_id_list}[${tools_system_index}]    ${dst_dpn_id_list}
         ${dst_dpn_id_list} =    BuiltIn.Create List    @{DPN_ID_LIST}
         Collections.Remove From List    ${dst_dpn_id_list}    ${tools_system_index}
         BuiltIn.Wait Until Keyword Succeeds    60    5    OFT Verify Vteps Deleted at Dpn Teps State per Interface    ${dpn_id_list}[${tools_system_index}]    ${dst_dpn_id_list}
-        ${ovs_vsctl_output} =    BuiltIn.Wait Until Keyword Succeeds    40    10    Utils.Run Command On Remote System And Log    ${tools_ip_list}[${tools_system_index}]    sudo ovs-vsctl show
+        ${ovs_vsctl_output} =    BuiltIn.Wait Until Keyword Succeeds    40    10    Utils.Run Command On Remote System And Log    ${tools_ip_list}[${tools_system_index}]
+        ...    sudo ovs-vsctl show
         BuiltIn.Should Not Contain    ${ovs_vsctl_output}    remote_ip=flow
         BuiltIn.Wait Until Keyword Succeeds    40    10    OFT OVS Verify Ingress Flows Deleted per Switch    ${tools_ip_list}[${tools_system_index}]
         BuiltIn.Wait Until Keyword Succeeds    40    10    OFT OVS Verify Egress Flows Deleted per Switch    ${tools_ip_list}[${tools_system_index}]
         BuiltIn.Should Not Contain    ${ovs_vsctl_output}    remote_ip=flow
         BuiltIn.Wait Until Keyword Succeeds    40    10    OFT OVS Verify Ingress Flows Deleted per Switch    ${tools_ip_list}[${tools_system_index}]
         BuiltIn.Wait Until Keyword Succeeds    40    10    OFT OVS Verify Egress Flows Deleted per Switch    ${tools_ip_list}[${tools_system_index}]
@@ -151,7 +161,8 @@ OFT Verify Vteps Deleted at Dpn Teps State per Interface
     [Arguments]    ${src_dpn_id}    ${dst_dpn_id_list}
     [Documentation]    Verify if vteps are deleted for all src-dst intf pair at dpn-teps-state in ODL for a given src intf.
     FOR    ${dst_dpn_id}    IN    @{dst_dpn_id_list}
     [Arguments]    ${src_dpn_id}    ${dst_dpn_id_list}
     [Documentation]    Verify if vteps are deleted for all src-dst intf pair at dpn-teps-state in ODL for a given src intf.
     FOR    ${dst_dpn_id}    IN    @{dst_dpn_id_list}
-        ${status} =    BuiltIn.Run Keyword And Return Status    Genius.Get Tunnel    ${src_dpn_id}    ${dst_dpn_id}    odl-interface:tunnel-type-vxlan    dpn-teps-state
+        ${status} =    BuiltIn.Run Keyword And Return Status    Genius.Get Tunnel    ${src_dpn_id}    ${dst_dpn_id}    odl-interface:tunnel-type-vxlan
+        ...    dpn-teps-state
         BuiltIn.Should Be True    ${status} == ${False}
     END
 
         BuiltIn.Should Be True    ${status} == ${False}
     END
 
@@ -173,7 +184,7 @@ OF Tunnels Start Suite
     ClusterManagement.Stop_Members_From_List_Or_All
     FOR    ${controller_index}    IN RANGE    ${NUM_ODL_SYSTEM}
         Run Command On Remote System And Log    ${ODL_SYSTEM_${controller_index+1}_IP}    sed -i -- 's/<itm-direct-tunnels>false/<itm-direct-tunnels>true/g' ${GENIUS_IFM_CONFIG_FLAG}
     ClusterManagement.Stop_Members_From_List_Or_All
     FOR    ${controller_index}    IN RANGE    ${NUM_ODL_SYSTEM}
         Run Command On Remote System And Log    ${ODL_SYSTEM_${controller_index+1}_IP}    sed -i -- 's/<itm-direct-tunnels>false/<itm-direct-tunnels>true/g' ${GENIUS_IFM_CONFIG_FLAG}
-        Run Command On Remote System And Log    ${ODL_SYSTEM_${controller_index+1}_IP}    sed -i -- 's/<itm-of-tunnels>false/<itm-of-tunnels>true/g' ${GENIUS_IFM_CONFIG_FLAG}
+        Run Command On Remote System And Log    ${ODL_SYSTEM_${controller_index+1}_IP}    sed -i -- 's/<use-of-tunnels>false/<use-of-tunnels>true/g' ${GENIUS_ITM_CONFIG_FLAG}
     END
     ClusterManagement.Start_Members_From_List_Or_All
     Genius Suite Setup
     END
     ClusterManagement.Start_Members_From_List_Or_All
     Genius Suite Setup
@@ -187,10 +198,3 @@ OF Tunnels Stop Suite
     ClusterManagement.Stop_Members_From_List_Or_All
     ClusterManagement.Start_Members_From_List_Or_All
     Genius Suite Teardown
     ClusterManagement.Stop_Members_From_List_Or_All
     ClusterManagement.Start_Members_From_List_Or_All
     Genius Suite Teardown
-
-OFT Verify Tunnel status as UP
-    [Arguments]    ${no_of_switches}=${NUM_TOOLS_SYSTEM}
-    ${no_of_tunnels} =    KarafKeywords.Issue Command On Karaf Console    ${TEP_SHOW_OF_PORTS}
-    ${lines_of_state_up} =    String.Get Lines Containing String    ${no_of_tunnels}    Up
-    ${actual_tunnel_count} =    String.Get Line Count    ${lines_of_state_up}
-    BuiltIn.Should Be Equal As Strings    ${actual_tunnel_count}    ${no_of_switches}