Topoprocessing - tests correction
[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    ${request}    network-topology:network-topology/topology/topo:1
27     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
28     Should Contain X Times    ${resp.content}    <node-id>node:    2
29     Should Contain    ${resp.content}    <node-ref>bgp:    3
30     : FOR    ${index}    IN RANGE    18    21
31     \    Should Contain X Times    ${resp.content}    <node-ref>bgp:${index}</node-ref>    1
32     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:18']/..
33     ${node}    Element to String    ${node}
34     Should Contain X Times    ${node}    <supporting-node>    2
35     Should Contain    ${node}    <node-ref>bgp:18</node-ref>
36     Should Contain    ${node}    <node-ref>bgp:20</node-ref>
37
38 Unification Filtration Node Inside Inventory model
39     [Documentation]    Test unification filtration inside operation on Inventory model
40     ${request}    Prepare Unification Filtration Inside Topology Request    ${UNIFICATION_FILTRATION_NT_AGGREGATE_INSIDE}    opendaylight-inventory-model    node    flow-node-inventory:ip-address    openflow-topo:4
41     ${request}    Insert Filter With ID    ${request}    ${FILTER_IPV4}    flow-node-inventory:ip-address    1
42     ${request}    Insert Apply Filters    ${request}    1    1
43     ${request}    Set IPV4 Filter    ${request}    192.168.2.1/24
44     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
45     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
46     Should Contain X Times    ${resp.content}    <node-id>node:    2
47     Should Contain    ${resp.content}    <node-ref>of-node:    4
48     : FOR    ${index}    IN RANGE    17    21
49     \    Should Contain X Times    ${resp.content}    <node-ref>of-node:${index}</node-ref>    1
50     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='of-node:17']/..
51     ${node}    Element to String    ${node}
52     Should Contain X Times    ${node}    <supporting-node>    3
53     Should Contain    ${node}    <node-ref>of-node:17</node-ref>
54     Should Contain    ${node}    <node-ref>of-node:19</node-ref>
55     Should Contain    ${node}    <node-ref>of-node:20</node-ref>
56
57 Unification Filtration Termination Point Inside Network Topology model
58     [Documentation]    Test unification filtration inside operation on Network Topology model
59     ${request}    Prepare Unification Filtration Inside Topology Request    ${UNIFICATION_FILTRATION_NT_AGGREGATE_INSIDE}    network-topology-model    termination-point    ovsdb:name    network-topo:5
60     ${request}    Insert Filter With ID    ${request}    ${FILTER_SPECIFIC_STRING}    ovsdb:name    1
61     ${request}    Insert Apply Filters    ${request}    1    1
62     ${request}    Set Specific String Filter    ${request}    portA
63     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
64     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
65     Should Contain X Times    ${resp.content}    <node-id>node:    5
66     Should Contain X Times    ${resp.content}    <termination-point>    4
67     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:21']/..
68     ${node}    Element to String    ${node}
69     Should Contain X Times    ${node}    <termination-point>    2
70     ${tp}    Get Element    ${node}    xpath=.//termination-point/supporting-termin-point[tp-ref='tp:21:2']/..
71     ${tp}    Element to String    ${tp}
72     Should Contain X Times    ${tp}    <tp-ref>tp:    2
73     Should Contain    ${tp}    <tp-ref>tp:21:3</tp-ref>
74     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:22']/..
75     ${node}    Element to String    ${node}
76     Should Contain X Times    ${node}    <termination-point>    1
77     Should Contain X Times    ${node}    <tp-ref>tp:    1
78     Should Contain    ${node}    <tp-ref>tp:22:2</tp-ref>
79     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:24']/..
80     ${node}    Element to String    ${node}
81     Should Contain X Times    ${node}    <termination-point>    1
82     Should Contain X Times    ${node}    <tp-ref>tp:    3
83     Should Contain    ${node}    <tp-ref>tp:24:1</tp-ref>
84     Should Contain    ${node}    <tp-ref>tp:24:2</tp-ref>
85     Should Contain    ${node}    <tp-ref>tp:24:3</tp-ref>
86
87 Unification Filtration Node Network Topology model
88     [Documentation]    Test unification filtration operation on Network Topology model
89     ${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
90     ${request}    Prepare Unification Filtration Topology Request    ${UNIFICATION_FILTRATION_NT}    network-topology-model    node    ${target_field}    network-topo:4
91     ...    ${target_field}    network-topo:1
92     ${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
93     ${request}    Insert Apply Filters    ${request}    1    1
94     ${request}    Insert Apply Filters    ${request}    2    1
95     ${request}    Set IPV4 Filter    ${request}    192.168.1.1/24
96     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
97     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
98     Should Contain X Times    ${resp.content}    <node>    2
99     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:1']/..
100     ${node}    Element to String    ${node}
101     Should Contain X Times    ${node}    <supporting-node>    2
102     Should Contain X Times    ${node}    <node-ref>bgp:1</node-ref>    1
103     Should Contain X Times    ${node}    <node-ref>bgp:16</node-ref>    1
104     Should Contain X Times    ${node}    <tp-ref>/network-topology/topology/network-topo:1/node/bgp:1/termination-point/tp:1:3</tp-ref>    1
105     Should Contain X Times    ${node}    <tp-ref>/network-topology/topology/network-topo:1/node/bgp:1/termination-point/tp:1:2</tp-ref>    1
106     Should Contain X Times    ${node}    <tp-ref>/network-topology/topology/network-topo:1/node/bgp:1/termination-point/tp:1:1</tp-ref>    1
107     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:2']/..
108     ${node}    Element to String    ${node}
109     Should Contain X Times    ${node}    <supporting-node>    2
110     Should Contain X Times    ${node}    <node-ref>bgp:2</node-ref>    1
111     Should Contain X Times    ${node}    <node-ref>bgp:17</node-ref>    1
112
113 Unification Filtration Node Inventory model
114     [Documentation]    Test unification filtration operation on Inventory model
115     ${request}    Prepare Unification Filtration Topology Request    ${UNIFICATION_FILTRATION_NT}    opendaylight-inventory-model    node    flow-node-inventory:ip-address    openflow-topo:4
116     ...    flow-node-inventory:ip-address    openflow-topo:6
117     ${request}    Insert Filter With ID    ${request}    ${FILTER_IPV4}    flow-node-inventory:ip-address    1
118     ${request}    Insert Apply Filters    ${request}    1    1
119     ${request}    Insert Apply Filters    ${request}    2    1
120     ${request}    Set IPV4 Filter    ${request}    192.168.1.1/24
121     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
122     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
123     Should Contain X Times    ${resp.content}    <node>    2
124     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='of-node:26']/..
125     ${node}    Element to String    ${node}
126     Should Contain X Times    ${node}    <node-ref>of-node:26</node-ref>    1
127     Should Contain X Times    ${node}    <node-ref>of-node:16</node-ref>    1
128     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='of-node:28']/..
129     ${node}    Element to String    ${node}
130     Should Contain X Times    ${node}    <node-ref>of-node:28</node-ref>    1