a1f5c42c26ec4e68362a93d5ecfc0f77b316b853
[integration/test.git] / csit / suites / topoprocessing / basic-topology-operations / 050_Aggregation_filtration.robot
1 *** Settings ***
2 Documentation     Test suite to verify fitration operation on different models.
3 ...               Before test starts, configurational file have to be rewriten to change listners registration datastore type from CONFIGURATION to OPERATIONAL.
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 ...               Tests themselves install feature required for specific model, clear karaf logs for futher synchronization, send configurational xmls and verify output.
6 ...               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
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 Filtration Node Inside Network Topology model
21     [Documentation]    Test unification filtration inside operation on Network Topology model
22     ${request}    Prepare Unification Filtration Inside Topology Request    ${UNIFICATION_FILTRATION_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:4
23     ${request}    Insert Filter    ${request}    ${FILTER_IPV4}    l3-unicast-igp-topology:igp-node-attributes/isis-topology:isis-node-attributes/isis-topology:ted/isis-topology:te-router-id-ipv4
24     ${request}    Set IPV4 Filter    ${request}    192.168.2.1/24
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:    2
28     Should Contain    ${resp.content}    <node-ref>bgp:    3
29     : FOR    ${index}    IN RANGE    18    20
30     \    Should Contain X Times    ${resp.content}    <node-ref>bgp:${index}</node-ref>    1
31     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:18']/..
32     ${node}    Element to String    ${node}
33     Should Contain X Times    ${node}    <supporting-node>    2
34     Should Contain    ${node}    <node-ref>bgp:18</node-ref>
35     Should Contain    ${node}    <node-ref>bgp:20</node-ref>
36
37 Unification Filtration Node Inside Inventory model
38     [Documentation]    Test unification filtration inside operation on Inventory model
39     ${request}    Prepare Unification Filtration Inside Topology Request    ${UNIFICATION_FILTRATION_NT_AGGREGATE_INSIDE}    opendaylight-inventory-model    node    flow-node-inventory:ip-address    openflow-topo:4
40     ${request}    Insert Filter    ${request}    ${FILTER_IPV4}    flow-node-inventory:ip-address
41     ${request}    Set IPV4 Filter    ${request}    192.168.2.1/24
42     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
43     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
44     Should Contain X Times    ${resp.content}    <node-id>node:    2
45     Should Contain    ${resp.content}    <node-ref>of-node:    4
46     : FOR    ${index}    IN RANGE    17    20
47     \    Should Contain X Times    ${resp.content}    <node-ref>of-node:${index}</node-ref>    1
48     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='of-node:17']/..
49     ${node}    Element to String    ${node}
50     Should Contain X Times    ${node}    <supporting-node>    3
51     Should Contain    ${node}    <node-ref>of-node:17</node-ref>
52     Should Contain    ${node}    <node-ref>of-node:19</node-ref>
53     Should Contain    ${node}    <node-ref>of-node:20</node-ref>
54
55 Unification Filtration Termination Point Inside Network Topology model
56     [Documentation]    Test unification filtration inside operation on Network Topology model
57     ${request}    Prepare Unification Filtration Inside Topology Request    ${UNIFICATION_FILTRATION_NT_AGGREGATE_INSIDE}    network-topology-model    termination-point    l3-unicast-igp-topology:igp-termination-point-attributes/l3-unicast-igp-topology:ip-address    network-topo:5
58     ${request}    Insert Filter    ${request}    ${FILTER_IPV4}    l3-unicast-igp-topology:igp-termination-point-attributes/l3-unicast-igp-topology:ip-address
59     ${request}    Set IPV4 Filter    ${request}    192.168.1.1/24
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:    5
63     Should Contain X Times    ${resp.content}    <termination-point>    4
64     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:21']/..
65     ${node}    Element to String    ${node}
66     Should Contain X Times    ${node}    <termination-point>    2
67     ${tp}    Get Element    ${node}    xpath=.//termination-point/supporting-termin-point[tp-ref='tp:21:2']/..
68     ${tp}    Element to String    ${tp}
69     Should Contain X Times    ${tp}    <tp-ref>tp:    2
70     Should Contain    ${tp}    <tp-ref>tp:21:3</tp-ref>
71     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:22']/..
72     ${node}    Element to String    ${node}
73     Should Contain X Times    ${node}    <termination-point>    1
74     Should Contain X Times    ${node}    <tp-ref>tp:    1
75     Should Contain    ${node}    <tp-ref>tp:22:2</tp-ref>
76     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:24']/..
77     ${node}    Element to String    ${node}
78     Should Contain X Times    ${node}    <termination-point>    1
79     Should Contain X Times    ${node}    <tp-ref>tp:    3
80     Should Contain    ${node}    <tp-ref>tp:24:1</tp-ref>
81     Should Contain    ${node}    <tp-ref>tp:24:2</tp-ref>
82     Should Contain    ${node}    <tp-ref>tp:24:3</tp-ref>
83
84 Unification Filtration Node Network Topology model
85     [Documentation]    Test unification filtration operation on Network Topology model
86     ${request}    Prepare Unification Filtration Inside Topology Request    ${UNIFICATION_FILTRATION_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:4
87     ${request}    Prepare Unification Filtration Topology Request    ${request}    network-topology-model    l3-unicast-igp-topology:igp-node-attributes/isis-topology:isis-node-attributes/isis-topology:ted/isis-topology:te-router-id-ipv4    network-topo:1
88     ${request}    Insert Filter    ${request}    ${FILTER_IPV4}    l3-unicast-igp-topology:igp-node-attributes/isis-topology:isis-node-attributes/isis-topology:ted/isis-topology:te-router-id-ipv4
89     ${request}    Set IPV4 Filter    ${request}    192.168.2.1/24
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:    5
93     : FOR    ${index}    IN RANGE    18    20
94     \    Should Contain X Times    ${resp.content}    <node-ref>bgp:${index}</node-ref>    1
95     : FOR    ${index}    IN RANGE    1    5
96     \    Should Contain X Times    ${resp.content}    <node-ref>bgp:${index}</node-ref>    1
97     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:18']/..
98     ${node}    Element to String    ${node}
99     Should Contain X Times    ${node}    <supporting-node>    4
100     Should Contain    ${node}    <node-ref>bgp:18</node-ref>
101     Should Contain    ${node}    <node-ref>bgp:20</node-ref>
102     Should Contain    ${node}    <node-ref>bgp:3</node-ref>
103     Should Contain    ${node}    <node-ref>bgp:4</node-ref>
104     Should Contain    ${node}    <termination-point>    4
105     Should Contain    ${node}    <tp-id>tp:3:1</tp-id>
106     Should Contain    ${node}    <tp-id>tp:3:2</tp-id>
107     Should Contain    ${node}    <tp-id>tp:4:1</tp-id>
108     Should Contain    ${node}    <tp-id>tp:4:2</tp-id>
109     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:5']/..
110     ${node}    Element to String    ${node}
111     Should Contain    ${node}    <termination-point>    1
112     Should Contain    ${node}    <tp-id>tp:5:1</tp-id>
113     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:1']/..
114     ${node}    Element to String    ${node}
115     Should Contain    ${node}    <termination-point>    3
116     Should Contain    ${node}    <tp-id>tp:1:1</tp-id>
117     Should Contain    ${node}    <tp-id>tp:1:2</tp-id>
118     Should Contain    ${node}    <tp-id>tp:1:3</tp-id>
119
120 Unification Filtration Node Inventory model
121     [Documentation]    Test unification filtration operation on Inventory model
122     ${request}    Prepare Unification Filtration Inside Topology Request    ${UNIFICATION_FILTRATION_NT}    opendaylight-inventory-model    node    flow-node-inventory:ip-address    openflow-topo:4
123     ${request}    Prepare Unification Filtration Topology Request    ${request}    opendaylight-inventory-model    flow-node-inventory:ip-address    openflow-topo:6
124     ${request}    Insert Filter    ${request}    ${FILTER_IPV4}    flow-node-inventory:ip-address
125     ${request}    Set IPV4 Filter    ${request}    192.168.1.1/24
126     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
127     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
128     Should Contain X Times    ${resp.content}    <node-id>node:    5
129     : FOR    ${index}    IN RANGE    6    10
130     \    Should Contain X Times    ${resp.content}    <node-ref>of-node:${index}</node-ref>    1
131     Should Contain X Times    ${resp.content}    <node-ref>of-node:16</node-ref>    1
132     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='of-node:6']/..
133     ${node}    Element to String    ${node}
134     Should Contain X Times    ${node}    <supporting-node>    2
135     Should Contain    ${node}    <node-ref>of-node:6</node-ref>
136     Should Contain    ${node}    <node-ref>of-node:16</node-ref>