Upgrade RF syntax for v3.2 compatibility
[integration/test.git] / csit / suites / openflowplugin / Flows_Additional_TCs / Stat_Manager_extended / 020_SM_sal_add_upd_del_flows.robot
index be6b1dc5b4ef2ac0dbc709102314353e9e46e412..fc18e172221b2e1e9bb96e6ca81005caf7972348 100644 (file)
@@ -3,40 +3,43 @@ Documentation     Test suite for Stats Manager flows collection
 Suite Setup       Initialization Phase
 Suite Teardown    Delete All Sessions
 Test Template     Check Datastore Presence
-Library           OperatingSystem
 Library           Collections
-Library           XML
-Library           SSHLibrary
-Resource          ../../../../libraries/FlowLib.robot
-Library           ../../../../libraries/XmlComparator.py
-Variables         ../../../../variables/Variables.py
+Library           OperatingSystem
 Library           RequestsLibrary
-Library           ../../../../libraries/Common.py
+Library           SSHLibrary
+Library           XML
+Library           ${CURDIR}/../../../../libraries/Common.py
+Library           ${CURDIR}/../../../../libraries/XmlComparator.py
+Resource          ${CURDIR}/../../../../libraries/CompareStream.robot
+Resource          ${CURDIR}/../../../../libraries/FlowLib.robot
+Resource          ${CURDIR}/../../../../variables/Variables.robot
 
 *** Variables ***
+${flow_update_time}    3s
 ${XmlsDir}        ${CURDIR}/../../../../variables/xmls
 ${switch_idx}     1
 ${switch_name}    s${switch_idx}
 @{flowlist0}      f1.xml    f2.xml    f3.xml    f4.xml    f5.xml    f6.xml    f7.xml
-...               f8.xml    f9.xml    f10.xml    f11.xml    f12.xml    f13.xml    f14.xml
-...               f15.xml    f16.xml    f17.xml    f18.xml    f19.xml    f20.xml    f21.xml
-...               f22.xml    f23.xml    f24.xml    f25.xml    f31.xml    f36.xml    f38.xml
-...               f43.xml    f45.xml    f47.xml    f101.xml    f102.xml    f103.xml    f104.xml
-...               f105.xml    f106.xml    f107.xml    f108.xml    f109.xml    f110.xml    f113.xml
-...               f201.xml    f202.xml    f203.xml    f204.xml    f205.xml    f206.xml    f209.xml
-...               f214.xml    f218.xml    f219.xml    f220.xml
+...               f8.xml    f9.xml    f10.xml    f11.xml    f14.xml    f15.xml    f16.xml
+...               f17.xml    f18.xml    f19.xml    f20.xml    f21.xml    f22.xml    f23.xml
+...               f24.xml    f25.xml    f31.xml    f36.xml    f38.xml    f43.xml    f45.xml
+...               f101.xml    f102.xml    f103.xml    f104.xml    f105.xml    f106.xml    f107.xml
+...               f108.xml    f109.xml    f110.xml    f113.xml    f201.xml    f202.xml    f203.xml
+...               f204.xml    f205.xml    f206.xml    f209.xml    f214.xml    f218.xml    f219.xml
+...               f220.xml
 
 *** Test Cases ***
 Test Add Flows Group 0
     [Documentation]    Add all flows and waits for SM to collect data
     [Template]    NONE
-    : FOR    ${flowfile}    IN    @{flowlist0}
-    \    Log    ${flowfile}
-    \    Create Flow Variables For Suite From XML File    ${XmlsDir}/${flowfile}
-    \    Run Keyword And Continue On Failure    Add Flow Via RPC    ${switch_idx}    ${xmlroot}
-    # Lets wait for ofp to collect stats
+    FOR    ${flowfile}    IN    @{flowlist0}
+        Log    ${flowfile}
+        Create Flow Variables For Suite From XML File    ${XmlsDir}/${flowfile}
+        Run Keyword And Continue On Failure    Add Flow Via RPC    ${switch_idx}    ${xmlroot}
+        # Lets wait for ofp to collect stats
+    END
     ${flows}=    Get Length    ${flowlist0}
-    Wait Until Keyword Succeeds    10s    2s    FlowLib.Check Flow Stats Are Available    openflow:1    ${flows}
+    Wait Until Keyword Succeeds    30s    2s    FlowLib.Check Flow Stats Are Available    openflow:1    ${flows}
     # Show switch content (for debug purposes if needed)
     Write    dpctl dump-flows -O OpenFlow13
     Read Until    mininet>
@@ -74,15 +77,6 @@ Test Is Flow 10 Added
 Test Is Flow 11 Added
     f11.xml    ${False}    ${True}    ${False}
 
-Test Is Flow 12 Added
-    f12.xml    ${False}    ${True}    ${False}
-
-Test Is Flow 13 Added
-    f13.xml    ${False}    ${True}    ${False}
-
-Test Is Flow 14 Added
-    f14.xml    ${False}    ${True}    ${False}
-
 Test Is Flow 15 Added
     f15.xml    ${False}    ${True}    ${False}
 
