correct check_for_null for l2gw delete 17/84317/11
authorSrinivas Rachakonda <srinivas.rachakonda@gmail.com>
Wed, 11 Sep 2019 19:10:18 +0000 (00:40 +0530)
committerVenkatrangan Govindarajan <vgovindarajan@luminanetworks.com>
Fri, 20 Sep 2019 09:27:45 +0000 (09:27 +0000)
Signed-off-by: Srinivas Rachakonda <srinivas.rachakonda@gmail.com>
Change-Id: Ide43dd6095f7c2a8939a4cf39970b34002a232c4
Signed-off-by: Srinivas Rachakonda <srinivas.rachakonda@gmail.com>
csit/libraries/L2GatewayOperations.robot
csit/suites/l2gw/01_Configure_verify_l2gateway.robot

index ed9bcc2c61a3a772ae118a41f6ff96ebb87105c0..2c0a86d0d06b53aff3d88abe7e8e97902844782e 100644 (file)
@@ -87,12 +87,15 @@ Update And Verify L2Gateway
     [Return]    ${l2gw_output}
 
 Delete L2Gateway
-    [Arguments]    ${gw_name}
+    [Arguments]    ${gw_name}    ${check_for_null}=False
     [Documentation]    Keyword to delete the L2 Gateway ${gw_name} received in argument.
+    ...    If ${check_for_null} is True return of 404 is treated as empty list. From Neon onwards,
+    ...    an empty list is always returned as null, giving 404 on rest call.
     ${output}=    Exec Command    ${OS_CNTL_CONN_ID}    ${L2GW_DELETE} ${gw_name}
     Log    ${output}
     @{list_to_check}=    Create List    ${gw_name}
     BuiltIn.Wait Until Keyword Succeeds    5s    1s    Utils.Check For Elements Not At URI    ${L2GW_LIST_REST_URL}    ${list_to_check}    session
+    ...    check_for_null=${check_for_null}
 
 Create Verify L2Gateway Connection
     [Arguments]    ${gw_name}    ${net_name}
@@ -118,13 +121,16 @@ Verify L2Gateway Connection
     Utils.Check For Elements At URI    ${L2GW_CONN_LIST_REST_URL}    ${list_to_check}    session
 
 Delete L2Gateway Connection
-    [Arguments]    ${gw_name}
+    [Arguments]    ${gw_name}    ${check_for_null}=False
     [Documentation]    Delete the L2 Gateway connection existing for Gateway ${gw_name} received in argument (Using Neutron CLI).
+    ...    If ${check_for_null} is True return of 404 is treated as empty list. From Neon onwards, an empty list is always
+    ...    returned as null, giving 404 on rest call.
     ${l2gw_conn_id}=    OpenStackOperations.Get L2gw Connection Id    ${gw_name}
     ${output}=    Exec Command    ${OS_CNTL_CONN_ID}    ${L2GW_CONN_DELETE} ${l2gw_conn_id}
     Log    ${output}
     @{list_to_check}=    Create List    ${l2gw_conn_id}
     BuiltIn.Wait Until Keyword Succeeds    5s    1s    Utils.Check For Elements Not At URI    ${L2GW_CONN_LIST_REST_URL}    ${list_to_check}    session
+    ...    check_for_null=${check_for_null}
 
 Update Port For Hwvtep
     [Arguments]    ${port_name}
index 07ef46e56e210c30623b359640ae47f221f97d01..91398b3258ca4919a20f08fb945fc83afc1b5e1f 100644 (file)
@@ -189,9 +189,9 @@ TC19 Ping Verification From Namespace Tap To Ovs Vm
 
 TC99 Cleanup L2Gateway Connection Itm Tunnel Port Subnet And Network
     L2GatewayOperations.Delete L2Gateway Connection    ${L2GW_NAME1}
-    L2GatewayOperations.Delete L2Gateway Connection    ${L2GW_NAME2}
+    L2GatewayOperations.Delete L2Gateway Connection    ${L2GW_NAME2}    check_for_null=True
     L2GatewayOperations.Delete L2Gateway    ${L2GW_NAME1}
-    L2GatewayOperations.Delete L2Gateway    ${L2GW_NAME2}
+    L2GatewayOperations.Delete L2Gateway    ${L2GW_NAME2}    check_for_null=True
     OpenStackOperations.Delete Vm Instance    ${OVS_VM1_NAME}
     OpenStackOperations.Delete Vm Instance    ${OVS_VM2_NAME}
     OpenStackOperations.Delete Port    ${OVS_PORT_1}