Topoprocessing - Rework the output requesting mechanism
[integration/test.git] / csit / suites / topoprocessing / basic-topology-operations / 040_Filtration_links.robot
index 4f25346e69fc235ed5ab628a1bc188c7c963bdb4..e1edf636ffab756e6cbbf455d591260c11cc250f 100644 (file)
@@ -6,7 +6,7 @@ Documentation     Test suite to verify fitration operation on different models.
 ...               Topology-id on the end of each urls must match topology-id from xml. Yang models of components in topology are defined in xmls.
 Suite Setup       Setup Environment
 Suite Teardown    Clean Environment
-Test Teardown     Delete Overlay Topology    ${OVERLAY_TOPO_URL}
+Test Teardown     Delete Overlay Topology
 Library           RequestsLibrary
 Library           SSHLibrary
 Library           XML
@@ -17,17 +17,14 @@ Resource          ../../../libraries/KarafKeywords.robot
 Resource          ../../../libraries/Utils.robot
 Resource          ../../../libraries/TopoprocessingKeywords.robot
 
-*** Variables ***
-${OVERLAY_TOPO_URL}    ${TOPOLOGY_URL}/topo:1
-
 *** Test Cases ***
 Filtration Range Number Network Topology Model
     [Documentation]    Test of range number type of filtration operation on Network Topology model
     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    link    network-topo:1
     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ${IGP_LINK_METRIC}
     ${request}    Set Range Number Filter    ${request}    11    13
-    ${resp}    Send Basic Request And Test If Contain X Times    ${request}    ${OVERLAY_TOPO_URL}    <link-id>link:    3
-    Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
+    Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
+    ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    link_count=3    link-ref_count=3
     Check Filtered Links In Topology    ${resp.content}    link:1:2-1    link:1:3    link:1:4
 
 Filtration Range Number Inventory Model
@@ -35,8 +32,8 @@ Filtration Range Number Inventory Model
     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    link    openflow-topo:3
     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ${IGP_LINK_METRIC}
     ${request}    Set Range Number Filter    ${request}    14    15
-    ${resp}    Send Basic Request And Test If Contain X Times    ${request}    ${OVERLAY_TOPO_URL}    <link-id>link:    2
-    Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
+    Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
+    ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    link_count=2    link-ref_count=2
     Check Filtered Links In Topology    ${resp.content}    link:14:12    link:15:13
 
 Filtration Specific String Network Topology Model
@@ -44,8 +41,8 @@ Filtration Specific String Network Topology Model
     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    link    network-topo:1
     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_STRING}    ${IGP_LINK_NAME}
     ${request}    Set Specific String Filter    ${request}    linkA
-    ${resp}    Send Basic Request And Test If Contain X Times    ${request}    ${OVERLAY_TOPO_URL}    <link-id>link:    2
-    Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
+    Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
+    ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    link_count=2    link-ref_count=2
     Check Filtered Links In Topology    ${resp.content}    link:1:4    link:1:2-1
 
 Filtration Specific String Inventory Model
@@ -53,8 +50,8 @@ Filtration Specific String Inventory Model
     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    link    openflow-topo:3
     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_STRING}    ${IGP_LINK_NAME}
     ${request}    Set Specific String Filter    ${request}    linkD
-    ${resp}    Send Basic Request And Test If Contain X Times    ${request}    ${OVERLAY_TOPO_URL}    <link-id>link:    1
-    Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
+    Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
+    ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    link_count=1    link-ref_count=1
     Check Filtered Links In Topology    ${resp.content}    link:15:13
 
 Filtration Range String Network Topology Model
@@ -62,8 +59,8 @@ Filtration Range String Network Topology Model
     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    link    network-topo:1
     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_STRING}    ${IGP_LINK_NAME}
     ${request}    Set Range String Filter    ${request}    linkA    linkB
-    ${resp}    Send Basic Request And Test If Contain X Times    ${request}    ${OVERLAY_TOPO_URL}    <link-id>link:    3
-    Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
+    Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
+    ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    link_count=3    link-ref_count=3
     Check Filtered Links In Topology    ${resp.content}    link:1:2-1    link:1:3    link:1:4
 
 Filtration Range String Inventory Model
@@ -71,8 +68,8 @@ Filtration Range String Inventory Model
     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    link    openflow-topo:3
     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_STRING}    ${IGP_LINK_NAME}
     ${request}    Set Range String Filter    ${request}    linkC    linkD
-    ${resp}    Send Basic Request And Test If Contain X Times    ${request}    ${OVERLAY_TOPO_URL}    <link-id>link:    2
-    Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
+    Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
+    ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    link_count=2    link-ref_count=2
     Check Filtered Links In Topology    ${resp.content}    link:14:12    link:15:13
 
 Filtration Script Network Topology Model
@@ -81,8 +78,8 @@ Filtration Script Network Topology Model
     ${request}    Insert Filter    ${request}    ${FILTER_SCRIPT}    ${IGP_LINK_NAME}
     ${script}    Set Variable    if (node.getValue().indexOf("linkA") > -1 ) {filterOut.setResult(true);} else {filterOut.setResult(false);}
     ${request}    Set Script Filter    ${request}    javascript    ${script}
-    ${resp}    Send Basic Request And Test If Contain X Times    ${request}    ${OVERLAY_TOPO_URL}    <link-id>link:    2
-    Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
+    Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
+    ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    link_count=2    link-ref_count=2
     Check Filtered Links In Topology    ${resp.content}    link:1:2-2    link:1:3
 
 Filtration Script Inventory Model
@@ -91,6 +88,6 @@ Filtration Script Inventory Model
     ${request}    Insert Filter    ${request}    ${FILTER_SCRIPT}    ${IGP_LINK_NAME}
     ${script}    Set Variable    if (node.getValue().indexOf("linkA") > -1 ) {filterOut.setResult(true);} else {filterOut.setResult(false);}
     ${request}    Set Script Filter    ${request}    javascript    ${script}
-    ${resp}    Send Basic Request And Test If Contain X Times    ${request}    ${OVERLAY_TOPO_URL}    <link-id>link:    3
-    Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
+    Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
+    ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    link_count=3    link-ref_count=3
     Check Filtered Links In Topology    ${resp.content}    link:11:12    link:14:12    link:15:13