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