Topoprocessing - Rework the output requesting mechanism
[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     Delete Overlay Topology
10 Library           RequestsLibrary
11 Library           SSHLibrary
12 Library           XML
13 Variables         ../../../variables/topoprocessing/TopologyRequests.py
14 Variables         ../../../variables/topoprocessing/TargetFields.py
15 Variables         ../../../variables/Variables.py
16 Resource          ../../../libraries/KarafKeywords.robot
17 Resource          ../../../libraries/Utils.robot
18 Resource          ../../../libraries/TopoprocessingKeywords.robot
19
20 *** Test Cases ***
21 Unification Node
22     [Documentation]    Test unification operation on Network Topology model
23     ${model}    Set Variable    network-topology-model
24     ${request}    Prepare Unification Topology Request    ${UNIFICATION_NT}    ${model}    node    network-topo:1    network-topo:2
25     ${request}    Insert Target Field    ${request}    0    ${ISIS_NODE_TE_ROUTER_ID_IPV4}    0
26     ${request}    Insert Target Field    ${request}    1    ${ISIS_NODE_TE_ROUTER_ID_IPV4}    0
27     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
28     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=8    supporting-node_count=10    tp_count=14    tp-ref_count=14
29     Check Aggregated Node in Topology    ${model}    ${resp.content}    2    bgp:5    bgp:10
30     Check Aggregated Node in Topology    ${model}    ${resp.content}    1    bgp:9
31     Check Aggregated Node in Topology    ${model}    ${resp.content}    1    bgp:8
32     Check Aggregated Node in Topology    ${model}    ${resp.content}    2    bgp:7
33     Check Aggregated Node in Topology    ${model}    ${resp.content}    1    bgp:6
34     Check Aggregated Node in Topology    ${model}    ${resp.content}    4    bgp:3    bgp:4
35     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    bgp:2
36     Check Aggregated Node in Topology    ${model}    ${resp.content}    3    bgp:1
37
38 Unification Node Inventory
39     [Documentation]    Test unification operation on inventory model
40     ${model}    Set Variable    opendaylight-inventory-model
41     ${request}    Prepare Unification Topology Request    ${UNIFICATION_NT}    ${model}    node    openflow-topo:1    openflow-topo:2
42     ${request}    Insert Target Field    ${request}    0    ${OPENFLOW_NODE_IP_ADDRESS}    0
43     ${request}    Insert Target Field    ${request}    1    ${OPENFLOW_NODE_IP_ADDRESS}    0
44     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
45     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=7    supporting-node_count=10    tp_count=12    tp-ref_count=12
46     Check Aggregated Node in Topology    ${model}    ${resp.content}    3    of-node:10    of-node:4
47     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    of-node:7    of-node:9
48     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    of-node:8
49     Check Aggregated Node in Topology    ${model}    ${resp.content}    2    of-node:6    of-node:1
50     Check Aggregated Node in Topology    ${model}    ${resp.content}    1    of-node:5
51     Check Aggregated Node in Topology    ${model}    ${resp.content}    3    of-node:3
52     Check Aggregated Node in Topology    ${model}    ${resp.content}    3    of-node:2
53
54 Unification Scripting Node
55     [Documentation]    Test unification operation on Network Topology model using scripting
56     ${model}    Set Variable    network-topology-model
57     ${request}    Prepare Unification Topology Request    ${UNIFICATION_NT}    ${model}    node    network-topo:1    network-topo:2
58     ${request}    Insert Target Field    ${request}    0    ${ISIS_NODE_TE_ROUTER_ID_IPV4}    0
59     ${request}    Insert Target Field    ${request}    1    ${ISIS_NODE_TE_ROUTER_ID_IPV4}    0
60     ${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);}
61     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
62     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=9    supporting-node_count=10    tp_count=14    tp-ref_count=14
63     Check Aggregated Node in Topology    ${model}    ${resp.content}    1    bgp:10
64     Check Aggregated Node in Topology    ${model}    ${resp.content}    1    bgp:9
65     Check Aggregated Node in Topology    ${model}    ${resp.content}    1    bgp:8
66     Check Aggregated Node in Topology    ${model}    ${resp.content}    2    bgp:7
67     Check Aggregated Node in Topology    ${model}    ${resp.content}    4    bgp:1    bgp:6
68     Check Aggregated Node in Topology    ${model}    ${resp.content}    1    bgp:5
69     Check Aggregated Node in Topology    ${model}    ${resp.content}    2    bgp:4
70     Check Aggregated Node in Topology    ${model}    ${resp.content}    2    bgp:3
71     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    bgp:2
72
73 Unification Scripting Node Inventory
74     [Documentation]    Test unification operation on inventory model using scripting
75     ${model}    Set Variable    opendaylight-inventory-model
76     ${request}    Prepare Unification Topology Request    ${UNIFICATION_NT}    ${model}    node    openflow-topo:1    openflow-topo:2
77     ${request}    Insert Target Field    ${request}    0    ${OPENFLOW_NODE_IP_ADDRESS}    0
78     ${request}    Insert Target Field    ${request}    1    ${OPENFLOW_NODE_IP_ADDRESS}    0
79     ${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);}
80     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
81     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=9    supporting-node_count=10    tp_count=12    tp-ref_count=12
82     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    of-node:10
83     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    of-node:9
84     Check Aggregated Node in Topology    ${model}    ${resp.content}    3    of-node:2    of-node:8
85     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    of-node:7
86     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    of-node:6
87     Check Aggregated Node in Topology    ${model}    ${resp.content}    1    of-node:5
88     Check Aggregated Node in Topology    ${model}    ${resp.content}    3    of-node:4
89     Check Aggregated Node in Topology    ${model}    ${resp.content}    3    of-node:3
90     Check Aggregated Node in Topology    ${model}    ${resp.content}    2    of-node:1
91
92 Unification Node Inside
93     [Documentation]    Test of unification type of aggregation inside on nodes on Network Topology model
94     ${model}    Set Variable    network-topology-model
95     ${request}    Prepare Unification Inside Topology Request    ${UNIFICATION_NT_AGGREGATE_INSIDE}    ${model}    node    network-topo:1
96     ${request}    Insert Target Field    ${request}    0    ${ISIS_NODE_TE_ROUTER_ID_IPV4}    0
97     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
98     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=4    supporting-node_count=5    tp_count=8    tp-ref_count=8
99     Check Aggregated Node in Topology    ${model}    ${resp.content}    1    bgp:5
100     Check Aggregated Node in Topology    ${model}    ${resp.content}    4    bgp:3    bgp:4
101     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    bgp:2
102     Check Aggregated Node in Topology    ${model}    ${resp.content}    3    bgp:1
103
104 Unification Node Inside Inventory
105     [Documentation]    Test of unification type of aggregation inside on nodes on Inventory model
106     ${model}    Set Variable    opendaylight-inventory-model
107     ${request}    Prepare Unification Inside Topology Request    ${UNIFICATION_NT_AGGREGATE_INSIDE}    ${model}    node    openflow-topo:2
108     ${request}    Insert Target Field    ${request}    0    ${OPENFLOW_NODE_IP_ADDRESS}    0
109     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
110     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=4    supporting-node_count=5    tp_count=0
111     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    of-node:10
112     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    of-node:7    of-node:9
113     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    of-node:8
114     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    of-node:6
115
116 Unification Termination Point Inside
117     [Documentation]    Test aggregate inside operation on termination points
118     ${model}    Set Variable    network-topology-model
119     ${request}    Prepare Unification Inside Topology Request    ${UNIFICATION_NT_AGGREGATE_INSIDE}    ${model}    termination-point    network-topo:1
120     ${request}    Insert Target Field    ${request}    0    ${OVSDB_OFPORT}    0
121     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
122     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=5    supporting-node_count=5    tp_count=6    tp-ref_count=8
123     ${topology_id}    Set Variable    network-topo:1
124     Check Aggregated Termination Point in Node    ${model}    ${resp.content}    ${topology_id}    bgp:1    tp:1:1    tp:1:1
125     ...    tp:1:2
126     Check Aggregated Termination Point in Node    ${model}    ${resp.content}    ${topology_id}    bgp:1    tp:1:3    tp:1:3
127     Check Aggregated Termination Point in Node    ${model}    ${resp.content}    ${topology_id}    bgp:3    tp:3:1    tp:3:1
128     Check Aggregated Termination Point in Node    ${model}    ${resp.content}    ${topology_id}    bgp:3    tp:3:2    tp:3:2
129     Check Aggregated Termination Point in Node    ${model}    ${resp.content}    ${topology_id}    bgp:4    tp:4:1    tp:4:1
130     ...    tp:4:2
131     Check Aggregated Termination Point in Node    ${model}    ${resp.content}    ${topology_id}    bgp:5    tp:5:1    tp:5:1
132
133 Unification Termination Point Inside Inventory
134     [Documentation]    Test aggregate inside operation on termination points
135     ${model}    Set Variable    opendaylight-inventory-model
136     ${request}    Prepare Unification Inside Topology Request    ${UNIFICATION_NT_AGGREGATE_INSIDE}    ${model}    termination-point    openflow-topo:1
137     ${request}    Insert Target Field    ${request}    0    ${OPENFLOW_NODE_CONNECTOR_PORT_NUMBER}    0
138     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
139     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=5    supporting-node_count=5    tp_count=8    tp-ref_count=12
140     ${topology_id}    Set Variable    openflow-topo:1
141     Check Aggregated Termination Point in Node    ${model}    ${resp.content}    ${topology_id}    of-node:5    tp:5:1    tp:5:1
142     Check Aggregated Termination Point in Node    ${model}    ${resp.content}    ${topology_id}    of-node:4    tp:4:1    tp:4:1
143     ...    tp:4:2    tp:4:3
144     Check Aggregated Termination Point in Node    ${model}    ${resp.content}    ${topology_id}    of-node:3    tp:3:1    tp:3:1
145     ...    tp:3:2
146     Check Aggregated Termination Point in Node    ${model}    ${resp.content}    ${topology_id}    of-node:3    tp:3:3    tp:3:3
147     Check Aggregated Termination Point in Node    ${model}    ${resp.content}    ${topology_id}    of-node:2    tp:2:1    tp:2:1
148     Check Aggregated Termination Point in Node    ${model}    ${resp.content}    ${topology_id}    of-node:2    tp:2:2    tp:2:2
149     Check Aggregated Termination Point in Node    ${model}    ${resp.content}    ${topology_id}    of-node:2    tp:2:3    tp:2:3
150     Check Aggregated Termination Point in Node    ${model}    ${resp.content}    ${topology_id}    of-node:1    tp:1:1    tp:1:1
151     ...    tp:1:2