topoprocessing - fix for bug 5448
[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 With ID    ${request}    ${FILTER_IPV4}    l3-unicast-igp-topology:igp-node-attributes/isis-topology:isis-node-attributes/isis-topology:ted/isis-topology:te-router-id-ipv4    1
24     ${request}    Insert Apply Filters    ${request}    1    1
25     ${request}    Set IPV4 Filter    ${request}    192.168.2.1/24
26     ${resp}    Send Basic Request And Test If Contain X Times    ${request}    network-topology:network-topology/topology/topo:1    <node-id>node:    2
27     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
28     Should Contain    ${resp.content}    <node-ref>bgp:    3
29     : FOR    ${index}    IN RANGE    18    21
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 With ID    ${request}    ${FILTER_IPV4}    flow-node-inventory:ip-address    1
41     ${request}    Insert Apply Filters    ${request}    1    1
42     ${request}    Set IPV4 Filter    ${request}    192.168.2.1/24
43     ${resp}    Send Basic Request And Test If Contain X Times    ${request}    network-topology:network-topology/topology/topo:1    <node-id>node:    2
44     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
45     Should Contain    ${resp.content}    <node-ref>of-node:    4
46     : FOR    ${index}    IN RANGE    17    21
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    ovsdb:name    network-topo:5
58     ${request}    Insert Filter With ID    ${request}    ${FILTER_SPECIFIC_STRING}    ovsdb:name    1
59     ${request}    Insert Apply Filters    ${request}    1    1
60     ${request}    Set Specific String Filter    ${request}    portA
61     ${resp}    Send Basic Request And Test If Contain X Times    ${request}    network-topology:network-topology/topology/topo:1    <node-id>node:    5
62     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
63     Should Contain X Times    ${resp.content}    <termination-point>    3
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>    1
67     Should Contain X Times    ${node}    <tp-ref>    3
68     Should Contain    ${node}    <tp-ref>/network-topology:network-topology/topology/network-topo:5/node/bgp:21/termination-point/tp:21:2</tp-ref>
69     Should Contain    ${node}    <tp-ref>/network-topology:network-topology/topology/network-topo:5/node/bgp:21/termination-point/tp:21:1</tp-ref>
70     Should Contain    ${node}    <tp-ref>/network-topology:network-topology/topology/network-topo:5/node/bgp:21/termination-point/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>    1
75     Should Contain    ${node}    <tp-ref>/network-topology:network-topology/topology/network-topo:5/node/bgp:22/termination-point/tp:22:1</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>    2
80     Should Contain    ${node}    <tp-ref>/network-topology:network-topology/topology/network-topo:5/node/bgp:24/termination-point/tp:24:1</tp-ref>
81     Should Contain    ${node}    <tp-ref>/network-topology:network-topology/topology/network-topo:5/node/bgp:24/termination-point/tp:24:2</tp-ref>
82
83 Unification Filtration Node Network Topology model
84     [Documentation]    Test unification filtration operation on Network Topology model
85     ${target_field}    Set Variable    l3-unicast-igp-topology:igp-node-attributes/isis-topology:isis-node-attributes/isis-topology:ted/isis-topology:te-router-id-ipv4
86     ${request}    Prepare Unification Filtration Topology Request    ${UNIFICATION_FILTRATION_NT}    network-topology-model    node    ${target_field}    network-topo:4
87     ...    ${target_field}    network-topo:1
88     ${request}    Insert Filter With ID    ${request}    ${FILTER_IPV4}    l3-unicast-igp-topology:igp-node-attributes/isis-topology:isis-node-attributes/isis-topology:ted/isis-topology:te-router-id-ipv4    1
89     ${request}    Insert Apply Filters    ${request}    1    1
90     ${request}    Insert Apply Filters    ${request}    2    1
91     ${request}    Set IPV4 Filter    ${request}    192.168.1.1/24
92     ${resp}    Send Basic Request And Test If Contain X Times    ${request}    network-topology:network-topology/topology/topo:1    <node>    2
93     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
94     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:1']/..
95     ${node}    Element to String    ${node}
96     Should Contain X Times    ${node}    <supporting-node>    2
97     Should Contain X Times    ${node}    <node-ref>bgp:1</node-ref>    1
98     Should Contain X Times    ${node}    <node-ref>bgp:16</node-ref>    1
99     Should Contain X Times    ${node}    <tp-ref>/network-topology/topology/network-topo:1/node/bgp:1/termination-point/tp:1:3</tp-ref>    1
100     Should Contain X Times    ${node}    <tp-ref>/network-topology/topology/network-topo:1/node/bgp:1/termination-point/tp:1:2</tp-ref>    1
101     Should Contain X Times    ${node}    <tp-ref>/network-topology/topology/network-topo:1/node/bgp:1/termination-point/tp:1:1</tp-ref>    1
102     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:2']/..
103     ${node}    Element to String    ${node}
104     Should Contain X Times    ${node}    <supporting-node>    2
105     Should Contain X Times    ${node}    <node-ref>bgp:2</node-ref>    1
106     Should Contain X Times    ${node}    <node-ref>bgp:17</node-ref>    1
107
108 Unification Filtration Node Inventory model
109     [Documentation]    Test unification filtration operation on Inventory model
110     ${request}    Prepare Unification Filtration Topology Request    ${UNIFICATION_FILTRATION_NT}    opendaylight-inventory-model    node    flow-node-inventory:ip-address    openflow-topo:4
111     ...    flow-node-inventory:ip-address    openflow-topo:6
112     ${request}    Insert Filter With ID    ${request}    ${FILTER_IPV4}    flow-node-inventory:ip-address    1
113     ${request}    Insert Apply Filters    ${request}    1    1
114     ${request}    Insert Apply Filters    ${request}    2    1
115     ${request}    Set IPV4 Filter    ${request}    192.168.1.1/24
116     ${resp}    Send Basic Request And Test If Contain X Times    ${request}    network-topology:network-topology/topology/topo:1    <node>    2
117     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
118     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='of-node:26']/..
119     ${node}    Element to String    ${node}
120     Should Contain X Times    ${node}    <node-ref>of-node:26</node-ref>    1
121     Should Contain X Times    ${node}    <node-ref>of-node:16</node-ref>    1
122     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='of-node:28']/..
123     ${node}    Element to String    ${node}
124     Should Contain X Times    ${node}    <node-ref>of-node:28</node-ref>    1