Moving vpn-instance yang from VPNMgr > NeutronVPN
[integration/test.git] / csit / suites / vpnservice / 030__configure_2_switches.robot
index 4cc9540495f4472ada59d5aacc4c4a645538c72a..5890cef8eb827562ef1b9e8c834c11a77ff1f027 100644 (file)
@@ -1,8 +1,8 @@
 *** Settings ***
 Documentation     Test Suite for vpn instance
-Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Setup       Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
 Suite Teardown    Delete All Sessions
-Variables         ../../variables/vpnservice/configureSwitches.py    ${MININET}    ${MININET1}
+Variables         ../../variables/vpnservice/configureSwitches.py    ${TOOLS_SYSTEM_IP}    ${TOOLS_SYSTEM_2_IP}
 Library           SSHLibrary
 Variables         ../../variables/Variables.py
 Resource          ../../libraries/Utils.robot
@@ -27,20 +27,23 @@ Veirfy The Switches
 Create VPN Instances
     [Documentation]    Creates VPN Instances through restconf
     [Tags]    Post
-    ${resp}    RequestsLibrary.Post    session    ${REST_CON}/l3vpn:vpn-instances/    data=${vpn_instances}
+    CompareStream.Run_Keyword_If_Less_Than_Magnesium    ${resp}    RequestsLibrary.Post Request    session    ${REST_CON}/l3vpn:vpn-instances/    data=${vpn_instances}
+    CompareStream.Run_Keyword_If_At_Least_Magnesium    ${resp}    RequestsLibrary.Post Request    session    ${REST_CON}/l3vpn-instances-interfaces:vpn-instances/    data=${vpn_instances}
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    204
 
 Verify VPN instances
     [Documentation]    Verifies the vpn instances in the datastores
     [Tags]    Get
-    Wait Until Keyword Succeeds    5s    1s    Check For Elements At URI    ${REST_CON}/l3vpn:vpn-instances/    ${vpn_inst_values}
-    Wait Until Keyword Succeeds    5s    1s    Check For Elements At URI    ${REST_OPER}/l3vpn:vpn-instances/    ${vpn_inst_values}
+    CompareStream.Run_Keyword_If_Less_Than_Magnesium    Wait Until Keyword Succeeds    5s    1s    Check For Elements At URI    ${REST_CON}/l3vpn:vpn-instances/    ${vpn_inst_values}
+    CompareStream.Run_Keyword_If_Less_Than_Magnesium    Wait Until Keyword Succeeds    5s    1s    Check For Elements At URI    ${REST_OPER}/l3vpn:vpn-instances/    ${vpn_inst_values}
+    CompareStream.Run_Keyword_If_At_Least_Magnesium    Wait Until Keyword Succeeds    5s    1s    Check For Elements At URI    ${REST_CON}/l3vpn-instances-interfaces:vpn-instances/    ${vpn_inst_values}
+    CompareStream.Run_Keyword_If_At_Least_Magnesium    Wait Until Keyword Succeeds    5s    1s    Check For Elements At URI    ${REST_OPER}/l3vpn-instances-interfaces:vpn-instances/    ${vpn_inst_values}
 
 Create ietf interfaces
     [Documentation]    Creates ietf interfaces through the restconf
     [Tags]    Post
-    ${resp}    RequestsLibrary.Post    session    ${REST_CON}/ietf-interfaces:interfaces/    data=${ietf_interfaces}
+    ${resp}    RequestsLibrary.Post Request    session    ${REST_CON}/ietf-interfaces:interfaces/    data=${ietf_interfaces}
     Should Be Equal As Strings    ${resp.status_code}    204
 
 Verify ietf interfaces
@@ -54,14 +57,17 @@ Verify ietf interfaces
 Create VPN interfaces
     [Documentation]    Creates vpn interface for the corresponding ietf interface
     [Tags]    Post
