7e97aa66b622d3ddf1be9fe39a58b7c86442fbd8
[integration/test.git] / csit / suites / topoprocessing / basic-topology-operations / 020_Filtration_nodes.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 Nodes 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 IPV4 Network Topology Model
21     [Documentation]    Test of ipv4 type of filtration operation on Network Topology model
22     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    node    network-topo:1
23     ${request}    Insert Filter    ${request}    ${FILTER_IPV4}    l3-unicast-igp-topology:igp-node-attributes/isis-topology:isis-node-attributes/isis-topology:ted/isis-topology:te-router-id-ipv4
24     ${request}    Set IPV4 Filter    ${request}    192.168.1.1/24
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}    <node-id>node:    2
28     Should Contain X Times    ${resp.content}    <node-ref>bgp:1</node-ref>    1
29     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:1']/..
30     ${node}    Element to String    ${node}
31     Should Contain X Times    ${node}    <termination-point>    3
32     Should Contain    ${node}    <tp-id>tp:1:1</tp-id>
33     Should Contain    ${node}    <tp-id>tp:1:2</tp-id>
34     Should Contain    ${node}    <tp-id>tp:1:3</tp-id>
35     Should Contain X Times    ${resp.content}    <node-ref>bgp:2</node-ref>    1
36
37 Filtration IPV4 Inventory Model
38     [Documentation]    Test of ipv4 type of filtration operation on Inventory model
39     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    node    openflow-topo:1
40     ${request}    Insert Filter    ${request}    ${FILTER_IPV4}    flow-node-inventory:ip-address
41     ${request}    Set IPV4 Filter    ${request}    192.168.1.1/24
42     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
43     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
44     Should Contain X Times    ${resp.content}    <node-id>node:    3
45     : FOR    ${index}    IN RANGE    1    3
46     \    Should Contain X Times    ${resp.content}    <node-ref>of-node:${index}</node-ref>    1
47     [Teardown]    Run Keywords    Filtration Nodes Test Teardown
48     ...    AND    Report_Failure_Due_To_Bug    4683
49
50 Filtration Range Number Network Topology Model
51     [Documentation]    Test of range number type of filtration operation on Network Topology model
52     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    node    network-topo:2
53     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ovsdb:ovs-version
54     ${request}    Set Range Number Filter    ${request}    20    25
55     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
56     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
57     Should Contain X Times    ${resp.content}    <node-id>node:    4
58     : FOR    ${index}    IN RANGE    7    10
59     \    Should Contain X Times    ${resp.content}    <node-ref>bgp:${index}</node-ref>    1
60     Should Contain X Times    ${resp.content}    <termination-point>    5
61     Should Contain    ${resp.content}    <tp-id>tp:7:1</tp-id>
62     Should Contain    ${resp.content}    <tp-id>tp:7:2</tp-id>
63     Should Contain    ${resp.content}    <tp-id>tp:8:1</tp-id>
64     Should Contain    ${resp.content}    <tp-id>tp:9:1</tp-id>
65     Should Contain    ${resp.content}    <tp-id>tp:10:1</tp-id>
66
67 Filtration Range Number Inventory Model
68     [Documentation]    Test of range number type of filtration operation on Inventory model
69     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    node    openflow-topo:2
70     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    flow-node-inventory:serial-number
71     ${request}    Set Range Number Filter    ${request}    20    25
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}    <node-id>node:    3
75     : FOR    ${index}    IN RANGE    8    10
76     \    Should Contain X Times    ${resp.content}    <node-ref>of-node:${index}</node-ref>    1
77     [Teardown]    Run Keywords    Filtration Nodes Test Teardown
78     ...    AND    Report_Failure_Due_To_Bug    4683
79
80 Filtration Specific Number Network Topology Model
81     [Documentation]    Test of specific number type of filtration operation on Network Topology model
82     Pass Execution    Test is being passed due to incorrect target field. Test will be included in execution when corrected.
83     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    node    network-topo:2
84     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_NUMBER}    ovsdb:ovs-version
85     ${request}    Set Specific Number Filter    ${request}    25
86     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
87     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
88     Should Contain X Times    ${resp.content}    <node-id>node:    2
89     Should Contain X Times    ${resp.content}    <node-ref>bgp:9</node-ref>    1
90     Should Contain X Times    ${resp.content}    <node-ref>bgp:10</node-ref>    1
91     Should Contain X Times    ${resp.content}    <termination-point>    2
92     Should Contain    ${resp.content}    <tp-id>tp:9:1</tp-id>
93     Should Contain    ${resp.content}    <tp-id>tp:10:1</tp-id>
94     [Teardown]    Run Keywords    Filtration Nodes Test Teardown
95     ...    AND    Report_Failure_Due_To_Bug    4721
96
97 Filtration Specific Number Inventory Model
98     [Documentation]    Test of specific number type of filtration operation on Inventory model
99     Pass Execution    Test is being passed due to incorrect target field. Test will be included in execution when corrected.
100     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    node    openflow-topo:2
101     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_NUMBER}    flow-node-inventory:serial-number
102     ${request}    Set Specific Number Filter    ${request}    21
103     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
104     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
105     Should Contain X Times    ${resp.content}    <node-id>node:    2
106     Should Contain X Times    ${resp.content}    <node-ref>of-node:8</node-ref>    1
107     Should Contain X Times    ${resp.content}    <node-ref>of-node:9</node-ref>    1
108     [Teardown]    Run Keywords    Filtration Nodes Test Teardown
109     ...    AND    Report_Failure_Due_To_Bug    4683
110     ...    AND    Report_Failure_Due_To_Bug    4721
111
112 Filtration Specific String Network Topology Model
113     [Documentation]    Test of specific string type of filtration operation on Network Topology model
114     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    node    network-topo:2
115     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_STRING}    ovsdb:ovs-version
116     ${request}    Set Specific String Filter    ${request}    25
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}    <node-id>node:    2
120     Should Contain X Times    ${resp.content}    <node-ref>bgp:9</node-ref>    1
121     Should Contain X Times    ${resp.content}    <node-ref>bgp:10</node-ref>    1
122     Should Contain X Times    ${resp.content}    <termination-point>    2
123     Should Contain    ${resp.content}    <tp-id>tp:9:1</tp-id>
124     Should Contain    ${resp.content}    <tp-id>tp:10:1</tp-id>
125
126 Filtration Specific String Inventory Model
127     [Documentation]    Test of specific string type of filtration operation on Inventory model
128     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    node    openflow-topo:2
129     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_STRING}    flow-node-inventory:serial-number
130     ${request}    Set Specific String Filter    ${request}    21
131     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
132     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
133     Should Contain X Times    ${resp.content}    <node-id>node:    2
134     Should Contain X Times    ${resp.content}    <node-ref>of-node:8</node-ref>    1
135     Should Contain X Times    ${resp.content}    <node-ref>of-node:9</node-ref>    1
136     [Teardown]    Run Keywords    Filtration Nodes Test Teardown
137     ...    AND    Report_Failure_Due_To_Bug    4683
138
139 Filtration Range String Network Topology Model
140     [Documentation]    Test of range string type of filtration operation on Network Topology model
141     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    node    network-topo:2
142     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_STRING}    ovsdb:ovs-version
143     ${request}    Set Range String Filter    ${request}    20    25
144     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
145     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
146     Should Contain X Times    ${resp.content}    <node-id>node:    4
147     : FOR    ${index}    IN RANGE    7    10
148     \    Should Contain X Times    ${resp.content}    <node-ref>bgp:${index}</node-ref>    1
149     Should Contain X Times    ${resp.content}    <termination-point>    5
150     Should Contain    ${resp.content}    <tp-id>tp:7:1</tp-id>
151     Should Contain    ${resp.content}    <tp-id>tp:7:2</tp-id>
152     Should Contain    ${resp.content}    <tp-id>tp:8:1</tp-id>
153     Should Contain    ${resp.content}    <tp-id>tp:9:1</tp-id>
154     Should Contain    ${resp.content}    <tp-id>tp:10:1</tp-id>
155
156 Filtration Range String Inventory Model
157     [Documentation]    Test of range string type of filtration operation on Inventory model
158     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    node    openflow-topo:2
159     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_STRING}    flow-node-inventory:serial-number
160     ${request}    Set Range String Filter    ${request}    20    25
161     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
162     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
163     Should Contain X Times    ${resp.content}    <node-id>node:    3
164     : FOR    ${index}    IN RANGE    8    10
165     \    Should Contain X Times    ${resp.content}    <node-ref>of-node:${index}</node-ref>    1
166     [Teardown]    Run Keywords    Filtration Nodes Test Teardown
167     ...    AND    Report_Failure_Due_To_Bug    4683
168
169 Filtration IPV6 Network Topology Model
170     [Documentation]    Test of ipv6 type of filtration operation on Network Topology model
171     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    node    network-topo:3
172     ${request}    Insert Filter    ${request}    ${FILTER_IPV6}    l3-unicast-igp-topology:igp-node-attributes/isis-topology:isis-node-attributes/isis-topology:ted/isis-topology:te-router-id-ipv6
173     ${request}    Set IPV6 Filter    ${request}    fe80:0:0:0:0:0:c0a8:101/120
174     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
175     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
176     Should Contain X Times    ${resp.content}    <node-id>node:    2
177     Should Contain X Times    ${resp.content}    <node-ref>bgp:11</node-ref>    1
178     Should Contain X Times    ${resp.content}    <node-ref>bgp:12</node-ref>    1
179     Should Contain X Times    ${resp.content}    <termination-point>    1
180     Should Contain    ${resp.content}    <tp-id>tp:11:1</tp-id>
181
182 Filtration IPV6 Inventory Model
183     [Documentation]    Test of ipv6 type of filtration operation on Inventory model
184     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    node    openflow-topo:3
185     ${request}    Insert Filter    ${request}    ${FILTER_IPV6}    flow-node-inventory:ip-address
186     ${request}    Set IPV6 Filter    ${request}    fe80:0:0:0:0:0:c0a8:201/120
187     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
188     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
189     Should Contain X Times    ${resp.content}    <node-id>node:    3
190     Should Contain X Times    ${resp.content}    <node-ref>of-node:12</node-ref>    1
191     Should Contain X Times    ${resp.content}    <node-ref>of-node:14</node-ref>    1
192     Should Contain X Times    ${resp.content}    <node-ref>of-node:15</node-ref>    1
193     [Teardown]    Run Keywords    Filtration Nodes Test Teardown
194     ...    AND    Report_Failure_Due_To_Bug    4683
195
196 Filtration Script Network Topology Model
197     [Documentation]    Test of script type of filtration operation on Network Topology model
198     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    node    network-topo:1
199     ${request}    Insert Filter    ${request}    ${FILTER_SCRIPT}    l3-unicast-igp-topology:igp-node-attributes/isis-topology:isis-node-attributes/isis-topology:ted/isis-topology:te-router-id-ipv4
200     ${script}    Set Variable    if (node.getValue().indexOf("192.168.1") > -1 ) {filterOut.setResult(true);} else {filterOut.setResult(false);}
201     ${request}    Set Script Filter    ${request}    javascript    ${script}
202     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
203     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
204     Should Contain X Times    ${resp.content}    <node-id>node:    3
205     : FOR    ${index}    IN RANGE    3    5
206     \    Should Contain X Times    ${resp.content}    <node-ref>bgp:${index}</node-ref>    1
207     Should Contain X Times    ${resp.content}    <termination-point>    5
208     Should Contain    ${resp.content}    <tp-id>tp:3:1</tp-id>
209     Should Contain    ${resp.content}    <tp-id>tp:3:2</tp-id>
210     Should Contain    ${resp.content}    <tp-id>tp:4:1</tp-id>
211     Should Contain    ${resp.content}    <tp-id>tp:4:2</tp-id>
212     Should Contain    ${resp.content}    <tp-id>tp:5:1</tp-id>
213
214 Filtration Script Inventory Model
215     [Documentation]    Test of script type of filtration operation on Inventory model
216     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    node    openflow-topo:1
217     ${request}    Insert Filter    ${request}    ${FILTER_SCRIPT}    flow-node-inventory:ip-address
218     ${script}    Set Variable    if (node.getValue().indexOf("192.168.2") > -1 ) {filterOut.setResult(true);} else {filterOut.setResult(false);}
219     ${request}    Set Script Filter    ${request}    javascript    ${script}
220     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
221     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
222     Should Contain X Times    ${resp.content}    <node-id>node:    3
223     : FOR    ${index}    IN RANGE    1    3
224     \    Should Contain X Times    ${resp.content}    <node-ref>of-node:${index}</node-ref>    1
225     [Teardown]    Run Keywords    Filtration Nodes Test Teardown
226     ...    AND    Report_Failure_Due_To_Bug    4683
227
228 *** Keywords ***
229 Filtration Nodes Test Teardown
230     Test Teardown    network-topology:network-topology/topology/topo:1
231     Report_Failure_Due_To_Bug    4673