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 Test Teardown network-topology:network-topology/topology/topo:1
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-topology-pcep:path-computation-client/network-topology-pcep:ip-address network-topo:1
24 ${resp} Send Basic Request ${request} network-topology:network-topology/topology/topo:1
25 Should Contain ${resp.content} <topology-id>topo:1</topology-id>
26 Should Contain X Times ${resp.content} <node-id>node: 9
27 : FOR ${index} IN RANGE 1 9
28 \ Should Contain X Times ${resp.content} <node-ref>pcep:${index}</node-ref> 1
29 ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='pcep:10']/..
30 ${node} Element to String ${node}
31 Should Contain X Times ${node} <node-ref>pcep:10</node-ref> 1
32 Should Contain X Times ${node} <node-ref>pcep:5</node-ref> 1
34 Unification Node Inventory
35 [Documentation] Test unification operation on inventory model
36 ${request} Prepare Unification Topology Request ${UNIFICATION_NT} opendaylight-inventory-model node flow-node-inventory:ip-address openflow-topo:1
38 ${resp} Send Basic Request ${request} network-topology:network-topology/topology/topo:1
39 Should Contain ${resp.content} <topology-id>topo:1</topology-id>
40 Should Contain X Times ${resp.content} <node-id>node: 8
41 : FOR ${index} IN RANGE 1 10
42 \ Should Contain X Times ${resp.content} <node-ref>of-node:${index}</node-ref> 1
43 ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='of-node:1']/..
44 ${node} Element to String ${node}
45 Should Contain X Times ${node} <node-ref>of-node:6</node-ref> 1
46 Should Contain X Times ${node} <node-ref>of-node:1</node-ref> 1
47 ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='of-node:4']/..
48 ${node} Element to String ${node}
49 Should Contain X Times ${node} <node-ref>of-node:10</node-ref> 1
50 Should Contain X Times ${node} <node-ref>of-node:4</node-ref> 1
51 Unification Scripting Node
52 [Documentation] Test unification operation on Network Topology model using scripting
53 ${request} Prepare Unification Topology Request ${UNIFICATION_NT} network-topology-model node network-topology-pcep:path-computation-client/network-topology-pcep:ip-address network-topo:1
55 ${request} Insert Scripting into Request ${request} javascript if (originalItem.getLeafNode().getValue().indexOf("192.168.1.1") > -1 && newItem.getLeafNode().getValue().indexOf("192.168.1.3") > -1 || originalItem.getLeafNode().getValue().indexOf("192.168.1.3") > -1 && newItem.getLeafNode().getValue().indexOf("192.168.1.1") > -1) {aggregable.setResult(true);} else { aggregable.setResult(false);}
56 ${resp} Send Basic Request ${request} network-topology:network-topology/topology/topo:1
57 Should Contain ${resp.content} <topology-id>topo:1</topology-id>
58 Should Contain X Times ${resp.content} <node-id>node: 9
59 : FOR ${index} IN RANGE 1 10
60 \ Should Contain X Times ${resp.content} <node-ref>pcep:${index}</node-ref> 1
61 ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='pcep:1']/..
62 ${node} Element to String ${node}
63 Should Contain X Times ${node} <node-ref>pcep:1</node-ref> 1
64 Should Contain X Times ${node} <node-ref>pcep:6</node-ref> 1
66 Unification Scripting Node Inventory
67 [Documentation] Test unification operation on inventory model using scripting
68 ${request} Prepare Unification Topology Request ${UNIFICATION_NT} opendaylight-inventory-model node flow-node-inventory:ip-address openflow-topo:1
70 ${request} Insert Scripting into Request ${request} javascript if (originalItem.getLeafNode().getValue().indexOf("192.168.1.2") > -1 && newItem.getLeafNode().getValue().indexOf("192.168.1.4") > -1 || originalItem.getLeafNode().getValue().indexOf("192.168.1.4") > -1 && newItem.getLeafNode().getValue().indexOf("192.168.1.2") > -1) {aggregable.setResult(true);} else { aggregable.setResult(false);}
71 ${resp} Send Basic Request ${request} network-topology:network-topology/topology/topo:1
72 Should Contain ${resp.content} <topology-id>topo:1</topology-id>
73 Should Contain X Times ${resp.content} <node-id>node: 9
74 : FOR ${index} IN RANGE 1 10
75 \ Should Contain X Times ${resp.content} <node-ref>of-node:${index}</node-ref> 1
76 ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='of-node:2']/..
77 ${node} Element to String ${node}
78 Should Contain X Times ${node} <node-ref>of-node:2</node-ref> 1
79 Should Contain X Times ${node} <node-ref>of-node:8</node-ref> 1
81 Unification Node Inside
82 [Documentation] Test of unification type of aggregation inside on nodes on Network Topology model
83 ${request} Prepare Unification Inside Topology Request ${UNIFICATION_NT_AGGREGATE_INSIDE} network-topology-model node network-topology-pcep:path-computation-client/network-topology-pcep:ip-address network-topo:1
84 ${resp} Send Basic Request ${request} network-topology:network-topology/topology/topo:1
85 Should Contain ${resp.content} <topology-id>topo:1</topology-id>
86 Should Contain X Times ${resp.content} <node-id>node: 4
87 ${response_xml} Parse XML ${resp.content}
88 ${node} Get Element ${response_xml} xpath=.//node/supporting-node[node-ref='pcep:3']/..
89 ${node} Element To String ${node}
90 Should Contain X Times ${node} <supporting-node> 2
91 Should Contain ${node} <supporting-node><node-ref>pcep:3</node-ref>
92 Should Contain ${node} <supporting-node><node-ref>pcep:4</node-ref>
94 Unification Node Inside Inventory
95 [Documentation] Test of unification type of aggregation inside on nodes on Inventory model
96 ${request} Prepare Unification Inside Topology Request ${UNIFICATION_NT_AGGREGATE_INSIDE} opendaylight-inventory-model node flow-node-inventory:ip-address openflow-topo:2
97 ${resp} Send Basic Request ${request} network-topology:network-topology/topology/topo:1
98 Should Contain ${resp.content} <topology-id>topo:1</topology-id>
99 Should Contain X Times ${resp.content} <node-id>node: 4
100 ${response_xml} Parse XML ${resp.content}
101 ${node} Get Element ${response_xml} xpath=.//node/supporting-node[node-ref='of-node:7']/..
102 ${node} Element To String ${node}
103 Should Contain X Times ${node} <supporting-node> 2
104 Should Contain ${node} <supporting-node><node-ref>of-node:7</node-ref>
105 Should Contain ${node} <supporting-node><node-ref>of-node:9</node-ref>
107 Unification Termination Point Inside
108 [Documentation] Test aggregate inside operation on termination points
109 ${request} Prepare Unification Inside Topology Request ${UNIFICATION_NT_AGGREGATE_INSIDE} network-topology-model termination-point ovsdb:ofport network-topo:1
110 ${resp} Send Basic Request ${request} network-topology:network-topology/topology/topo:1
111 Should Contain ${resp.content} <topology-id>topo:1</topology-id>
112 ${response_xml} Get Element ${resp.content} xpath=.//topology[topology-id='topo:1']
113 ${response_xml} Element to String ${response_xml}
114 Should Contain X Times ${resp.content} <node-id>node: 5
115 Should Contain X Times ${response_xml} <termination-point> 6
116 ${node} Get Element ${response_xml} xpath=.//node/supporting-node[node-ref='pcep:1']/..
117 ${node} Element to String ${node}
118 Should Contain X Times ${node} <termination-point> 2
119 ${node} Get Element ${response_xml} xpath=.//node/supporting-node[node-ref='pcep:3']/..
120 ${node} Element to String ${node}
121 Should Contain X Times ${node} <termination-point> 2
122 ${node} Get Element ${response_xml} xpath=.//node/supporting-node[node-ref='pcep:4']/..
123 ${node} Element to String ${node}
124 Should Contain X Times ${node} <termination-point> 1
125 ${node} Get Element ${response_xml} xpath=.//node/supporting-node[node-ref='pcep:5']/..
126 ${node} Element to String ${node}
127 Should Contain X Times ${node} <termination-point> 1
129 Unification Termination Point Inside Inventory
130 [Documentation] Test aggregate inside operation on termination points
131 ${request} Prepare Unification Inside Topology Request ${UNIFICATION_NT_AGGREGATE_INSIDE} opendaylight-inventory-model termination-point flow-node-inventory:port-number openflow-topo:1
132 ${resp} Send Basic Request ${request} network-topology:network-topology/topology/topo:1
133 Should Contain ${resp.content} <topology-id>topo:1</topology-id>
134 ${response_xml} Get Element ${resp.content} xpath=.//topology[topology-id='topo:1']
135 ${response_xml} Element to String ${response_xml}
136 Should Contain X Times ${resp.content} <node-id>node: 5
137 Should Contain X Times ${response_xml} <termination-point> 7
138 ${node} Get Element ${response_xml} xpath=.//node/supporting-node[node-ref='of-node:1']/..
139 ${node} Element to String ${node}
140 Should Contain X Times ${node} <termination-point> 1
141 ${node} Get Element ${response_xml} xpath=.//node/supporting-node[node-ref='of-node:2']/..
142 ${node} Element to String ${node}
143 Should Contain X Times ${node} <termination-point> 2
144 ${node} Get Element ${response_xml} xpath=.//node/supporting-node[node-ref='of-node:3']/..
145 ${node} Element to String ${node}
146 Should Contain X Times ${node} <termination-point> 2
147 ${node} Get Element ${response_xml} xpath=.//node/supporting-node[node-ref='of-node:4']/..
148 ${node} Element to String ${node}
149 Should Contain X Times ${node} <termination-point> 1
150 ${node} Get Element ${response_xml} xpath=.//node/supporting-node[node-ref='of-node:5']/..
151 ${node} Element to String ${node}
152 Should Contain X Times ${node} <termination-point> 1