From cb23903a9f19f573dba91d7120d91483225c0eef Mon Sep 17 00:00:00 2001 From: Martin Dindoffer Date: Tue, 7 Jun 2016 11:06:28 +0200 Subject: [PATCH] Added node unification test cases to the update suite Change-Id: I7315b40b0c7562a9e67596819015e542f53db298 Signed-off-by: Martin Dindoffer Signed-off-by: Martin Dindoffer --- csit/libraries/TopoprocessingKeywords.robot | 16 +++++ .../070_Underlay_update.robot | 70 +++++++++++++++++++ .../topoprocessing/TopologyRequests.py | 18 +++++ 3 files changed, 104 insertions(+) create mode 100644 csit/suites/topoprocessing/basic-topology-operations/070_Underlay_update.robot diff --git a/csit/libraries/TopoprocessingKeywords.robot b/csit/libraries/TopoprocessingKeywords.robot index 71208a71f8..46e9faa8f7 100644 --- a/csit/libraries/TopoprocessingKeywords.robot +++ b/csit/libraries/TopoprocessingKeywords.robot @@ -272,3 +272,19 @@ Insert Scripting into Request ${request} Set Element Text ${request} ${language} xpath=.//correlation/aggregation/scripting/language ${request} Element to String ${request} [Return] ${request} + +Create Isis Node + [Arguments] ${node-id} ${router-id-ipv4} + [Documentation] Create an isis node element with id and ip + ${request} Set Element Text ${NODE_ISIS} ${node-id} xpath=.//node-id + ${request} Set Element Text ${request} ${router-id-ipv4} xpath=.//igp-node-attributes/isis-node-attributes/ted/te-router-id-ipv4 + ${request} Element to String ${request} + [Return ] ${request} + +Create Openflow Node + [Arguments] ${node-id} ${ip-address} + [Documentation] Create an Openflow node element with id and ip + ${request} Set Element Text ${NODE_OPENFLOW} ${node-id} xpath=.//id + ${request} Set Element Text ${request} ${ip-address} xpath=.//ip-address + ${request} Element to String ${request} + [Return ] ${request} \ No newline at end of file diff --git a/csit/suites/topoprocessing/basic-topology-operations/070_Underlay_update.robot b/csit/suites/topoprocessing/basic-topology-operations/070_Underlay_update.robot new file mode 100644 index 0000000000..975132c471 --- /dev/null +++ b/csit/suites/topoprocessing/basic-topology-operations/070_Underlay_update.robot @@ -0,0 +1,70 @@ +*** Settings *** +Documentation Test suite to verify unification operation on different models. +... Before test starts, configurational file have to be rewriten to change listners registration datastore type from CONFIG_API to OPERATIONAL_API. +... Need for this change is also a reason why main feature (odl-topoprocessing-framework) is installed after file change and not during boot. +... Suite setup also install features required for tested models, clear karaf logs for further synchronization. Tests themselves send configurational +... 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. +Suite Setup Setup Environment +Suite Teardown Clean Environment +Test Teardown Test Teardown network-topology:network-topology/topology/topo:1 +Library RequestsLibrary +Library SSHLibrary +Library XML +Variables ../../../variables/topoprocessing/TopologyRequests.py +Variables ../../../variables/Variables.py +Resource ../../../libraries/KarafKeywords.robot +Resource ../../../libraries/Utils.robot +Resource ../../../libraries/TopoprocessingKeywords.robot + +*** Test Cases *** +Unification Node Update + [Documentation] Test processing of updates using unification operation on Network Topology model + #Create the original topology + ${request} Prepare Unification Topology Request ${UNIFICATION_NT} network-topology-model node network-topo:1 network-topo:2 + ${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 + ${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 + ${resp} Send Basic Request And Test If Contain X Times ${request} network-topology:network-topology/topology/topo:1 node: 8 + + #Update a node, expecting a unification of two nodes into one + ${node} Create Isis Node bgp:1 192.168.1.2 + Basic Request Put ${node} network-topology:network-topology/topology/network-topo:1/node/bgp:1 + ${resp} Basic Request Get And Test ${node} network-topology:network-topology/topology/topo:1 node: 7 + : FOR ${index} IN RANGE 1 11 + \ Should Contain X Times ${resp.content} bgp:${index} 1 + ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='bgp:2']/.. + ${node} Element to String ${node} + Should Contain X Times ${node} bgp:2 1 + Should Contain X Times ${node} bgp:1 1 + + #Update a unified node, expecting creation of a new overlay node + ${node} Create Isis Node bgp:3 192.168.3.1 + Basic Request Put ${node} network-topology:network-topology/topology/network-topo:1/node/bgp:3 + ${resp} Basic Request Get And Test ${node} network-topology:network-topology/topology/topo:1 node: 8 + : FOR ${index} IN RANGE 1 11 + \ Should Contain X Times ${resp.content} bgp:${index} 1 + +Unification Node Inventory + [Documentation] Test processing of updates using unification operation on Inventory model + ${request} Prepare Unification Topology Request ${UNIFICATION_NT} opendaylight-inventory-model node openflow-topo:1 openflow-topo:2 + ${request} Insert Target Field ${request} 0 flow-node-inventory:ip-address 0 + ${request} Insert Target Field ${request} 1 flow-node-inventory:ip-address 0 + ${resp} Send Basic Request And Test If Contain X Times ${request} network-topology:network-topology/topology/topo:1 node: 7 + + #Update a node, expecting unification of two nodes into one + ${node} Create Openflow Node openflow:2 192.168.1.1 + + Basic Request Put ${node} opendaylight-inventory:nodes/node/openflow:2 + ${resp} Basic Request Get And Test ${node} network-topology:network-topology/topology/topo:1 node: 6 + : FOR ${index} IN RANGE 1 11 + \ Should Contain X Times ${resp.content} of-node:${index} 1 + ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='of-node:2']/.. + ${node} Element to String ${node} + Should Contain X Times ${node} of-node:6 1 + Should Contain X Times ${node} of-node:1 1 + + #Update a unified node, expecting creation of a new overlay node + ${node} Create Openflow Node openflow:4 192.168.3.1 + Basic Request Put ${node} opendaylight-inventory:nodes/node/openflow:4 + ${resp} Basic Request Get And Test ${node} network-topology:network-topology/topology/topo:1 node: 7 + : FOR ${index} IN RANGE 1 11 + \ Should Contain X Times ${resp.content} of-node:${index} 1 \ No newline at end of file diff --git a/csit/variables/topoprocessing/TopologyRequests.py b/csit/variables/topoprocessing/TopologyRequests.py index 79b65a3f2d..e29767a1a7 100644 --- a/csit/variables/topoprocessing/TopologyRequests.py +++ b/csit/variables/topoprocessing/TopologyRequests.py @@ -245,3 +245,21 @@ LINK_COMPUTATION = ''' + {node-id} + + + + {router-id-ipv4} + + + + ''' + +NODE_OPENFLOW = ''' + {node-id} + {ip-address} + ''' -- 2.36.6