-    ${resp}    RequestsLibrary.Post    session    ${REST_CON}/l3vpn:vpn-interfaces/    data=${vpn_interfaces}
+    CompareStream.Run_Keyword_If_Less_Than_Magnesium    ${resp}    RequestsLibrary.Post Request    session    ${REST_CON}/l3vpn:vpn-interfaces/    data=${vpn_instances}
+    CompareStream.Run_Keyword_If_At_Least_Magnesium    ${resp}    RequestsLibrary.Post Request    session    ${REST_CON}/l3vpn-instances-interfaces:vpn-interfaces/    data=${vpn_instances}
     Should Be Equal As Strings    ${resp.status_code}    204
 
 Verify VPN interfaces
     [Documentation]    Verifies the vpn interfaces created in datastores
     [Tags]    Get
-    Wait Until Keyword Succeeds    3s    1s    Check For Elements At URI    ${REST_CON}/l3vpn:vpn-interfaces/    ${vpn_int_values}
-    Wait Until Keyword Succeeds    3s    1s    Check For Elements At URI    ${REST_OPER}/l3vpn:vpn-interfaces/    ${vpn_int_values}
+    CompareStream.Run_Keyword_If_Less_Than_Magnesium    Wait Until Keyword Succeeds    3s    1s    Check For Elements At URI    ${REST_CON}/l3vpn:vpn-interfaces/    ${vpn_int_values}
+    CompareStream.Run_Keyword_If_Less_Than_Magnesium    Wait Until Keyword Succeeds    3s    1s    Check For Elements At URI    ${REST_OPER}/l3vpn:vpn-interfaces/    ${vpn_int_values}
+    CompareStream.Run_Keyword_If_At_Least_Magnesium    Wait Until Keyword Succeeds    3s    1s    Check For Elements At URI    ${REST_CON}/l3vpn-instances-interfaces:vpn-interfaces/    ${vpn_int_values}
+    CompareStream.Run_Keyword_If_At_Least_Magnesium    Wait Until Keyword Succeeds    3s    1s    Check For Elements At URI    ${REST_OPER}/l3vpn-instances-interfaces:vpn-interfaces/    ${vpn_int_values}
 
 Verify FIB entries after create
     [Documentation]    Verifies the fib entries in the operational DS for the corresponding vpn interfaces
@@ -98,37 +104,41 @@ Verify ping
 Delete vpn interfaces
     [Documentation]    Deletes the vpn interfaces
     [Tags]    Delete
-    ${resp}    RequestsLibrary.Delete    session    ${REST_CON}/l3vpn:vpn-interfaces/
+    CompareStream.Run_Keyword_If_Less_Than_Magnesium    ${resp}    RequestsLibrary.Delete Request    session    ${REST_CON}/l3vpn:vpn-interfaces/
+    CompareStream.Run_Keyword_If_At_Least_Magnesium    ${resp}    RequestsLibrary.Delete Request    session    ${REST_CON}/l3vpn-instances-interfaces:vpn-interfaces/
     Should Be Equal As Strings    ${resp.status_code}    200
 
 Verify after deleting vpn interfaces
     [Documentation]    Verifies if vpn interfaces are deleted
     [Tags]    Verify after delete
-    ${resp}    RequestsLibrary.get    session    ${REST_CON}/l3vpn:vpn-interfaces/    headers=${ACCEPT_XML}
+    CompareStream.Run_Keyword_If_Less_Than_Magnesium    ${resp}    RequestsLibrary.get Request    session    ${REST_CON}/l3vpn:vpn-interfaces/    headers=${ACCEPT_XML}
+    CompareStream.Run_Keyword_If_At_Least_Magnesium    ${resp}    RequestsLibrary.get Request    session    ${REST_CON}/l3vpn-instances-interfaces:vpn-interfaces/    headers=${ACCEPT_XML}
     Should Be Equal As Strings    ${resp.status_code}    404
 
 Delete ietf interfaces
     [Documentation]    Deletes the ietf interfaces
     [Tags]    Delete
