Migrate Get Requests invocations(libraries)
[integration/test.git] / csit / suites / topoprocessing / basic-topology-operations / 030_Filtration_termination_points.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 Range Number Network Topology Model
26     [Documentation]    Test of range number type of filtration operation on Network Topology model
27     ${request}    Prepare Filtration Topology Request
28     ...    ${FILTRATION_NT}
29     ...    network-topology-model
30     ...    termination-point
31     ...    network-topo:2
32     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ${OVSDB_OFPORT}
33     ${request}    Set Range Number Filter    ${request}    1115    1119
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=5
40     ...    supporting-node_count=5
41     ...    node-ref_count=5
42     ...    tp_count=3
43     ...    tp-ref_count=3
44     Check Filtered Termination Points in Node    ${resp.content}    bgp:6    tp:6:1
45     Check Filtered Termination Points in Node    ${resp.content}    bgp:7    tp:7:1    tp:7:2
46     Check Filtered Termination Points in Node    ${resp.content}    bgp:8
47     Check Filtered Termination Points in Node    ${resp.content}    bgp:9
48     Check Filtered Termination Points in Node    ${resp.content}    bgp:10
49
50 Filtration Range Number Inventory Model
51     [Documentation]    Test of range number type of filtration operation on Inventory model
52     ${request}    Prepare Filtration Topology Request
53     ...    ${FILTRATION_NT}
54     ...    opendaylight-inventory-model
55     ...    termination-point
56     ...    openflow-topo:1
57     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ${OPENFLOW_NODE_CONNECTOR_PORT_NUMBER}
58     ${request}    Set Range Number Filter    ${request}    2    4
59     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
60     ${resp}    Wait Until Keyword Succeeds
61     ...    3x
62     ...    1s
63     ...    Output Topo Should Be Complete
64     ...    node_count=5
65     ...    supporting-node_count=5
66     ...    node-ref_count=5
67     ...    tp_count=5
68     ...    tp-ref_count=5
69     Check Filtered Termination Points in Node    ${resp.content}    of-node:1
70     Check Filtered Termination Points in Node    ${resp.content}    of-node:2    tp:2:3    tp:2:2
71     Check Filtered Termination Points in Node    ${resp.content}    of-node:3    tp:3:1    tp:3:2
72     Check Filtered Termination Points in Node    ${resp.content}    of-node:4
73     Check Filtered Termination Points in Node    ${resp.content}    of-node:5    tp:5:1
74
75 Filtration Specific Number Network Topology Model
76     [Documentation]    Test of specific number type of filtration operation on Network Topology model
77     ${request}    Prepare Filtration Topology Request
78     ...    ${FILTRATION_NT}
79     ...    network-topology-model
80     ...    termination-point
81     ...    network-topo:2
82     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_NUMBER}    ${OVSDB_OFPORT}
83     ${request}    Set Specific Number Filter    ${request}    1119
84     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
85     ${resp}    Wait Until Keyword Succeeds
86     ...    3x
87     ...    1s
88     ...    Output Topo Should Be Complete
89     ...    node_count=5
90     ...    supporting-node_count=5
91     ...    node-ref_count=5
92     ...    tp_count=1
93     ...    tp-ref_count=1
94     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:7']/..
95     ${node}    Element to String    ${node}
96     Should Contain X Times    ${node}    <termination-point>    1
97     Check Filtered Termination Points in Node    ${resp.content}    bgp:6
98     Check Filtered Termination Points in Node    ${resp.content}    bgp:7    tp:7:1
99     Check Filtered Termination Points in Node    ${resp.content}    bgp:8
100     Check Filtered Termination Points in Node    ${resp.content}    bgp:9
101     Check Filtered Termination Points in Node    ${resp.content}    bgp:10
102
103 Filtration Specific Number Inventory Model
104     [Documentation]    Test of specific number type of filtration operation on Inventory model
105     ${request}    Prepare Filtration Topology Request
106     ...    ${FILTRATION_NT}
107     ...    opendaylight-inventory-model
108     ...    termination-point
109     ...    openflow-topo:1
110     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_NUMBER}    ${OPENFLOW_NODE_CONNECTOR_MAXIMUM_SPEED}
111     ${request}    Set Specific Number Filter    ${request}    2
112     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
113     ${resp}    Wait Until Keyword Succeeds
114     ...    3x
115     ...    1s
116     ...    Output Topo Should Be Complete
117     ...    node_count=5
118     ...    supporting-node_count=5
119     ...    node-ref_count=5
120     ...    tp_count=3
121     ...    tp-ref_count=3
122     Check Filtered Termination Points in Node    ${resp.content}    of-node:1
123     Check Filtered Termination Points in Node    ${resp.content}    of-node:2    tp:2:2
124     Check Filtered Termination Points in Node    ${resp.content}    of-node:3    tp:3:1    tp:3:2
125     Check Filtered Termination Points in Node    ${resp.content}    of-node:4
126     Check Filtered Termination Points in Node    ${resp.content}    of-node:5
127
128 Filtration Specific String Network Topology Model
129     [Documentation]    Test of specific string type of filtration operation on Network Topology model
130     ${request}    Prepare Filtration Topology Request
131     ...    ${FILTRATION_NT}
132     ...    network-topology-model
133     ...    termination-point
134     ...    network-topo:2
135     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_STRING}    ${OVSDB_TP_NAME}
136     ${request}    Set Specific String Filter    ${request}    portC
137     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
138     ${resp}    Wait Until Keyword Succeeds
139     ...    3x
140     ...    1s
141     ...    Output Topo Should Be Complete
142     ...    node_count=5
143     ...    supporting-node_count=5
144     ...    node-ref_count=5
145     ...    tp_count=1
146     ...    tp-ref_count=1
147     Check Filtered Termination Points in Node    ${resp.content}    bgp:6
148     Check Filtered Termination Points in Node    ${resp.content}    bgp:7    tp:7:2
149     Check Filtered Termination Points in Node    ${resp.content}    bgp:8
150     Check Filtered Termination Points in Node    ${resp.content}    bgp:9
151     Check Filtered Termination Points in Node    ${resp.content}    bgp:10
152
153 Filtration Specific String Inventory Model
154     [Documentation]    Test of specific string type of filtration operation on Inventory model
155     ${request}    Prepare Filtration Topology Request
156     ...    ${FILTRATION_NT}
157     ...    opendaylight-inventory-model
158     ...    termination-point
159     ...    openflow-topo:1
160     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_STRING}    ${OPENFLOW_NODE_CONNECTOR_NAME}
161     ${request}    Set Specific String Filter    ${request}    portB
162     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
163     ${resp}    Wait Until Keyword Succeeds
164     ...    3x
165     ...    1s
166     ...    Output Topo Should Be Complete
167     ...    node_count=5
168     ...    supporting-node_count=5
169     ...    node-ref_count=5
170     ...    tp_count=2
171     ...    tp-ref_count=2
172     Check Filtered Termination Points in Node    ${resp.content}    of-node:1
173     Check Filtered Termination Points in Node    ${resp.content}    of-node:2    tp:2:1
174     Check Filtered Termination Points in Node    ${resp.content}    of-node:3
175     Check Filtered Termination Points in Node    ${resp.content}    of-node:4
176     Check Filtered Termination Points in Node    ${resp.content}    of-node:5    tp:5:1
177
178 Filtration Range String Network Topology Model
179     [Documentation]    Test of range string type of filtration operation on Network Topology model
180     ${request}    Prepare Filtration Topology Request
181     ...    ${FILTRATION_NT}
182     ...    network-topology-model
183     ...    termination-point
184     ...    network-topo:2
185     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_STRING}    ${OVSDB_TP_NAME}
186     ${request}    Set Range String Filter    ${request}    portA    portC
187     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
188     ${resp}    Wait Until Keyword Succeeds
189     ...    3x
190     ...    1s
191     ...    Output Topo Should Be Complete
192     ...    node_count=5
193     ...    supporting-node_count=5
194     ...    node-ref_count=5
195     ...    tp_count=3
196     ...    tp-ref_count=3
197     Check Filtered Termination Points in Node    ${resp.content}    bgp:6    tp:6:1
198     Check Filtered Termination Points in Node    ${resp.content}    bgp:7    tp:7:2
199     Check Filtered Termination Points in Node    ${resp.content}    bgp:8
200     Check Filtered Termination Points in Node    ${resp.content}    bgp:9
201     Check Filtered Termination Points in Node    ${resp.content}    bgp:10    tp:10:1
202
203 Filtration Range String Inventory Model
204     [Documentation]    Test of range string type of filtration operation on Inventory model
205     ${request}    Prepare Filtration Topology Request
206     ...    ${FILTRATION_NT}
207     ...    opendaylight-inventory-model
208     ...    termination-point
209     ...    openflow-topo:1
210     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_STRING}    ${OPENFLOW_NODE_CONNECTOR_NAME}
211     ${request}    Set Range String Filter    ${request}    portA    portB
212     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
213     ${resp}    Wait Until Keyword Succeeds
214     ...    3x
215     ...    1s
216     ...    Output Topo Should Be Complete
217     ...    node_count=5
218     ...    supporting-node_count=5
219     ...    node-ref_count=5
220     ...    tp_count=3
221     ...    tp-ref_count=3
222     Check Filtered Termination Points in Node    ${resp.content}    of-node:1
223     Check Filtered Termination Points in Node    ${resp.content}    of-node:2    tp:2:1    tp:2:3
224     Check Filtered Termination Points in Node    ${resp.content}    of-node:3
225     Check Filtered Termination Points in Node    ${resp.content}    of-node:4
226     Check Filtered Termination Points in Node    ${resp.content}    of-node:5    tp:5:1
227
228 Filtration Script Network Topology Model
229     [Documentation]    Test of script type of filtration operation on Network Topology model
230     ${request}    Prepare Filtration Topology Request
231     ...    ${FILTRATION_NT}
232     ...    network-topology-model
233     ...    termination-point
234     ...    network-topo:1
235     ${request}    Insert Filter    ${request}    ${FILTER_SCRIPT}    ${OVSDB_OFPORT}
236     ${script}    Set Variable
237     ...    if (node.getValue() > 1117 ) {filterOut.setResult(true);} else {filterOut.setResult(false);}
238     ${request}    Set Script Filter    ${request}    javascript    ${script}
239     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
240     ${resp}    Wait Until Keyword Succeeds
241     ...    3x
242     ...    1s
243     ...    Output Topo Should Be Complete
244     ...    node_count=5
245     ...    supporting-node_count=5
246     ...    node-ref_count=5
247     ...    tp_count=3
248     ...    tp-ref_count=3
249     Check Filtered Termination Points in Node    ${resp.content}    bgp:1
250     Check Filtered Termination Points in Node    ${resp.content}    bgp:2
251     Check Filtered Termination Points in Node    ${resp.content}    bgp:3
252     Check Filtered Termination Points in Node    ${resp.content}    bgp:4    tp:4:1    tp:4:2
253     Check Filtered Termination Points in Node    ${resp.content}    bgp:5    tp:5:1
254
255 Filtration Script Inventory Model
256     [Documentation]    Test of script type of filtration operation on Inventory model
257     ${request}    Prepare Filtration Topology Request
258     ...    ${FILTRATION_NT}
259     ...    opendaylight-inventory-model
260     ...    termination-point
261     ...    openflow-topo:1
262     ${request}    Insert Filter    ${request}    ${FILTER_SCRIPT}    ${OPENFLOW_NODE_CONNECTOR_NAME}
263     ${script}    Set Variable
264     ...    if (node.getValue().indexOf("portB") > -1 ) {filterOut.setResult(true);} else {filterOut.setResult(false);}
265     ${request}    Set Script Filter    ${request}    javascript    ${script}
266     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
267     ${resp}    Wait Until Keyword Succeeds
268     ...    3x
269     ...    1s
270     ...    Output Topo Should Be Complete
271     ...    node_count=5
272     ...    supporting-node_count=5
273     ...    node-ref_count=5
274     ...    tp_count=3
275     ...    tp-ref_count=3
276     Check Filtered Termination Points in Node    ${resp.content}    of-node:1    tp:1:1
277     Check Filtered Termination Points in Node    ${resp.content}    of-node:2    tp:2:2    tp:2:3
278     Check Filtered Termination Points in Node    ${resp.content}    of-node:3
279     Check Filtered Termination Points in Node    ${resp.content}    of-node:4
280     Check Filtered Termination Points in Node    ${resp.content}    of-node:5