add setuputils to topoprocessing csit so karaf log KWs work
[integration/test.git] / csit / suites / topoprocessing / basic-topology-operations / 040_Filtration_links.robot
index cb88d327da4b9b05a00c5a12261bff65a5eaf2a2..acf1f995bea76baebbecfb9874e47422d25e5afe 100644 (file)
@@ -6,11 +6,13 @@ 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     Filtration Links Test Teardown
+Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Test Teardown     Delete Overlay Topology
 Library           RequestsLibrary
 Library           SSHLibrary
 Library           XML
 Variables         ../../../variables/topoprocessing/TopologyRequests.py
+Variables         ../../../variables/topoprocessing/TargetFields.py
 Variables         ../../../variables/Variables.py
 Resource          ../../../libraries/KarafKeywords.robot
 Resource          ../../../libraries/Utils.robot
@@ -20,132 +22,73 @@ Resource          ../../../libraries/TopoprocessingKeywords.robot
 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}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:metric
+    ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ${IGP_LINK_METRIC}
     ${request}    Set Range Number Filter    ${request}    11    13
-    ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
-    Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
-    Should Contain X Times    ${resp.content}    <link-id>link:    3
-    Should Contain X Times    ${resp.content}    <link-ref>link:1:4</link-ref>    1
-    Should Contain X Times    ${resp.content}    <link-ref>link:1:3</link-ref>    1
-    Should Contain X Times    ${resp.content}    <link-ref>link:1:2-1</link-ref>    1
+    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
     [Documentation]    Test of range number type of filtration operation on Inventory model
     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    link    openflow-topo:3
-    ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:metric
+    ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ${IGP_LINK_METRIC}
     ${request}    Set Range Number Filter    ${request}    14    15
-    ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
-    Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
-    Should Contain X Times    ${resp.content}    <link-id>link:    2
-    Should Contain X Times    ${resp.content}    <link-ref>link:14:12</link-ref>    1
-    Should Contain X Times    ${resp.content}    <link-ref>link:15:13</link-ref>    1
-    [Teardown]    Run Keywords    Filtration Links Test Teardown
-    ...    AND    Report_Failure_Due_To_Bug    4761
-
-Filtration Specific Number Network Topology Model
-    [Documentation]    Test of specific number type of filtration operation on Network Topology model
-    Pass Execution    Test is being passed due to incorrect target field. Test will be included in execution when corrected.
-    ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    link    network-topo:1
-    ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_NUMBER}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:metric
-    ${request}    Set Specific Number Filter    ${request}    12
-    ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
-    Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
-    Should Contain X Times    ${resp.content}    <link-id>link:    2
-    Should Contain X Times    ${resp.content}    <link-ref>link:1:4</link-ref>    1
-    Should Contain X Times    ${resp.content}    <link-ref>link:1:2-1</link-ref>    1
-    [Teardown]    Run Keywords    Filtration Links Test Teardown
-    ...    AND    Report_Failure_Due_To_Bug    4721
-
-Filtration Specific Number Inventory Model
-    [Documentation]    Test of specific number type of filtration operation on Inventory model
-    Pass Execution    Test is being passed due to incorrect target field. Test will be included in execution when corrected.
-    ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    link    openflow-topo:3
-    ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_NUMBER}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:metric
-    ${request}    Set Specific Number Filter    ${request}    16
-    ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
-    Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
-    Should Contain X Times    ${resp.content}    <link-id>link:    1
-    Should Contain X Times    ${resp.content}    <link-ref>link:11:12</link-ref>    1
-    [Teardown]    Run Keywords    Filtration Links Test Teardown
-    ...    AND    Report_Failure_Due_To_Bug    4761
-    ...    AND    Report_Failure_Due_To_Bug    4721
+    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
     [Documentation]    Test of specific string 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_SPECIFIC_STRING}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:name
+    ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_STRING}    ${IGP_LINK_NAME}
     ${request}    Set Specific String Filter    ${request}    linkA