-    ${resp}    RequestsLibrary.Delete    session    ${REST_CON}/ietf-interfaces:interfaces/
+    ${resp}    RequestsLibrary.Delete Request    session    ${REST_CON}/ietf-interfaces:interfaces/
     Should Be Equal As Strings    ${resp.status_code}    200
 
 Verify after deleting ietf interfaces
     [Documentation]    Verifies if ietf interfaces are deleted
     [Tags]    Verify after delete
-    ${resp}    RequestsLibrary.get    session    ${REST_CON}/ietf-interfaces:interfaces/    headers=${ACCEPT_XML}
+    ${resp}    RequestsLibrary.get Request    session    ${REST_CON}/ietf-interfaces:interfaces/    headers=${ACCEPT_XML}
     Should Be Equal As Strings    ${resp.status_code}    404
 
 Delete VPN Instances
     [Documentation]    Deletes the VPN Instances
     [Tags]    Delete
-    ${resp}    RequestsLibrary.Delete    session    ${REST_CON}/l3vpn:vpn-instances/
+    CompareStream.Run_Keyword_If_Less_Than_Magnesium    ${resp}    RequestsLibrary.Delete Request    session    ${REST_CON}/l3vpn:vpn-instances/
+    CompareStream.Run_Keyword_If_At_Least_Magnesium    ${resp}    RequestsLibrary.Delete Request    session    ${REST_CON}/l3vpn-instances-interfaces:vpn-instances/
     Should Be Equal As Strings    ${resp.status_code}    200
 
 Verify after deleting the vpn instances
     [Documentation]    Verifies after deleting the vpn instances
     [Tags]    Verfiy after delete
-    ${resp}    RequestsLibrary.get    session    ${REST_CON}/l3vpn:vpn-instances/    headers=${ACCEPT_XML}
+    CompareStream.Run_Keyword_If_Less_Than_Magnesium    ${resp}    RequestsLibrary.get Request    session    ${REST_CON}/l3vpn:vpn-instances/    headers=${ACCEPT_XML}
+    CompareStream.Run_Keyword_If_At_Least_Magnesium    ${resp}    RequestsLibrary.get Request    session    ${REST_CON}/l3vpn-instances-interfaces:vpn-instances/    headers=${ACCEPT_XML}
     Should Be Equal As Strings    ${resp.status_code}    404
 
 Verify FIB entries after delete
@@ -140,7 +150,7 @@ Verify FIB entries after delete
 Verify flows after delete
     [Documentation]    Verify if the flows are deleted from the switch
     [Tags]    verify in switch
-    [Template]
+    [Template]    ${EMPTY}
     Wait Until Keyword Succeeds    12s    2s    Ensure Flows Are Removed    ${mininet1_conn_id_1}
     Wait Until Keyword Succeeds    12s    2s    Ensure Flows Are Removed    ${mininet2_conn_id_1}
 
@@ -156,8 +166,9 @@ Ensure Flows Are Present
     Should Contain X Times    ${output}    goto_table:21    2
     Should Contain X Times    ${output}    table=20    2
     Should Contain X Times    ${output}    table=21    4
-    : FOR    ${i}    IN    @{flow_elements}
-    \    Should Contain    ${output}    ${i}
+    FOR    ${i}    IN    @{flow_elements}
+        Should Contain    ${output}    ${i}
+    END
 
 Ensure Groups Are Present
     [Arguments]    ${conn_id}    ${group_elements}    ${gre_port_id}
@@ -167,8 +178,9 @@ Ensure Groups Are Present
     ${output}=    Read Until    mininet>
     Log    ${output}
     Should Contain X Times    ${output}    actions=output:${gre_port_id}    1
-    : FOR    ${i}    IN    @{group_elements}
-    \    Should Contain    ${output}    actions=pop_mpls:0x0800,set_field:${i}
+    FOR    ${i}    IN    @{group_elements}
+        Should Contain    ${output}    actions=pop_mpls:0x0800,set_field:${i}
+    END
 
 Ensure Flows Are Removed
     [Arguments]    ${conn_id}