From: Samuel Kontriš Date: Fri, 27 Nov 2015 13:08:12 +0000 (+0100) Subject: Basic tests - Unification Scripting Node X-Git-Tag: release/beryllium-sr1~260 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=integration%2Ftest.git;a=commitdiff_plain;h=613f0f2894a1f983eb18f8548c83e002b61dd7c6 Basic tests - Unification Scripting Node Change-Id: I11c597d1fb932f3353c4f3096642fd46bf7b4e91 Signed-off-by: Samuel Kontriš --- diff --git a/csit/libraries/TopoprocessingKeywords.robot b/csit/libraries/TopoprocessingKeywords.robot index 476a5fa08e..a52e478dcc 100644 --- a/csit/libraries/TopoprocessingKeywords.robot +++ b/csit/libraries/TopoprocessingKeywords.robot @@ -126,3 +126,12 @@ Get Installed Features Log Installed features: Log ${features} [Return] ${features} + +Insert Scripting into Request + [Arguments] ${request} ${language} ${script} + [Documentation] Insert Scripting into Request under aggregation node + ${request} Add Element ${request} ${SCRIPTING} xpath=.//correlation/aggregation + ${request} Set Element Text ${request} ${script} xpath=.//correlation/aggregation/scripting/script + ${request} Set Element Text ${request} ${language} xpath=.//correlation/aggregation/scripting/language + ${request} Element to String ${request} + [Return] ${request} diff --git a/csit/suites/topoprocessing/basic-topology-operations/010_Aggregation.robot b/csit/suites/topoprocessing/basic-topology-operations/010_Aggregation.robot index f8e441e862..92e7537f16 100644 --- a/csit/suites/topoprocessing/basic-topology-operations/010_Aggregation.robot +++ b/csit/suites/topoprocessing/basic-topology-operations/010_Aggregation.robot @@ -48,3 +48,33 @@ Unification Node Inventory ${node} Element to String ${node} Should Contain X Times ${node} of-node:10 1 Should Contain X Times ${node} of-node:4 1 + +Unification Scripting Node + [Documentation] Test unification operation on Network Topology model using scripting + ${request} Prepare Unification Topology Request ${UNIFICATION_NT} network-topology-model node network-topology-pcep:path-computation-client/network-topology-pcep:ip-address network-topo:1 + ... network-topo:2 + ${request} Insert Scripting into Request ${request} javascript if (originalItem.getLeafNode().getValue().indexOf("192.168.1.1") > -1 && newItem.getLeafNode().getValue().indexOf("192.168.1.3") > -1 || originalItem.getLeafNode().getValue().indexOf("192.168.1.3") > -1 && newItem.getLeafNode().getValue().indexOf("192.168.1.1") > -1) {aggregable.setResult(true);} else { aggregable.setResult(false);} + ${resp} Send Basic Request ${request} network-topology:network-topology/topology/topo:1 + Should Contain ${resp.content} topo:1 + Should Contain X Times ${resp.content} node: 9 + : FOR ${index} IN RANGE 1 10 + \ Should Contain X Times ${resp.content} pcep:${index} 1 + ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='pcep:1']/.. + ${node} Element to String ${node} + Should Contain X Times ${node} pcep:1 1 + Should Contain X Times ${node} pcep:6 1 + +Unification Scripting Node Inventory + [Documentation] Test unification operation on inventory model using scripting + ${request} Prepare Unification Topology Request ${UNIFICATION_NT} opendaylight-inventory-model node flow-node-inventory:ip-address openflow-topo:1 + ... openflow-topo:2 + ${request} Insert Scripting into Request ${request} javascript if (originalItem.getLeafNode().getValue().indexOf("192.168.1.2") > -1 && newItem.getLeafNode().getValue().indexOf("192.168.1.4") > -1 || originalItem.getLeafNode().getValue().indexOf("192.168.1.4") > -1 && newItem.getLeafNode().getValue().indexOf("192.168.1.2") > -1) {aggregable.setResult(true);} else { aggregable.setResult(false);} + ${resp} Send Basic Request ${request} network-topology:network-topology/topology/topo:1 + Should Contain ${resp.content} topo:1 + Should Contain X Times ${resp.content} node: 9 + : FOR ${index} IN RANGE 1 10 + \ 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:2 1 + Should Contain X Times ${node} of-node:8 1 diff --git a/csit/variables/topoprocessing/TopologyRequests.py b/csit/variables/topoprocessing/TopologyRequests.py index 163f0de801..03a459a49b 100644 --- a/csit/variables/topoprocessing/TopologyRequests.py +++ b/csit/variables/topoprocessing/TopologyRequests.py @@ -62,6 +62,15 @@ FILTRATION_NT = ''' ''' +SCRIPTING = ''' + + {language} + + +''' + FILTER_IPV4 = ''' {input-model} 1