Topoprocessing - bugfix for bug5156
[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     Filtration Links Test Teardown
10 Library           RequestsLibrary
11 Library           SSHLibrary
12 Library           XML
13 Variables         ../../../variables/topoprocessing/TopologyRequests.py
14 Variables         ../../../variables/Variables.py
15 Resource          ../../../libraries/KarafKeywords.robot
16 Resource          ../../../libraries/Utils.robot
17 Resource          ../../../libraries/TopoprocessingKeywords.robot
18
19 *** Test Cases ***
20 Filtration Range Number Network Topology Model
21     [Documentation]    Test of range number type of filtration operation on Network Topology model
22     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    link    network-topo:1
23     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:metric
24     ${request}    Set Range Number Filter    ${request}    11    13
25     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
26     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
27     Should Contain X Times    ${resp.content}    <link-id>link:    3
28     Should Contain X Times    ${resp.content}    <link-ref>link:1:4</link-ref>    1
29     Should Contain X Times    ${resp.content}    <link-ref>link:1:3</link-ref>    1
30     Should Contain X Times    ${resp.content}    <link-ref>link:1:2-1</link-ref>    1
31
32 Filtration Range Number Inventory Model
33     [Documentation]    Test of range number type of filtration operation on Inventory model
34     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    link    openflow-topo:3
35     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:metric
36     ${request}    Set Range Number Filter    ${request}    14    15
37     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
38     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
39     Should Contain X Times    ${resp.content}    <link-id>link:    2
40     Should Contain X Times    ${resp.content}    <link-ref>link:14:12</link-ref>    1
41     Should Contain X Times    ${resp.content}    <link-ref>link:15:13</link-ref>    1
42
43 Filtration Specific Number Network Topology Model
44     [Documentation]    Test of specific number type of filtration operation on Network Topology model
45     Pass Execution    Test is being passed due to incorrect target field. Test will be included in execution when corrected.
46     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    link    network-topo:1
47     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_NUMBER}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:metric
48     ${request}    Set Specific Number Filter    ${request}    12
49     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
50     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
51     Should Contain X Times    ${resp.content}    <link-id>link:    2
52     Should Contain X Times    ${resp.content}    <link-ref>link:1:4</link-ref>    1
53     Should Contain X Times    ${resp.content}    <link-ref>link:1:2-1</link-ref>    1
54
55 Filtration Specific Number Inventory Model
56     [Documentation]    Test of specific number type of filtration operation on Inventory model
57     Pass Execution    Test is being passed due to incorrect target field. Test will be included in execution when corrected.
58     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    link    openflow-topo:3
59     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_NUMBER}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:metric
60     ${request}    Set Specific Number Filter    ${request}    16
61     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
62     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
63     Should Contain X Times    ${resp.content}    <link-id>link:    1
64     Should Contain X Times    ${resp.content}    <link-ref>link:11:12</link-ref>    1
65     [Teardown]    Run Keywords    Filtration Links Test Teardown
66
67 Filtration Specific String Network Topology Model
68     [Documentation]    Test of specific string type of filtration operation on Network Topology model
69     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    link    network-topo:1
70     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_STRING}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:name
71     ${request}    Set Specific String Filter    ${request}    linkA
72     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
73     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
74     Should Contain X Times    ${resp.content}    <link-id>link:    2
75     Should Contain X Times    ${resp.content}    <link-ref>link:1:4</link-ref>    1
76     Should Contain X Times    ${resp.content}    <link-ref>link:1:2-1</link-ref>    1
77
78 Filtration Specific String Inventory Model
79     [Documentation]    Test of specific string type of filtration operation on Inventory model
80     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    link    openflow-topo:3
81     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_STRING}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:name
82     ${request}    Set Specific String Filter    ${request}    linkD
83     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
84     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
85     Should Contain X Times    ${resp.content}    <link-id>link:    1
86     Should Contain X Times    ${resp.content}    <link-ref>link:15:13</link-ref>    1
87
88 Filtration Range String Network Topology Model
89     [Documentation]    Test of range string type of filtration operation on Network Topology model
90     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    link    network-topo:1
91     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_STRING}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:name
92     ${request}    Set Range String Filter    ${request}    linkA    linkB
93     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
94     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
95     Should Contain X Times    ${resp.content}    <link-id>link:    3
96     Should Contain X Times    ${resp.content}    <link-ref>link:1:4</link-ref>    1
97     Should Contain X Times    ${resp.content}    <link-ref>link:1:3</link-ref>    1
98     Should Contain X Times    ${resp.content}    <link-ref>link:1:2-1</link-ref>    1
99
100 Filtration Range String Inventory Model
101     [Documentation]    Test of range string type of filtration operation on Inventory model
102     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    link    openflow-topo:3
103     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_STRING}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:name
104     ${request}    Set Range String Filter    ${request}    linkC    linkD
105     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
106     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
107     Should Contain X Times    ${resp.content}    <link-id>link:    2
108     Should Contain X Times    ${resp.content}    <link-ref>link:14:12</link-ref>    1
109     Should Contain X Times    ${resp.content}    <link-ref>link:15:13</link-ref>    1
110
111 Filtration Script Network Topology Model
112     [Documentation]    Test of script type of filtration operation on Network Topology model
113     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    link    network-topo:1
114     ${request}    Insert Filter    ${request}    ${FILTER_SCRIPT}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:name
115     ${script}    Set Variable    if (node.getValue().indexOf("linkA") > -1 ) {filterOut.setResult(true);} else {filterOut.setResult(false);}
116     ${request}    Set Script Filter    ${request}    javascript    ${script}
117     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
118     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
119     Should Contain X Times    ${resp.content}    <link-id>link:    2
120     Should Contain X Times    ${resp.content}    <link-ref>link:1:3</link-ref>    1
121     Should Contain X Times    ${resp.content}    <link-ref>link:1:2-2</link-ref>    1
122
123 Filtration Script Inventory Model
124     [Documentation]    Test of script type of filtration operation on Inventory model
125     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    link    openflow-topo:3
126     ${request}    Insert Filter    ${request}    ${FILTER_SCRIPT}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:name
127     ${script}    Set Variable    if (node.getValue().indexOf("linkA") > -1 ) {filterOut.setResult(true);} else {filterOut.setResult(false);}
128     ${request}    Set Script Filter    ${request}    javascript    ${script}
129     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
130     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
131     Should Contain X Times    ${resp.content}    <link-id>link:    3
132     Should Contain X Times    ${resp.content}    <link-ref>link:11:12</link-ref>    1
133     Should Contain X Times    ${resp.content}    <link-ref>link:14:12</link-ref>    1
134     Should Contain X Times    ${resp.content}    <link-ref>link:15:13</link-ref>    1
135
136 *** Keywords ***
137 Filtration Links Test Teardown
138     Test Teardown    network-topology:network-topology/topology/topo:1
139     Report_Failure_Due_To_Bug    5188