correct check_for_null for l2gw delete
[integration/test.git] / csit / libraries / L2GatewayOperations.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}