4f25346e69fc235ed5ab628a1bc188c7c963bdb4
[integration/test.git] / csit / suites / topoprocessing / basic-topology-operations / 040_Filtration_links.robot
1 *** Settings ***
2 Documentation     Test suite to verify fitration operation on different models.
3 ...               Before test starts, configurational file have to be rewriten to change listners registration datastore type from CONFIGURATION to OPERATIONAL.
4 ...               Need for this change is also a reason why main feature (odl-topoprocessing-framework) is installed after file change and not during boot.
5 ...               Tests themselves install feature required for specific model, clear karaf logs for futher synchronization, send configurational xmls and verify output.
6 ...               Topology-id on the end of each urls must match topology-id from xml. Yang models of components in topology are defined in xmls.
7 Suite Setup       Setup Environment
8 Suite Teardown    Clean Environment
9 Test Teardown     Delete Overlay Topology    ${OVERLAY_TOPO_URL}
10 Library           RequestsLibrary
11 Library           SSHLibrary
12 Library           XML
13 Variables         ../../../variables/topoprocessing/TopologyRequests.py
14 Variables         ../../../variables/topoprocessing/TargetFields.py
15 Variables         ../../../variables/Variables.py
16 Resource          ../../../libraries/KarafKeywords.robot
17 Resource          ../../../libraries/Utils.robot
18 Resource          ../../../libraries/TopoprocessingKeywords.robot
19
20 *** Variables ***
21 ${OVERLAY_TOPO_URL}    ${TOPOLOGY_URL}/topo:1
22
23 *** Test Cases ***
24 Filtration Range Number Network Topology Model
25     [Documentation]    Test of range number type of filtration operation on Network Topology model
26     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    link    network-topo:1
27     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ${IGP_LINK_METRIC}
28     ${request}    Set Range Number Filter    ${request}    11    13
29     ${resp}    Send Basic Request And Test If Contain X Times    ${request}    ${OVERLAY_TOPO_URL}    <link-id>link:    3
30     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
31     Check Filtered Links In Topology    ${resp.content}    link:1:2-1    link:1:3    link:1:4
32
33 Filtration Range Number Inventory Model
34     [Documentation]    Test of range number type of filtration operation on Inventory model
35     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    link    openflow-topo:3
36     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ${IGP_LINK_METRIC}
37     ${request}    Set Range Number Filter    ${request}    14    15
38     ${resp}    Send Basic Request And Test If Contain X Times    ${request}    ${OVERLAY_TOPO_URL}    <link-id>link:    2
39     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
40     Check Filtered Links In Topology    ${resp.content}    link:14:12    link:15:13
41
42 Filtration Specific String Network Topology Model
43     [Documentation]    Test of specific string type of filtration operation on Network Topology model
44     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    link    network-topo:1
45     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_STRING}    ${IGP_LINK_NAME}
46     ${request}    Set Specific String Filter    ${request}    linkA
47     ${resp}    Send Basic Request And Test If Contain X Times    ${request}    ${OVERLAY_TOPO_URL}    <link-id>link:    2
48     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
49     Check Filtered Links In Topology    ${resp.content}    link:1:4    link:1:2-1
50
51 Filtration Specific String Inventory Model
52     [Documentation]    Test of specific string type of filtration operation on Inventory model
53     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    link    openflow-topo:3
54     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_STRING}    ${IGP_LINK_NAME}
55     ${request}    Set Specific String Filter    ${request}    linkD
56     ${resp}    Send Basic Request And Test If Contain X Times    ${request}    ${OVERLAY_TOPO_URL}    <link-id>link:    1
57     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
58     Check Filtered Links In Topology    ${resp.content}    link:15:13
59
60 Filtration Range String Network Topology Model
61     [Documentation]    Test of range string type of filtration operation on Network Topology model
62     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    link    network-topo:1
63     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_STRING}    ${IGP_LINK_NAME}
64     ${request}    Set Range String Filter    ${request}    linkA    linkB
65     ${resp}    Send Basic Request And Test If Contain X Times    ${request}    ${OVERLAY_TOPO_URL}    <link-id>link:    3
66     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
67     Check Filtered Links In Topology    ${resp.content}    link:1:2-1    link:1:3    link:1:4
68
69 Filtration Range String Inventory Model
70     [Documentation]    Test of range string type of filtration operation on Inventory model
71     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    link    openflow-topo:3
72     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_STRING}    ${IGP_LINK_NAME}
73     ${request}    Set Range String Filter    ${request}    linkC    linkD
74     ${resp}    Send Basic Request And Test If Contain X Times    ${request}    ${OVERLAY_TOPO_URL}    <link-id>link:    2
75     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
76     Check Filtered Links In Topology    ${resp.content}    link:14:12    link:15:13
77
78 Filtration Script Network Topology Model
79     [Documentation]    Test of script type of filtration operation on Network Topology model
80     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    link    network-topo:1
81     ${request}    Insert Filter    ${request}    ${FILTER_SCRIPT}    ${IGP_LINK_NAME}
82     ${script}    Set Variable    if (node.getValue().indexOf("linkA") > -1 ) {filterOut.setResult(true);} else {filterOut.setResult(false);}
83     ${request}    Set Script Filter    ${request}    javascript    ${script}
84     ${resp}    Send Basic Request And Test If Contain X Times    ${request}    ${OVERLAY_TOPO_URL}    <link-id>link:    2
85     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
86     Check Filtered Links In Topology    ${resp.content}    link:1:2-2    link:1:3
87
88 Filtration Script Inventory Model
89     [Documentation]    Test of script type of filtration operation on Inventory model
90     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    link    openflow-topo:3
91     ${request}    Insert Filter    ${request}    ${FILTER_SCRIPT}    ${IGP_LINK_NAME}
92     ${script}    Set Variable    if (node.getValue().indexOf("linkA") > -1 ) {filterOut.setResult(true);} else {filterOut.setResult(false);}
93     ${request}    Set Script Filter    ${request}    javascript    ${script}
94     ${resp}    Send Basic Request And Test If Contain X Times    ${request}    ${OVERLAY_TOPO_URL}    <link-id>link:    3
95     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
96     Check Filtered Links In Topology    ${resp.content}    link:11:12    link:14:12    link:15:13