Added termination point test cases to the update suite.
[integration/test.git] / csit / suites / topoprocessing / basic-topology-operations / 070_Underlay_update.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     Test Teardown With Underlay Topologies Refresh    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 Node Update
21     [Documentation]    Test processing of updates using unification operation on Network Topology model
22     #Create the original topology
23     ${request}    Prepare Unification Topology Request    ${UNIFICATION_NT}    network-topology-model    node    network-topo:1    network-topo:2
24     ${request}    Insert Target Field    ${request}    0    l3-unicast-igp-topology:igp-node-attributes/isis-topology:isis-node-attributes/isis-topology:ted/isis-topology:te-router-id-ipv4    0
25     ${request}    Insert Target Field    ${request}    1    l3-unicast-igp-topology:igp-node-attributes/isis-topology:isis-node-attributes/isis-topology:ted/isis-topology:te-router-id-ipv4    0
26     ${resp}    Send Basic Request And Test If Contain X Times    ${request}    network-topology:network-topology/topology/topo:1    <node-id>node:    8
27
28     #Update a node, expecting a unification of two nodes into one
29     ${node}    Create Isis Node    bgp:1    192.168.1.2
30     Basic Request Put    ${node}    network-topology:network-topology/topology/network-topo:1/node/bgp:1
31     ${resp}    Basic Request Get And Test    ${node}    network-topology:network-topology/topology/topo:1    <node-id>node:    7
32     : FOR    ${index}    IN RANGE    1    11
33     \    Should Contain X Times    ${resp.content}    <node-ref>bgp:${index}</node-ref>    1
34     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:2']/..
35     ${node}    Element to String    ${node}
36     Should Contain X Times    ${node}    <node-ref>bgp:2</node-ref>    1
37     Should Contain X Times    ${node}    <node-ref>bgp:1</node-ref>    1
38
39     #Update a unified node, expecting creation of a new overlay node
40     ${node}    Create Isis Node    bgp:3    192.168.3.1
41     Basic Request Put    ${node}    network-topology:network-topology/topology/network-topo:1/node/bgp:3
42     ${resp}    Basic Request Get And Test    ${node}    network-topology:network-topology/topology/topo:1    <node-id>node:    8
43     : FOR    ${index}    IN RANGE    1    11
44     \    Should Contain X Times    ${resp.content}    <node-ref>bgp:${index}</node-ref>    1
45
46 Unification Node Inventory
47     [Documentation]    Test processing of updates using unification operation on Inventory model
48     ${request}    Prepare Unification Topology Request    ${UNIFICATION_NT}    opendaylight-inventory-model    node    openflow-topo:1    openflow-topo:2
49     ${request}    Insert Target Field    ${request}    0    flow-node-inventory:ip-address    0
50     ${request}    Insert Target Field    ${request}    1    flow-node-inventory:ip-address    0
51     ${resp}    Send Basic Request And Test If Contain X Times    ${request}    network-topology:network-topology/topology/topo:1    <node-id>node:    7
52
53     #Update a node, expecting unification of two nodes into one
54     ${node}    Create Openflow Node    openflow:2    192.168.1.1
55
56     Basic Request Put    ${node}    opendaylight-inventory:nodes/node/openflow:2
57     ${resp}    Basic Request Get And Test    ${node}    network-topology:network-topology/topology/topo:1    <node-id>node:    6
58     : FOR    ${index}    IN RANGE    1    11
59     \    Should Contain X Times    ${resp.content}    <node-ref>of-node:${index}</node-ref>    1
60     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='of-node:2']/..
61     ${node}    Element to String    ${node}
62     Should Contain X Times    ${node}    <node-ref>of-node:6</node-ref>    1
63     Should Contain X Times    ${node}    <node-ref>of-node:1</node-ref>    1
64
65     #Update a unified node, expecting creation of a new overlay node
66     ${node}    Create Openflow Node    openflow:4    192.168.3.1
67     Basic Request Put    ${node}    opendaylight-inventory:nodes/node/openflow:4
68     ${resp}    Basic Request Get And Test    ${node}    network-topology:network-topology/topology/topo:1    <node-id>node:    7
69     : FOR    ${index}    IN RANGE    1    11
70     \    Should Contain X Times    ${resp.content}    <node-ref>of-node:${index}</node-ref>    1
71
72 Filtration Range Number Termination Point Update NT
73     [Documentation]    Test processing of updates using range number type of filtration operation on Network Topology model
74     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    termination-point    network-topo:2
75     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ovsdb:ofport
76     ${request}    Set Range Number Filter    ${request}    1115    1119
77     ${resp}    Send Basic Request And Test If Contain X Times    ${request}    network-topology:network-topology/topology/topo:1    <node-id>node:    5
78
79     #Update a previously out-of-range termination point, so it passes filtration
80     ${terminationPoint}    Create OVSDB Termination Point    tp:8:1    1115
81     Basic Request Put    ${terminationPoint}    network-topology:network-topology/topology/network-topo:2/node/bgp:8/termination-point/tp:8:1
82     ${resp}    Basic Request Get And Test    ${terminationPoint}    network-topology:network-topology/topology/topo:1    <node-id>node:    5
83
84     Should Contain X Times    ${resp.content}    <termination-point>    4
85     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:8']/..
86     ${node}    Element to String    ${node}
87     Should Contain X Times    ${node}    <termination-point>    1
88     Should Contain X Times    ${node}    <tp-ref>/network-topology/topology/network-topo:2/node/bgp:8/termination-point/tp:8:1</tp-ref>    1
89
90     #Update a previsouly in-range termination point, so it is filtered out
91     ${terminationPoint}    Create OVSDB Termination Point    tp:7:2    1110
92     Basic Request Put    ${terminationPoint}    network-topology:network-topology/topology/network-topo:2/node/bgp:7/termination-point/tp:7:2
93     ${resp}    Basic Request Get And Test    ${terminationPoint}    network-topology:network-topology/topology/topo:1    <node-id>node:    5
94
95     Should Contain X Times    ${resp.content}    <termination-point>    3
96     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='bgp:7']/..
97     ${node}    Element to String    ${node}
98     Should Contain X Times    ${node}    <termination-point>    1
99     Should Contain X Times    ${node}    <tp-ref>/network-topology/topology/network-topo:2/node/bgp:7/termination-point/tp:7:1</tp-ref>    1
100
101 Filtration Range Number Termination Point Update Inventory
102     [Documentation]    Test processing of updates using range number type of filtration operation on Inventory model
103
104     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    termination-point    openflow-topo:1
105     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    flow-node-inventory:port-number
106     ${request}    Set Range Number Filter    ${request}    2    4
107     ${resp}    Send Basic Request And Test If Contain X Times    ${request}    network-topology:network-topology/topology/topo:1    <node-id>node:    5
108     Should Contain X Times    ${resp.content}    <termination-point>    5
109
110     #Update a previously out-of-range termination point, so it passes filtration
111     ${nodeConnector}    Create Openflow Node Connector    openflow:2:1    3
112     Basic Request Put    ${nodeConnector}    opendaylight-inventory:nodes/node/openflow:2/node-connector/openflow:2:1
113     ${resp}    Basic Request Get And Test    ${nodeConnector}    network-topology:network-topology/topology/topo:1    <node-id>node:    5
114
115     Should Contain X Times    ${resp.content}    <termination-point>    6
116     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='of-node:2']/..
117     ${node}    Element to String    ${node}
118     Should Contain X Times    ${node}    <termination-point>    3
119     Should Contain X Times    ${node}    <tp-ref>/network-topology:network-topology/topology/openflow-topo:1/node/of-node:2/termination-point/tp:3</tp-ref>    1
120     Should Contain X Times    ${node}    <tp-ref>/network-topology:network-topology/topology/openflow-topo:1/node/of-node:2/termination-point/tp:2:2</tp-ref>    1
121     Should Contain X Times    ${node}    <tp-ref>/network-topology:network-topology/topology/openflow-topo:1/node/of-node:2/termination-point/tp:2:1</tp-ref>    1
122
123     #Update an in-range termination point, so it is filtered out
124     ${nodeConnector}    Create Openflow Node Connector    openflow:3:2    5
125     Basic Request Put    ${nodeConnector}    opendaylight-inventory:nodes/node/openflow:3/node-connector/openflow:3:2
126     ${resp}    Basic Request Get And Test    ${nodeConnector}    network-topology:network-topology/topology/topo:1    <node-id>node:    5
127
128     Should Contain X Times    ${resp.content}    <termination-point>    5
129     ${node}    Get Element    ${resp.content}    xpath=.//node/supporting-node[node-ref='of-node:3']/..
130     ${node}    Element to String    ${node}
131     Should Contain X Times    ${node}    <termination-point>    1
132     Should Contain X Times    ${node}    <tp-ref>/network-topology:network-topology/topology/openflow-topo:1/node/of-node:3/termination-point/tp:3:1</tp-ref>    1