Update Robot Framework format - step 15
[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
8 Library             RequestsLibrary
9 Library             SSHLibrary
10 Library             XML
11 Variables           ../../../variables/topoprocessing/TopologyRequests.py
12 Variables           ../../../variables/topoprocessing/TargetFields.py
13 Variables           ../../../variables/Variables.py
14 Resource            ../../../libraries/KarafKeywords.robot
15 Resource            ../../../libraries/Utils.robot
16 Resource            ../../../libraries/TopoprocessingKeywords.robot
17
18 Suite Setup         Setup Environment
19 Suite Teardown      Clean Environment
20 Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
21 Test Teardown       Delete Overlay Topology
22
23
24 *** Test Cases ***
25 Filtration IPV4 Network Topology Model
26     [Documentation]    Test of ipv4 type of filtration operation on Network Topology model
27     ${request}    Prepare Filtration Topology Request
28     ...    ${FILTRATION_NT}
29     ...    network-topology-model
30     ...    node
31     ...    network-topo:1
32     ${request}    Insert Filter    ${request}    ${FILTER_IPV4}    ${ISIS_NODE_TE_ROUTER_ID_IPV4}
33     ${request}    Set IPV4 Filter    ${request}    192.168.1.1/24
34     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
35     ${resp}    Wait Until Keyword Succeeds
36     ...    3x
37     ...    1s
38     ...    Output Topo Should Be Complete
39     ...    node_count=2
40     ...    supporting-node_count=2
41     ...    node-ref_count=2
42     ...    tp_count=3
43     ...    tp-ref_count=3
44     Check Filtered Nodes in Topology    ${resp.content}    3    bgp:1    bgp:2
45
46 Filtration IPV4 Inventory Model
47     [Documentation]    Test of ipv4 type of filtration operation on Inventory model
48     ${request}    Prepare Filtration Topology Request
49     ...    ${FILTRATION_NT}
50     ...    opendaylight-inventory-model
51     ...    node
52     ...    openflow-topo:1
53     ${request}    Insert Filter    ${request}    ${FILTER_IPV4}    ${OPENFLOW_NODE_IP_ADDRESS}
54     ${request}    Set IPV4 Filter    ${request}    192.168.1.1/24
55     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
56     ${resp}    Wait Until Keyword Succeeds
57     ...    3x
58     ...    1s
59     ...    Output Topo Should Be Complete
60     ...    node_count=3
61     ...    supporting-node_count=3
62     ...    node-ref_count=3
63     ...    tp_count=8
64     ...    tp-ref_count=8
65     Check Filtered Nodes in Topology    ${resp.content}    8    of-node:1    of-node:2    of-node:3
66
67 Filtration Range Number Network Topology Model
68     [Documentation]    Test of range number type of filtration operation on Network Topology model
69     ${request}    Prepare Filtration Topology Request
70     ...    ${FILTRATION_NT}
71     ...    network-topology-model
72     ...    node
73     ...    network-topo:2
74     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ${OVSDB_OVS_VERSION}
75     ${request}    Set Range Number Filter    ${request}    20    25
76     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
77     ${resp}    Wait Until Keyword Succeeds
78     ...    3x
79     ...    1s
80     ...    Output Topo Should Be Complete
81     ...    node_count=4
82     ...    supporting-node_count=4
83     ...    node-ref_count=4
84     ...    tp_count=5
85     ...    tp-ref_count=5
86     Check Filtered Nodes in Topology    ${resp.content}    5    bgp:7    bgp:8    bgp:9    bgp:10
87
88 Filtration Range Number Inventory Model
89     [Documentation]    Test of range number type of filtration operation on Inventory model
90     ${request}    Prepare Filtration Topology Request
91     ...    ${FILTRATION_NT}
92     ...    opendaylight-inventory-model
93     ...    node
94     ...    openflow-topo:2
95     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ${OPENFLOW_NODE_SERIAL_NUMBER}
96     ${request}    Set Range Number Filter    ${request}    20    25
97     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
98     ${resp}    Wait Until Keyword Succeeds
99     ...    3x
100     ...    1s
101     ...    Output Topo Should Be Complete
102     ...    node_count=3
103     ...    supporting-node_count=3
104     ...    node-ref_count=3
105     ...    tp_count=0
106     ...    tp-ref_count=0
107     Check Filtered Nodes in Topology    ${resp.content}    0    of-node:8    of-node:9    of-node:10
108
109 Filtration Specific String Network Topology Model
110     [Documentation]    Test of specific string type of filtration operation on Network Topology model
111     ${request}    Prepare Filtration Topology Request
112     ...    ${FILTRATION_NT}
113     ...    network-topology-model
114     ...    node
115     ...    network-topo:2
116     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_STRING}    ${OVSDB_OVS_VERSION}
117     ${request}    Set Specific String Filter    ${request}    25
118     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
119     ${resp}    Wait Until Keyword Succeeds
120     ...    3x
121     ...    1s
122     ...    Output Topo Should Be Complete
123     ...    node_count=2
124     ...    supporting-node_count=2
125     ...    node-ref_count=2
126     ...    tp_count=2
127     ...    tp-ref_count=2
128     Check Filtered Nodes in Topology    ${resp.content}    2    bgp:9    bgp:10
129
130 Filtration Specific String Inventory Model
131     [Documentation]    Test of specific string type of filtration operation on Inventory model
132     ${request}    Prepare Filtration Topology Request
133     ...    ${FILTRATION_NT}
134     ...    opendaylight-inventory-model
135     ...    node
136     ...    openflow-topo:2
137     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_STRING}    ${OPENFLOW_NODE_SERIAL_NUMBER}
138     ${request}    Set Specific String Filter    ${request}    21
139     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
140     ${resp}    Wait Until Keyword Succeeds
141     ...    3x
142     ...    1s
143     ...    Output Topo Should Be Complete
144     ...    node_count=2
145     ...    supporting-node_count=2
146     ...    node-ref_count=2
147     ...    tp_count=0
148     ...    tp-ref_count=0
149     Check Filtered Nodes in Topology    ${resp.content}    0    of-node:8    of-node:9
150
151 Filtration Range String Network Topology Model
152     [Documentation]    Test of range string type of filtration operation on Network Topology model
153     ${request}    Prepare Filtration Topology Request
154     ...    ${FILTRATION_NT}
155     ...    network-topology-model
156     ...    node
157     ...    network-topo:2
158     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_STRING}    ${OVSDB_OVS_VERSION}
159     ${request}    Set Range String Filter    ${request}    20    25
160     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
161     ${resp}    Wait Until Keyword Succeeds
162     ...    3x
163     ...    1s
164     ...    Output Topo Should Be Complete
165     ...    node_count=4
166     ...    supporting-node_count=4
167     ...    node-ref_count=4
168     ...    tp_count=5
169     ...    tp-ref_count=5
170     Check Filtered Nodes in Topology    ${resp.content}    5    bgp:7    bgp:8    bgp:9    bgp:10
171
172 Filtration Range String Inventory Model
173     [Documentation]    Test of range string type of filtration operation on Inventory model
174     ${request}    Prepare Filtration Topology Request
175     ...    ${FILTRATION_NT}
176     ...    opendaylight-inventory-model
177     ...    node
178     ...    openflow-topo:2
179     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_STRING}    ${OPENFLOW_NODE_SERIAL_NUMBER}
180     ${request}    Set Range String Filter    ${request}    20    25
181     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
182     ${resp}    Wait Until Keyword Succeeds
183     ...    3x
184     ...    1s
185     ...    Output Topo Should Be Complete
186     ...    node_count=3
187     ...    supporting-node_count=3
188     ...    node-ref_count=3
189     ...    tp_count=0
190     ...    tp-ref_count=0
191     Check Filtered Nodes in Topology    ${resp.content}    0    of-node:8    of-node:9    of-node:10
192
193 Filtration IPV6 Network Topology Model
194     [Documentation]    Test of ipv6 type of filtration operation on Network Topology model
195     ${request}    Prepare Filtration Topology Request
196     ...    ${FILTRATION_NT}
197     ...    network-topology-model
198     ...    node
199     ...    network-topo:3
200     ${request}    Insert Filter    ${request}    ${FILTER_IPV6}    ${ISIS_NODE_TE_ROUTER_ID_IPV6}
201     ${request}    Set IPV6 Filter    ${request}    fe80:0:0:0:0:0:c0a8:101/120
202     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
203     ${resp}    Wait Until Keyword Succeeds
204     ...    3x
205     ...    1s
206     ...    Output Topo Should Be Complete
207     ...    node_count=2
208     ...    supporting-node_count=2
209     ...    node-ref_count=2
210     ...    tp_count=1
211     ...    tp-ref_count=1
212     Check Filtered Nodes in Topology    ${resp.content}    1    bgp:11    bgp:12
213
214 Filtration IPV6 Inventory Model
215     [Documentation]    Test of ipv6 type of filtration operation on Inventory model
216     ${request}    Prepare Filtration Topology Request
217     ...    ${FILTRATION_NT}
218     ...    opendaylight-inventory-model
219     ...    node
220     ...    openflow-topo:3
221     ${request}    Insert Filter    ${request}    ${FILTER_IPV6}    ${OPENFLOW_NODE_IP_ADDRESS}
222     ${request}    Set IPV6 Filter    ${request}    fe80:0:0:0:0:0:c0a8:201/120
223     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
224     ${resp}    Wait Until Keyword Succeeds
225     ...    3x
226     ...    1s
227     ...    Output Topo Should Be Complete
228     ...    node_count=3
229     ...    supporting-node_count=3
230     ...    node-ref_count=3
231     ...    tp_count=0
232     ...    tp-ref_count=0
233     Check Filtered Nodes in Topology    ${resp.content}    0    of-node:12    of-node:14    of-node:15
234
235 Filtration Script Network Topology Model
236     [Documentation]    Test of script type of filtration operation on Network Topology model
237     ${request}    Prepare Filtration Topology Request
238     ...    ${FILTRATION_NT}
239     ...    network-topology-model
240     ...    node
241     ...    network-topo:1
242     ${request}    Insert Filter    ${request}    ${FILTER_SCRIPT}    ${ISIS_NODE_TE_ROUTER_ID_IPV4}
243     ${script}    Set Variable
244     ...    if (node.getValue().indexOf("192.168.1") > -1 ) {filterOut.setResult(true);} else {filterOut.setResult(false);}
245     ${request}    Set Script Filter    ${request}    javascript    ${script}
246     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
247     ${resp}    Wait Until Keyword Succeeds
248     ...    3x
249     ...    1s
250     ...    Output Topo Should Be Complete
251     ...    node_count=3
252     ...    supporting-node_count=3
253     ...    node-ref_count=3
254     ...    tp_count=5
255     ...    tp-ref_count=5
256     Check Filtered Nodes in Topology    ${resp.content}    5    bgp:3    bgp:4    bgp:5
257
258 Filtration Script Inventory Model
259     [Documentation]    Test of script type of filtration operation on Inventory model
260     ${request}    Prepare Filtration Topology Request
261     ...    ${FILTRATION_NT}
262     ...    opendaylight-inventory-model
263     ...    node
264     ...    openflow-topo:1
265     ${request}    Insert Filter    ${request}    ${FILTER_SCRIPT}    ${OPENFLOW_NODE_IP_ADDRESS}
266     ${script}    Set Variable
267     ...    if (node.getValue().indexOf("192.168.2") > -1 ) {filterOut.setResult(true);} else {filterOut.setResult(false);}
268     ${request}    Set Script Filter    ${request}    javascript    ${script}
269     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
270     ${resp}    Wait Until Keyword Succeeds
271     ...    3x
272     ...    1s
273     ...    Output Topo Should Be Complete
274     ...    node_count=3
275     ...    supporting-node_count=3
276     ...    node-ref_count=3
277     ...    tp_count=8
278     ...    tp-ref_count=8
279     Check Filtered Nodes in Topology    ${resp.content}    8    of-node:1    of-node:2    of-node:3