2 Documentation Test suite to verify unification operation on different models.
3 ... Before test starts, configurational file have to be rewriten to change listners registration datastore type from CONFIG_API to OPERATIONAL_API.
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 ... Suite setup also install features required for tested models, clear karaf logs for further synchronization. Tests themselves send configurational
6 ... xmls and verify output. 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 Aggregation Test Teardown
10 Library RequestsLibrary
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
21 [Documentation] Test unification operation on Network Topology model
22 ${request} Prepare Unification Topology Request ${UNIFICATION_NT} network-topology-model node network-topo:1 network-topo:2
23 ${request} Insert Target Field ${request} 0 l3-unicast-igp-topology:igp-node-attributes/isis-topology:isis-node-attributes/isis-topology:ted/isis-topology:te-router-id-ipv4 0
24 ${request} Insert Target Field ${request} 1 l3-unicast-igp-topology:igp-node-attributes/isis-topology:isis-node-attributes/isis-topology:ted/isis-topology:te-router-id-ipv4 0
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: 9
28 : FOR ${index} IN RANGE 1 9
29 \ Should Contain X Times ${resp.content} <node-ref>bgp:${index}</node-ref> 1
30 ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='bgp:10']/..
31 ${node} Element to String ${node}
32 Should Contain X Times ${node} <node-ref>bgp:10</node-ref> 1
33 Should Contain X Times ${node} <node-ref>bgp:5</node-ref> 1
35 Unification Node Inventory
36 [Documentation] Test unification operation on inventory model
37 ${request} Prepare Unification Topology Request ${UNIFICATION_NT} opendaylight-inventory-model node openflow-topo:1 openflow-topo:2
38 ${request} Insert Target Field ${request} 0 flow-node-inventory:ip-address 0
39 ${request} Insert Target Field ${request} 1 flow-node-inventory:ip-address 0
40 ${resp} Send Basic Request ${request} network-topology:network-topology/topology/topo:1
41 Should Contain ${resp.content} <topology-id>topo:1</topology-id>
42 Should Contain X Times ${resp.content} <node-id>node: 8
43 : FOR ${index} IN RANGE 1 10
44 \ Should Contain X Times ${resp.content} <node-ref>of-node:${index}</node-ref> 1
45 ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='of-node:1']/..
46 ${node} Element to String ${node}
47 Should Contain X Times ${node} <node-ref>of-node:6</node-ref> 1
48 Should Contain X Times ${node} <node-ref>of-node:1</node-ref> 1
49 ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='of-node:4']/..
50 ${node} Element to String ${node}
51 Should Contain X Times ${node} <node-ref>of-node:10</node-ref> 1
52 Should Contain X Times ${node} <node-ref>of-node:4</node-ref> 1
54 Unification Scripting Node
55 [Documentation] Test unification operation on Network Topology model using scripting
56 ${request} Prepare Unification Topology Request ${UNIFICATION_NT} network-topology-model node network-topo:1 network-topo:2
57 ${request} Insert Target Field ${request} 0 l3-unicast-igp-topology:igp-node-attributes/isis-topology:isis-node-attributes/isis-topology:ted/isis-topology:te-router-id-ipv4 0
58 ${request} Insert Target Field ${request} 1 l3-unicast-igp-topology:igp-node-attributes/isis-topology:isis-node-attributes/isis-topology:ted/isis-topology:te-router-id-ipv4 0
59 ${request} Insert Scripting into Request ${request} javascript if (originalItem.getLeafNodes().get(java.lang.Integer.valueOf('0')).getValue().indexOf("192.168.1.1") > -1 && newItem.getLeafNodes().get(java.lang.Integer.valueOf('0')).getValue().indexOf("192.168.1.3") > -1 || originalItem.getLeafNodes().get(java.lang.Integer.valueOf('0')).getValue().indexOf("192.168.1.3") > -1 && newItem.getLeafNodes().get(java.lang.Integer.valueOf('0')).getValue().indexOf("192.168.1.1") > -1) {aggregable.setResult(true);} else { aggregable.setResult(false);}
60 ${resp} Send Basic Request ${request} network-topology:network-topology/topology/topo:1
61 Should Contain ${resp.content} <topology-id>topo:1</topology-id>
62 Should Contain X Times ${resp.content} <node-id>node: 9
63 : FOR ${index} IN RANGE 1 10
64 \ Should Contain X Times ${resp.content} <node-ref>bgp:${index}</node-ref> 1
65 ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='bgp:1']/..
66 ${node} Element to String ${node}
67 Should Contain X Times ${node} <node-ref>bgp:1</node-ref> 1
68 Should Contain X Times ${node} <node-ref>bgp:6</node-ref> 1
70 Unification Scripting Node Inventory
71 [Documentation] Test unification operation on inventory model using scripting
72 ${request} Prepare Unification Topology Request ${UNIFICATION_NT} opendaylight-inventory-model node openflow-topo:1 openflow-topo:2
73 ${request} Insert Target Field ${request} 0 flow-node-inventory:ip-address 0
74 ${request} Insert Target Field ${request} 1 flow-node-inventory:ip-address 0
75 ${request} Insert Scripting into Request ${request} javascript if (originalItem.getLeafNodes().get(java.lang.Integer.valueOf('0')).getValue().indexOf("192.168.1.2") > -1 && newItem.getLeafNodes().get(java.lang.Integer.valueOf('0')).getValue().indexOf("192.168.1.4") > -1 || originalItem.getLeafNodes().get(java.lang.Integer.valueOf('0')).getValue().indexOf("192.168.1.4") > -1 && newItem.getLeafNodes().get(java.lang.Integer.valueOf('0')).getValue().indexOf("192.168.1.2") > -1) {aggregable.setResult(true);} else { aggregable.setResult(false);}
76 ${resp} Send Basic Request ${request} network-topology:network-topology/topology/topo:1
77 Should Contain ${resp.content} <topology-id>topo:1</topology-id>
78 Should Contain X Times ${resp.content} <node-id>node: 9
79 : FOR ${index} IN RANGE 1 10
80 \ Should Contain X Times ${resp.content} <node-ref>of-node:${index}</node-ref> 1
81 ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='of-node:2']/..
82 ${node} Element to String ${node}
83 Should Contain X Times ${node} <node-ref>of-node:2</node-ref> 1
84 Should Contain X Times ${node} <node-ref>of-node:8</node-ref> 1
86 Unification Node Inside
87 [Documentation] Test of unification type of aggregation inside on nodes on Network Topology model
88 ${request} Prepare Unification Inside Topology Request ${UNIFICATION_NT_AGGREGATE_INSIDE} network-topology-model node network-topo:1
89 ${request} Insert Target Field ${request} 0 l3-unicast-igp-topology:igp-node-attributes/isis-topology:isis-node-attributes/isis-topology:ted/isis-topology:te-router-id-ipv4 0
90 ${resp} Send Basic Request ${request} network-topology:network-topology/topology/topo:1
91 Should Contain ${resp.content} <topology-id>topo:1</topology-id>
92 Should Contain X Times ${resp.content} <node-id>node: 4
93 ${response_xml} Parse XML ${resp.content}
94 ${node} Get Element ${response_xml} xpath=.//node/supporting-node[node-ref='bgp:3']/..
95 ${node} Element To String ${node}
96 Should Contain X Times ${node} <supporting-node> 2
97 Should Contain ${node} <supporting-node><node-ref>bgp:3</node-ref>
98 Should Contain ${node} <supporting-node><node-ref>bgp:4</node-ref>
100 Unification Node Inside Inventory
101 [Documentation] Test of unification type of aggregation inside on nodes on Inventory model
102 ${request} Prepare Unification Inside Topology Request ${UNIFICATION_NT_AGGREGATE_INSIDE} opendaylight-inventory-model node openflow-topo:2
103 ${request} Insert Target Field ${request} 0 flow-node-inventory:ip-address 0
104 ${resp} Send Basic Request ${request} network-topology:network-topology/topology/topo:1
105 Should Contain ${resp.content} <topology-id>topo:1</topology-id>
106 Should Contain X Times ${resp.content} <node-id>node: 4
107 ${response_xml} Parse XML ${resp.content}
108 ${node} Get Element ${response_xml} xpath=.//node/supporting-node[node-ref='of-node:7']/..
109 ${node} Element To String ${node}
110 Should Contain X Times ${node} <supporting-node> 2
111 Should Contain ${node} <supporting-node><node-ref>of-node:7</node-ref>
112 Should Contain ${node} <supporting-node><node-ref>of-node:9</node-ref>
114 Unification Termination Point Inside
115 [Documentation] Test aggregate inside operation on termination points
116 ${request} Prepare Unification Inside Topology Request ${UNIFICATION_NT_AGGREGATE_INSIDE} network-topology-model termination-point network-topo:1
117 ${request} Insert Target Field ${request} 0 ovsdb:ofport 0
118 ${resp} Send Basic Request ${request} network-topology:network-topology/topology/topo:1
119 Should Contain ${resp.content} <topology-id>topo:1</topology-id>
120 Should Contain X Times ${resp.content} <node-id>node: 5
121 Should Contain X Times ${resp.content} <termination-point> 6
122 ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='bgp:1']/..
123 ${node} Element to String ${node}
124 Should Contain X Times ${node} <termination-point> 2
125 ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='bgp:3']/..
126 ${node} Element to String ${node}
127 Should Contain X Times ${node} <termination-point> 2
128 ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='bgp:4']/..
129 ${node} Element to String ${node}
130 Should Contain X Times ${node} <termination-point> 1
131 ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='bgp:5']/..
132 ${node} Element to String ${node}
133 Should Contain X Times ${node} <termination-point> 1
135 Unification Termination Point Inside Inventory
136 [Documentation] Test aggregate inside operation on termination points
137 ${request} Prepare Unification Inside Topology Request ${UNIFICATION_NT_AGGREGATE_INSIDE} opendaylight-inventory-model termination-point openflow-topo:1
138 ${request} Insert Target Field ${request} 0 flow-node-inventory:port-number 0
139 ${resp} Send Basic Request ${request} network-topology:network-topology/topology/topo:1
140 Should Contain ${resp.content} <topology-id>topo:1</topology-id>
141 Should Contain X Times ${resp.content} <node-id>node: 5
142 Should Contain X Times ${resp.content} <termination-point> 8
143 ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='of-node:1']/..
144 ${node} Element to String ${node}
145 Should Contain X Times ${node} <termination-point> 1
146 ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='of-node:2']/..
147 ${node} Element to String ${node}
148 Should Contain X Times ${node} <termination-point> 3
149 ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='of-node:3']/..
150 ${node} Element to String ${node}
151 Should Contain X Times ${node} <termination-point> 2
152 ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='of-node:4']/..
153 ${node} Element to String ${node}
154 Should Contain X Times ${node} <termination-point> 1
155 ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='of-node:5']/..
156 ${node} Element to String ${node}
157 Should Contain X Times ${node} <termination-point> 1
158 [Teardown] Run Keywords Aggregation Test Teardown
159 ... AND Report_Failure_Due_To_Bug 4674
162 Aggregation Test Teardown
163 Test Teardown network-topology:network-topology/topology/topo:1
164 Report_Failure_Due_To_Bug 5157