Topoprocessing bugs made visible in robot logs
[integration/test.git] / csit / suites / topoprocessing / basic-topology-operations / 010_Aggregation.robot
1 *** Settings ***
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
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 Unification Node
21     [Documentation]    Test unification operation on Network Topology model
22     ${request}    Prepare Unification Topology Request    ${UNIFICATION_NT}    network-topology-model    node    l3-unicast-igp-topology:igp-node-attributes/isis-topology:isis-node-attributes/isis-topology:ted/isis-topology:te-router-id-ipv4    network-topo:1
23     ...    network-topo:2
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>bgp:${index}</node-ref>    1
29     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:10']/..
30     ${node}    Element to String    ${node}
31     Should Contain X Times    ${node}    <node-ref>bgp:10</node-ref>    1
32     Should Contain X Times    ${node}    <node-ref>bgp:5</node-ref>    1
33
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
37     ...    openflow-topo:2
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
52 Unification Scripting Node
53     [Documentation]    Test unification operation on Network Topology model using scripting
54     ${request}    Prepare Unification Topology Request    ${UNIFICATION_NT}    network-topology-model    node    l3-unicast-igp-topology:igp-node-attributes/isis-topology:isis-node-attributes/isis-topology:ted/isis-topology:te-router-id-ipv4    network-topo:1
55     ...    network-topo:2
56     ${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);}
57     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
58     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
59     Should Contain X Times    ${resp.content}    <node-id>node:    9
60     : FOR    ${index}    IN RANGE    1    10
61     \    Should Contain X Times    ${resp.content}    <node-ref>bgp:${index}</node-ref>    1
62     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:1']/..
63     ${node}    Element to String    ${node}
64     Should Contain X Times    ${node}    <node-ref>bgp:1</node-ref>    1
65     Should Contain X Times    ${node}    <node-ref>bgp:6</node-ref>    1
66
67 Unification Scripting Node Inventory
68     [Documentation]    Test unification operation on inventory model using scripting
69     ${request}    Prepare Unification Topology Request    ${UNIFICATION_NT}    opendaylight-inventory-model    node    flow-node-inventory:ip-address    openflow-topo:1
70     ...    openflow-topo:2
71     ${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);}
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:    9
75     : FOR    ${index}    IN RANGE    1    10
76     \    Should Contain X Times    ${resp.content}    <node-ref>of-node:${index}</node-ref>    1
77     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='of-node:2']/..
78     ${node}    Element to String    ${node}
79     Should Contain X Times    ${node}    <node-ref>of-node:2</node-ref>    1
80     Should Contain X Times    ${node}    <node-ref>of-node:8</node-ref>    1
81
82 Unification Node Inside
83     [Documentation]    Test of unification type of aggregation inside on nodes on Network Topology model
84     ${request}    Prepare Unification Inside Topology Request    ${UNIFICATION_NT_AGGREGATE_INSIDE}    network-topology-model    node    l3-unicast-igp-topology:igp-node-attributes/isis-topology:isis-node-attributes/isis-topology:ted/isis-topology:te-router-id-ipv4    network-topo:1
85     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
86     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
87     Should Contain X Times    ${resp.content}    <node-id>node:    4
88     ${response_xml}    Parse XML    ${resp.content}
89     ${node}    Get Element    ${response_xml}    xpath=.//node/supporting-node[node-ref='bgp:3']/..
90     ${node}    Element To String    ${node}
91     Should Contain X Times    ${node}    <supporting-node>    2
92     Should Contain    ${node}    <supporting-node><node-ref>bgp:3</node-ref>
93     Should Contain    ${node}    <supporting-node><node-ref>bgp:4</node-ref>
94
95 Unification Node Inside Inventory
96     [Documentation]    Test of unification type of aggregation inside on nodes on Inventory model
97     ${request}    Prepare Unification Inside Topology Request    ${UNIFICATION_NT_AGGREGATE_INSIDE}    opendaylight-inventory-model    node    flow-node-inventory:ip-address    openflow-topo:2
98     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
99     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
100     Should Contain X Times    ${resp.content}    <node-id>node:    4
101     ${response_xml}    Parse XML    ${resp.content}
102     ${node}    Get Element    ${response_xml}    xpath=.//node/supporting-node[node-ref='of-node:7']/..
103     ${node}    Element To String    ${node}
104     Should Contain X Times    ${node}    <supporting-node>    2
105     Should Contain    ${node}    <supporting-node><node-ref>of-node:7</node-ref>
106     Should Contain    ${node}    <supporting-node><node-ref>of-node:9</node-ref>
107
108 Unification Termination Point Inside
109     [Documentation]    Test aggregate inside operation on termination points
110     ${request}    Prepare Unification Inside Topology Request    ${UNIFICATION_NT_AGGREGATE_INSIDE}    network-topology-model    termination-point    ovsdb:ofport    network-topo:1
111     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
112     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
113     ${response_xml}    Get Element    ${resp.content}    xpath=.//topology[topology-id='topo:1']
114     ${response_xml}    Element to String    ${response_xml}
115     Should Contain X Times    ${resp.content}    <node-id>node:    5
116     Should Contain X Times    ${response_xml}    <termination-point>    6
117     ${node}    Get Element    ${response_xml}    xpath=.//node/supporting-node[node-ref='bgp:1']/..
118     ${node}    Element to String    ${node}
119     Should Contain X Times    ${node}    <termination-point>    2
120     ${node}    Get Element    ${response_xml}    xpath=.//node/supporting-node[node-ref='bgp:3']/..
121     ${node}    Element to String    ${node}
122     Should Contain X Times    ${node}    <termination-point>    2
123     ${node}    Get Element    ${response_xml}    xpath=.//node/supporting-node[node-ref='bgp:4']/..
124     ${node}    Element to String    ${node}
125     Should Contain X Times    ${node}    <termination-point>    1
126     ${node}    Get Element    ${response_xml}    xpath=.//node/supporting-node[node-ref='bgp:5']/..
127     ${node}    Element to String    ${node}
128     Should Contain X Times    ${node}    <termination-point>    1
129     [Teardown]    Run Keywords    Aggregation Test Teardown
130     ...    AND    Report_Failure_Due_To_Bug    4750
131
132 Unification Termination Point Inside Inventory
133     [Documentation]    Test aggregate inside operation on termination points
134     ${request}    Prepare Unification Inside Topology Request    ${UNIFICATION_NT_AGGREGATE_INSIDE}    opendaylight-inventory-model    termination-point    flow-node-inventory:port-number    openflow-topo:1
135     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
136     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
137     ${response_xml}    Get Element    ${resp.content}    xpath=.//topology[topology-id='topo:1']
138     ${response_xml}    Element to String    ${response_xml}
139     Should Contain X Times    ${resp.content}    <node-id>node:    5
140     Should Contain X Times    ${response_xml}    <termination-point>    7
141     ${node}    Get Element    ${response_xml}    xpath=.//node/supporting-node[node-ref='of-node:1']/..
142     ${node}    Element to String    ${node}
143     Should Contain X Times    ${node}    <termination-point>    1
144     ${node}    Get Element    ${response_xml}    xpath=.//node/supporting-node[node-ref='of-node:2']/..
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:3']/..
148     ${node}    Element to String    ${node}
149     Should Contain X Times    ${node}    <termination-point>    2
150     ${node}    Get Element    ${response_xml}    xpath=.//node/supporting-node[node-ref='of-node:4']/..
151     ${node}    Element to String    ${node}
152     Should Contain X Times    ${node}    <termination-point>    1
153     ${node}    Get Element    ${response_xml}    xpath=.//node/supporting-node[node-ref='of-node:5']/..
154     ${node}    Element to String    ${node}
155     Should Contain X Times    ${node}    <termination-point>    1
156     [Teardown]    Run Keywords    Aggregation Test Teardown
157     ...    AND    Report_Failure_Due_To_Bug    4674
158
159 *** Keywords ***
160 Aggregation Test Teardown
161     Test Teardown    network-topology:network-topology/topology/topo:1
162     Report_Failure_Due_To_Bug    4673