-    ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
-    Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
-    Should Contain X Times    ${resp.content}    <link-id>link:    2
-    Should Contain X Times    ${resp.content}    <link-ref>link:1:4</link-ref>    1
-    Should Contain X Times    ${resp.content}    <link-ref>link:1:2-1</link-ref>    1
+    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
     [Documentation]    Test of specific string type of filtration operation on Inventory model
     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    link    openflow-topo:3
-    ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_STRING}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:name
+    ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_STRING}    ${IGP_LINK_NAME}
     ${request}    Set Specific String Filter    ${request}    linkD
-    ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
-    Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
-    Should Contain X Times    ${resp.content}    <link-id>link:    1
-    Should Contain X Times    ${resp.content}    <link-ref>link:15:13</link-ref>    1
-    [Teardown]    Run Keywords    Filtration Links Test Teardown
-    ...    AND    Report_Failure_Due_To_Bug    4761
+    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
     [Documentation]    Test of range string 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_STRING}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:name
+    ${request}    Insert Filter    ${request}    ${FILTER_RANGE_STRING}    ${IGP_LINK_NAME}
     ${request}    Set Range String Filter    ${request}    linkA    linkB
-    ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
-    Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
-    Should Contain X Times    ${resp.content}    <link-id>link:    3
-    Should Contain X Times    ${resp.content}    <link-ref>link:1:4</link-ref>    1
-    Should Contain X Times    ${resp.content}    <link-ref>link:1:3</link-ref>    1
-    Should Contain X Times    ${resp.content}    <link-ref>link:1:2-1</link-ref>    1
+    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
     [Documentation]    Test of range string type of filtration operation on Inventory model
     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    link    openflow-topo:3
-    ${request}    Insert Filter    ${request}    ${FILTER_RANGE_STRING}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:name
+    ${request}    Insert Filter    ${request}    ${FILTER_RANGE_STRING}    ${IGP_LINK_NAME}
     ${request}    Set Range String Filter    ${request}    linkC    linkD
-    ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
-    Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
-    Should Contain X Times    ${resp.content}    <link-id>link:    2
-    Should Contain X Times    ${resp.content}    <link-ref>link:14:12</link-ref>    1
-    Should Contain X Times    ${resp.content}    <link-ref>link:15:13</link-ref>    1
-    [Teardown]    Run Keywords    Filtration Links Test Teardown
-    ...    AND    Report_Failure_Due_To_Bug    4761
+    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
     [Documentation]    Test of script 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_SCRIPT}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:name
+    ${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    ${request}    network-topology:network-topology/topology/topo:1
-    Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
-    Should Contain X Times    ${resp.content}    <link-id>link:    2
-    Should Contain X Times    ${resp.content}    <link-ref>link:1:3</link-ref>    1
-    Should Contain X Times    ${resp.content}    <link-ref>link:1:2-2</link-ref>    1
+    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
     [Documentation]    Test of script type of filtration operation on Inventory model
     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    link    openflow-topo:3
-    ${request}    Insert Filter    ${request}    ${FILTER_SCRIPT}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:name
+    ${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    ${request}    network-topology:network-topology/topology/topo:1
-    Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
-    Should Contain X Times    ${resp.content}    <link-id>link:    3
-    Should Contain X Times    ${resp.content}    <link-ref>link:11:12</link-ref>    1
-    Should Contain X Times    ${resp.content}    <link-ref>link:14:12</link-ref>    1
-    Should Contain X Times    ${resp.content}    <link-ref>link:15:13</link-ref>    1
-    [Teardown]    Run Keywords    Filtration Links Test Teardown
-    ...    AND    Report_Failure_Due_To_Bug    4761
-
-*** Keywords ***
-Filtration Links Test Teardown
-    Test Teardown    network-topology:network-topology/topology/topo:1
-    Report_Failure_Due_To_Bug    4673
+    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