@@ -131,9 +125,6 @@ Test Is Flow 43 Added
 Test Is Flow 45 Added
     f45.xml    ${False}    ${True}    ${False}
 
-Test Is Flow 47 Added
-    f47.xml    ${False}    ${True}    ${False}
-
 Test Is Flow 101 Added
     f101.xml    ${False}    ${True}    ${False}
 
@@ -203,12 +194,13 @@ Test Is Flow 220 Added
 Test Update Flows Group 0
     [Documentation]    Update all flows and waits for SM to collect data
     [Template]    NONE
-    : FOR    ${flowfile}    IN    @{flowlist0}
-    \    Log    ${flowfile}
-    \    Create Flow Variables For Suite From XML File    ${XmlsDir}/${flowfile}
-    \    Run Keyword And Continue On Failure    Update Flow Via RPC    ${switch_idx}    ${data}    ${upddata}
-    # Lets wait for ofp to collect stats
-    Sleep    3s
+    FOR    ${flowfile}    IN    @{flowlist0}
+        Log    ${flowfile}
+        Create Flow Variables For Suite From XML File    ${XmlsDir}/${flowfile}
+        Run Keyword And Continue On Failure    Update Flow Via RPC    ${switch_idx}    ${data}    ${upddata}
+        # Lets wait for ofp to collect stats
+    END
+    Sleep    ${flow_update_time}
     # Show switch content (for debug purposes if needed)
     Write    dpctl dump-flows -O OpenFlow13
     Read Until    mininet>
@@ -246,12 +238,6 @@ Test Is Flow 10 Updated
 Test Is Flow 11 Updated
     f11.xml    ${False}    ${True}    ${True}
 
-Test Is Flow 12 Updated
-    f12.xml    ${False}    ${True}    ${True}
-
-Test Is Flow 13 Updated
-    f13.xml    ${False}    ${True}    ${True}
-
 Test Is Flow 14 Updated
     f14.xml    ${False}    ${True}    ${True}
 
@@ -303,9 +289,6 @@ Test Is Flow 43 Updated
 Test Is Flow 45 Updated
     f45.xml    ${False}    ${True}    ${True}
 
-Test Is Flow 47 Updated
-    f47.xml    ${False}    ${True}    ${True}
-
 Test Is Flow 101 Updated
     f101.xml    ${False}    ${True}    ${True}
 
@@ -375,12 +358,13 @@ Test Is Flow 220 Updated
 Test Delete Flows Group 0
     [Documentation]    Delete all flows and waits for SM to collect data
     [Template]    NONE
-    : FOR    ${flowfile}    IN    @{flowlist0}
-    \    Log    ${flowfile}
-    \    Create Flow Variables For Suite From XML File    ${XmlsDir}/${flowfile}
-    \    Run Keyword And Continue On Failure    Delete Flow Via RPC    ${switch_idx}    ${xmlroot}
-    # Lets wait for ofp to collect stats
-    Sleep    3s
+    FOR    ${flowfile}    IN    @{flowlist0}
+        Log    ${flowfile}
+        Create Flow Variables For Suite From XML File    ${XmlsDir}/${flowfile}
+        Run Keyword And Continue On Failure    Delete Flow Via RPC    ${switch_idx}    ${xmlroot}
+        # Lets wait for ofp to collect stats
+    END
+    Sleep    ${flow_update_time}
     # Show switch content (for debug purposes if needed)
     Write    dpctl dump-flows -O OpenFlow13
     Read Until    mininet>
@@ -418,12 +402,6 @@ Test Is Flow 10 Deleted
 Test Is Flow 11 Deleted
     f11.xml    ${False}    ${False}    ${True}
 
-Test Is Flow 12 Deleted
-    f12.xml    ${False}    ${False}    ${True}
-
-Test Is Flow 13 Deleted
-    f13.xml    ${False}    ${False}    ${True}
-
 Test Is Flow 14 Deleted
     f14.xml    ${False}    ${False}    ${True}
 
@@ -475,9 +453,6 @@ Test Is Flow 43 Deleted
 Test Is Flow 45 Deleted
     f45.xml    ${False}    ${False}    ${True}
 
-Test Is Flow 47 Deleted
-    f47.xml    ${False}    ${False}    ${True}
-
 Test Is Flow 101 Deleted
     f101.xml    ${False}    ${False}    ${True}
 
@@ -548,5 +523,6 @@ Test Is Flow 220 Deleted
 Initialization Phase
     [Documentation]    Initiate tcp connection with controller
     Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+    BuiltIn.Wait Until Keyword Succeeds    10x    1s    FlowLib.Check Switches In Inventory    ${1}
     Write    dpctl dump-flows -O OpenFlow13
     Read Until    mininet>