From: Jamo Luhrsen Date: Tue, 23 Sep 2014 20:07:44 +0000 (-0700) Subject: large rework to optimize test code. X-Git-Tag: release/helium~6^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=51853d758e27a4034f5139d7b695e012db75f781;p=integration%2Ftest.git large rework to optimize test code. removed lots of sleeps in favor of "Wait Until Keyword Succeeds" (WUKS) calls moved common functionality in to higher level keywords in the new Utils.txt resource Change stats for performance from 30s to 60s Change-Id: Iab144bfb46c9789bbb0d8a9bc2e27eb57082881e Signed-off-by: Jamo Luhrsen --- diff --git a/test/csit/libraries/Utils.txt b/test/csit/libraries/Utils.txt new file mode 100644 index 0000000000..cfd7a0d0aa --- /dev/null +++ b/test/csit/libraries/Utils.txt @@ -0,0 +1,86 @@ +*** Settings *** +Library SSHLibrary + +*** Variables *** +${start} sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,1 --switch ovsk,protocols=OpenFlow13 + +*** Keywords *** +Start Suite + [Documentation] Basic setup/cleanup work that can be done safely before any system + ... is run. + Log Start the test on the base edition + Open Connection ${MININET} prompt=> timeout=30s + Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any + Write sudo ovs-vsctl set-manager ptcp:6644 + Write sudo mn -c + Read Until > + Write ${start} + Read Until mininet> + +Stop Suite + [Documentation] Cleanup/Shutdown work that should be done at the completion of all + ... tests + Log Stop the test on the base edition + Read + Write exit + Read Until > + Close Connection + +Ensure All Nodes Are In Response + [Arguments] ${URI} ${node_list} + [Documentation] A GET is made to the supplied ${URI} and every item in the ${node_list} + ... is verified to exist in the repsonse. This keyword currently implies that it's node + ... specific but any list of strings can be given in ${node_list}. Refactoring of this + ... to make it more generic should be done. (see keyword "Check For Elements At URI") + : FOR ${node} IN @{node_list} + \ ${resp} Get session ${URI} + \ Should Be Equal As Strings ${resp.status_code} 200 + \ Should Contain ${resp.content} ${node} + +Check Nodes Stats + [Arguments] ${node} + [Documentation] A GET on the /node/${node} API is made and specific flow stat + ... strings are checked for existence. + ${resp} Get session ${REST_CONTEXT}/node/${node} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} flow-capable-node-connector-statistics + Should Contain ${resp.content} flow-table-statistics + +Check That Port Count Is Ok + [Arguments] ${node} ${count} + [Documentation] A GET on the /port API is made and the specified port ${count} is + ... verified. A more generic Keyword "Check For Specific Number Of Elements At URI" + ... also does this work and further consolidation should be done. + ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/port + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain X Times ${resp.content} ${node} ${count} + +Check For Specific Number Of Elements At URI + [Arguments] ${uri} ${element} ${expected_count} + [Documentation] A GET is made to the specified ${URI} and the specific count of a + ... given element is done (as supplied by ${element} and ${expected_count}) + ${resp} Get session ${uri} + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain X Times ${resp.content} ${element} ${expected_count} + +Check For Elements At URI + [Arguments] ${uri} ${elements} + [Documentation] A GET is made at the supplied ${URI} and every item in the list of + ... ${elements} is verified to exist in the response + ${resp} Get session ${uri} + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 + : FOR ${i} IN @{elements} + \ Should Contain ${resp.content} ${i} + +Check For Elements Not At URI + [Arguments] ${uri} ${elements} + [Documentation] A GET is made at the supplied ${URI} and every item in the list of + ... ${elements} is verified to NOT exist in the response + ${resp} Get session ${uri} + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 + : FOR ${i} IN @{elements} + \ Should Not Contain ${resp.content} ${i} diff --git a/test/csit/suites/karaf-compatible/010__MD_SAL_NSF/010__restconf_inventory.txt b/test/csit/suites/karaf-compatible/010__MD_SAL_NSF/010__restconf_inventory.txt index ab87a8961a..14e38554c9 100644 --- a/test/csit/suites/karaf-compatible/010__MD_SAL_NSF/010__restconf_inventory.txt +++ b/test/csit/suites/karaf-compatible/010__MD_SAL_NSF/010__restconf_inventory.txt @@ -1,46 +1,42 @@ *** Settings *** Documentation Test suite for RESTCONF inventory -Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML} +Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML} Suite Teardown Delete All Sessions Library Collections Library ../../../libraries/RequestsLibrary.py Library ../../../libraries/Common.py Variables ../../../variables/Variables.py +Resource ../../../libraries/Utils.txt *** Variables *** ${REST_CONTEXT} /restconf/operational/opendaylight-inventory:nodes +@{node_list} openflow:1 openflow:2 openflow:3 -*** Test Cases *** +*** Test Cases *** Get list of nodes [Documentation] Get the inventory - ${resp} Get session ${REST_CONTEXT} - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} openflow:1 - Should Contain ${resp.content} openflow:2 - Should Contain ${resp.content} openflow:3 - + Log ${start} + Wait Until Keyword Succeeds 30s 2s Ensure All Nodes Are In Response ${REST_CONTEXT} ${node_list} + Get nodeconnector for a node 1 [Documentation] Get the inventory for a node - ${resp} Get session ${REST_CONTEXT}/node/openflow:1 - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} openflow:1:1 - Should Contain ${resp.content} openflow:1:2 + ${resp} Get session ${REST_CONTEXT}/node/openflow:1 + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} openflow:1:1 + Should Contain ${resp.content} openflow:1:2 Get nodeconnector for a node 2 [Documentation] Get the inventory for a node - ${resp} Get session ${REST_CONTEXT}/node/openflow:2 - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} openflow:2:1 - Should Contain ${resp.content} openflow:2:2 - Should Contain ${resp.content} openflow:2:3 + ${resp} Get session ${REST_CONTEXT}/node/openflow:2 + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} openflow:2:1 + Should Contain ${resp.content} openflow:2:2 + Should Contain ${resp.content} openflow:2:3 Get nodeconnector for a node 3 [Documentation] Get the inventory for a node - ${resp} Get session ${REST_CONTEXT}/node/openflow:3 - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} openflow:3:1 - Should Contain ${resp.content} openflow:3:2 - Should Contain ${resp.content} openflow:3:3 - - - + ${resp} Get session ${REST_CONTEXT}/node/openflow:3 + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} openflow:3:1 + Should Contain ${resp.content} openflow:3:2 + Should Contain ${resp.content} openflow:3:3 diff --git a/test/csit/suites/karaf-compatible/010__MD_SAL_NSF/020__restconf_statistics.txt b/test/csit/suites/karaf-compatible/010__MD_SAL_NSF/020__restconf_statistics.txt index 17c33c0f94..162542ad80 100644 --- a/test/csit/suites/karaf-compatible/010__MD_SAL_NSF/020__restconf_statistics.txt +++ b/test/csit/suites/karaf-compatible/010__MD_SAL_NSF/020__restconf_statistics.txt @@ -1,33 +1,27 @@ *** Settings *** Documentation Test suite for RESTCONF statistics -Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML} +Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML} Suite Teardown Delete All Sessions Library Collections Library ../../../libraries/RequestsLibrary.py Library ../../../libraries/Common.py Variables ../../../variables/Variables.py +Resource ../../../libraries/Utils.txt *** Variables *** ${REST_CONTEXT} /restconf/operational/opendaylight-inventory:nodes +@{node_list} openflow:1 openflow:2 openflow:3 -*** Test Cases *** +*** Test Cases *** Get Stats for node 1 [Documentation] Get the stats for a node - ${resp} Get session ${REST_CONTEXT}/node/openflow:1 - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} flow-capable-node-connector-statistics - Should Contain ${resp.content} flow-table-statistics + Wait Until Keyword Succeeds 30s 2s Ensure All Nodes Are In Response ${REST_CONTEXT} ${node_list} + Wait Until Keyword Succeeds 30s 2s Check Nodes Stats openflow:1 Get Stats for node 2 [Documentation] Get the stats for a node - ${resp} Get session ${REST_CONTEXT}/node/openflow:2 - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} flow-capable-node-connector-statistics - Should Contain ${resp.content} flow-table-statistics + Wait Until Keyword Succeeds 30s 2s Check Nodes Stats openflow:2 Get Stats for node 3 [Documentation] Get the stats for a node - ${resp} Get session ${REST_CONTEXT}/node/openflow:3 - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} flow-capable-node-connector-statistics - Should Contain ${resp.content} flow-table-statistics + Wait Until Keyword Succeeds 30s 2s Check Nodes Stats openflow:3 diff --git a/test/csit/suites/karaf-compatible/010__MD_SAL_NSF/030__restconf_topology.txt b/test/csit/suites/karaf-compatible/010__MD_SAL_NSF/030__restconf_topology.txt index b4e3495f54..6feb9dacbb 100644 --- a/test/csit/suites/karaf-compatible/010__MD_SAL_NSF/030__restconf_topology.txt +++ b/test/csit/suites/karaf-compatible/010__MD_SAL_NSF/030__restconf_topology.txt @@ -1,18 +1,20 @@ *** Settings *** -Documentation Test suite for RESTCONF Topology -Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} +Documentation Test suite for RESTCONF Topology +Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} Suite Teardown Delete All Sessions Library Collections Library ../../../libraries/RequestsLibrary.py Library ../../../libraries/Common.py Variables ../../../variables/Variables.py +Resource ../../../libraries/Utils.txt *** Variables *** -${topology1} "flow:1" -${node1} "openflow:1" -${node2} "openflow:2" -${node3} "openflow:3" -${key} link +${topology1} "flow:1" +${node1} "openflow:1" +${node2} "openflow:2" +${node3} "openflow:3" +@{node_list} openflow:1 openflow:2 openflow:3 +${key} link ${REST_CONTEXT_1} /restconf/operational/network-topology:network-topology ${REST_CONTEXT_2} /restconf/operational/network-topology:network-topology/topology/flow:1 ${REST_CONTEXT_3} /restconf/config/network-topology:network-topology/topology/flow:1/link/userlink @@ -21,45 +23,39 @@ ${REST_CONTEXT_3} /restconf/config/network-topology:network-topology/topology Get RESTCONF Topology [Documentation] Get RESTCONF Topology and validate the result. [Tags] get + Wait Until Keyword Succeeds 30s 2s Ensure All Nodes Are In Response ${REST_CONTEXT_1} ${node_list} ${resp} Get session ${REST_CONTEXT_1} - Should Be Equal As Strings ${resp.status_code} 200 + Should Be Equal As Strings ${resp.status_code} 200 Log ${resp.content} - Should Contain ${resp.content} ${topology1} - + Should Contain ${resp.content} ${topology1} + List all the links [Documentation] List all the links in the topology. [Tags] get ${body1} Create Dictionary dest-node=openflow:1 dest-tp=openflow:1:2 ${body2} Create Dictionary source-node=openflow:3 source-tp=openflow:3:3 - ${link2} Create Dictionary link-id=openflow:3:3 destination=${body1} source=${body2} + ${link2} Create Dictionary link-id=openflow:3:3 destination=${body1} source=${body2} ${body1} Create Dictionary dest-node=openflow:1 dest-tp=openflow:1:1 ${body2} Create Dictionary source-node=openflow:2 source-tp=openflow:2:3 - ${link1} Create Dictionary link-id=openflow:2:3 destination=${body1} source=${body2} + ${link1} Create Dictionary link-id=openflow:2:3 destination=${body1} source=${body2} ${body1} Create Dictionary dest-node=openflow:3 dest-tp=openflow:3:3 ${body2} Create Dictionary source-node=openflow:1 source-tp=openflow:1:2 - ${link4} Create Dictionary link-id=openflow:1:2 destination=${body1} source=${body2} + ${link4} Create Dictionary link-id=openflow:1:2 destination=${body1} source=${body2} ${body1} Create Dictionary dest-node=openflow:2 dest-tp=openflow:2:3 ${body2} Create Dictionary source-node=openflow:1 source-tp=openflow:1:1 - ${link3} Create Dictionary link-id=openflow:1:1 destination=${body1} source=${body2} - ${links} Create List ${link1} ${link2} ${link3} ${link4} - ${resp} Get session ${REST_CONTEXT_2} - Should Be Equal As Strings ${resp.status_code} 200 - ${result} To JSON ${resp.content} - ${content} Get From Dictionary ${result} topology - ${topology} Get From List ${content} 0 - ${link} Get From Dictionary ${topology} link - Sort List ${link} - Lists Should be Equal ${link} ${links} + ${link3} Create Dictionary link-id=openflow:1:1 destination=${body1} source=${body2} + ${links} Create List ${link1} ${link2} ${link3} ${link4} + Wait Until Keyword Succeeds 30s 2s Verify Links ${links} Add a link [Documentation] Add a link, list to validate the result. [Tags] add - ${body1} Create Dictionary dest-node=openflow:3 dest-tp=openflow:3:1 - ${body2} Create Dictionary source-node=openflow:2 source-tp=openflow:2:1 - ${body3} Create Dictionary link-id=userlink destination=${body1} source=${body2} + ${body1} Create Dictionary dest-node=openflow:3 dest-tp=openflow:3:1 + ${body2} Create Dictionary source-node=openflow:2 source-tp=openflow:2:1 + ${body3} Create Dictionary link-id=userlink destination=${body1} source=${body2} ${links} Create List ${body3} ${body} Create Dictionary link=${links} - ${resp} Put session ${REST_CONTEXT_3} data=${body} + ${resp} Put session ${REST_CONTEXT_3} data=${body} Should Be Equal As Strings ${resp.status_code} 200 ${resp} Get session ${REST_CONTEXT_3} Should Be Equal As Strings ${resp.status_code} 200 @@ -67,11 +63,24 @@ Add a link ${link} Get From Dictionary ${result} link Lists Should be Equal ${link} ${links} - Remove a link [Documentation] Remove a link, list to validate the result. [Tags] remove - ${resp} Delete session ${REST_CONTEXT_3} + ${resp} Delete session ${REST_CONTEXT_3} Should Be Equal As Strings ${resp.status_code} 200 ${resp} Get session ${REST_CONTEXT_3} Should Be Equal As Strings ${resp.status_code} 404 + +*** Keywords *** +Verify Links + [Arguments] ${expected_links} + ${resp} Get session ${REST_CONTEXT_2} + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 + ${result} To JSON ${resp.content} + Log ${result} + ${content} Get From Dictionary ${result} topology + ${topology} Get From List ${content} 0 + ${link} Get From Dictionary ${topology} link + Sort List ${link} + Lists Should be Equal ${link} ${expected_links} diff --git a/test/csit/suites/karaf-compatible/010__MD_SAL_NSF/040__restconf_frm.txt b/test/csit/suites/karaf-compatible/010__MD_SAL_NSF/040__restconf_frm.txt index a4d4cfd839..1e8ce38242 100644 --- a/test/csit/suites/karaf-compatible/010__MD_SAL_NSF/040__restconf_frm.txt +++ b/test/csit/suites/karaf-compatible/010__MD_SAL_NSF/040__restconf_frm.txt @@ -1,60 +1,54 @@ *** Settings *** Documentation Test suite for RESTCONF FRM -Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML} +Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML} Suite Teardown Delete All Sessions Library Collections Library ../../../libraries/RequestsLibrary.py Library ../../../libraries/Common.py Variables ../../../variables/Variables.py +Resource ../../../libraries/Utils.txt *** Variables *** +${REST_CON} /restconf/config/opendaylight-inventory:nodes +${REST_OPR} /restconf/operational/opendaylight-inventory:nodes +${BODY2} 2Foo204810.0.20.1/32152000openflow:1:1 -${REST_CON} /restconf/config/opendaylight-inventory:nodes -${REST_OPR} /restconf/operational/opendaylight-inventory:nodes -${BODY2} 2Foo204810.0.20.1/32152000openflow:1:1 - -*** Test Cases *** - +*** Test Cases *** Add a flow - Output to physical port# [Documentation] Push a flow through REST-API - [Tags] Push - ${resp} Putxml session ${REST_CON}/node/openflow:1/table/0/flow/152 data=${BODY2} + [Tags] Push + ${resp} Putxml session ${REST_CON}/node/openflow:1/table/0/flow/152 data=${BODY2} Should Be Equal As Strings ${resp.status_code} 200 Verify after adding flow config - Output to physical port# [Documentation] Verify the flow - [Tags] Get - ${resp} Get session ${REST_CON}/node/openflow:1/table/0 - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} 152 - + [Tags] Get + ${resp} Get session ${REST_CON}/node/openflow:1/table/0 + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} 152 + Verify after adding flow operational - Output to physical port# [Documentation] Verify the flow - [Tags] Get - Sleep 30 - ${resp} Get session ${REST_OPR}/node/openflow:1/table/0 - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} 10.0.20.1 + [Tags] Get + ${elements}= Create List 10.0.20.1 + Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_OPR}/node/openflow:1/table/0 ${elements} Remove a flow - Output to physical port# [Documentation] Remove a flow [Tags] remove - ${resp} Delete session ${REST_CON}/node/openflow:1/table/0/flow/152 + ${resp} Delete session ${REST_CON}/node/openflow:1/table/0/flow/152 Should Be Equal As Strings ${resp.status_code} 200 Verify after deleting flow config - Output to physical port# [Documentation] Verify the flow - [Tags] Get - ${resp} Get session ${REST_CON}/node/openflow:1/table/0 + [Tags] Get + ${resp} Get session ${REST_CON}/node/openflow:1/table/0 Should Be Equal As Strings ${resp.status_code} 200 - Should Not Contain ${resp.content} 152 + Should Not Contain ${resp.content} 152 + # Standing bug #368 - This has been fixed -# Standing bug #368 - This has been fixed Verify after deleting flow operational - Output to physical port# [Documentation] Verify the flow - [Tags] Get - Sleep 40 - ${resp} Get session ${REST_OPR}/node/openflow:1/table/0 - Should Be Equal As Strings ${resp.status_code} 200 - Should Not Contain ${resp.content} 10.0.20.1 - + [Tags] Get + ${elements}= Create List 10.0.20.1 + Wait Until Keyword Succeeds 40s 2s Check For Elements Not At URI ${REST_OPR}/node/openflow:1/table/0 ${elements} diff --git a/test/csit/suites/karaf-compatible/010__MD_SAL_NSF/__init__.txt b/test/csit/suites/karaf-compatible/010__MD_SAL_NSF/__init__.txt index ea644f144e..c8f389ca71 100644 --- a/test/csit/suites/karaf-compatible/010__MD_SAL_NSF/__init__.txt +++ b/test/csit/suites/karaf-compatible/010__MD_SAL_NSF/__init__.txt @@ -2,26 +2,8 @@ Documentation Test suite for MD-SAL NSF Suite Setup Start Suite Suite Teardown Stop Suite -Library SSHLibrary +Library SSHLibrary +Resource ../../../libraries/Utils.txt *** Variables *** -${start}= sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 - -** Keywords *** -Start Suite - Log Start mininet - Open Connection ${MININET} prompt=> - Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any - Write sudo ovs-vsctl set-manager ptcp:6644 - Write sudo mn -c - Sleep 2 - Write ${start} - Sleep 30 - Read -Stop Suite - Log Stop mininet - Read - Write exit - Sleep 6 - Read - Close Connection +${start} sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 diff --git a/test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/010__restconf_inventory.txt b/test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/010__restconf_inventory.txt index ab87a8961a..bb7c8207c5 100644 --- a/test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/010__restconf_inventory.txt +++ b/test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/010__restconf_inventory.txt @@ -1,46 +1,42 @@ *** Settings *** Documentation Test suite for RESTCONF inventory -Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML} +Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML} Suite Teardown Delete All Sessions Library Collections Library ../../../libraries/RequestsLibrary.py Library ../../../libraries/Common.py Variables ../../../variables/Variables.py +Resource ../../../libraries/Utils.txt *** Variables *** ${REST_CONTEXT} /restconf/operational/opendaylight-inventory:nodes +@{node_list} openflow:1 openflow:2 openflow:3 -*** Test Cases *** +*** Test Cases *** Get list of nodes [Documentation] Get the inventory - ${resp} Get session ${REST_CONTEXT} - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} openflow:1 - Should Contain ${resp.content} openflow:2 - Should Contain ${resp.content} openflow:3 - + ${resp} Get session ${REST_CONTEXT} + Wait Until Keyword Succeeds 30s 2s Ensure All Nodes Are In Response ${REST_CONTEXT} ${node_list} + Get nodeconnector for a node 1 [Documentation] Get the inventory for a node - ${resp} Get session ${REST_CONTEXT}/node/openflow:1 - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} openflow:1:1 - Should Contain ${resp.content} openflow:1:2 + ${resp} Get session ${REST_CONTEXT}/node/openflow:1 + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} openflow:1:1 + Should Contain ${resp.content} openflow:1:2 Get nodeconnector for a node 2 [Documentation] Get the inventory for a node - ${resp} Get session ${REST_CONTEXT}/node/openflow:2 - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} openflow:2:1 - Should Contain ${resp.content} openflow:2:2 - Should Contain ${resp.content} openflow:2:3 + ${resp} Get session ${REST_CONTEXT}/node/openflow:2 + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} openflow:2:1 + Should Contain ${resp.content} openflow:2:2 + Should Contain ${resp.content} openflow:2:3 Get nodeconnector for a node 3 [Documentation] Get the inventory for a node - ${resp} Get session ${REST_CONTEXT}/node/openflow:3 - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} openflow:3:1 - Should Contain ${resp.content} openflow:3:2 - Should Contain ${resp.content} openflow:3:3 - - - + ${resp} Get session ${REST_CONTEXT}/node/openflow:3 + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} openflow:3:1 + Should Contain ${resp.content} openflow:3:2 + Should Contain ${resp.content} openflow:3:3 diff --git a/test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/020__restconf_statistics.txt b/test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/020__restconf_statistics.txt index 63f2886efe..162542ad80 100644 --- a/test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/020__restconf_statistics.txt +++ b/test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/020__restconf_statistics.txt @@ -1,33 +1,27 @@ *** Settings *** Documentation Test suite for RESTCONF statistics -Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML} +Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML} Suite Teardown Delete All Sessions Library Collections Library ../../../libraries/RequestsLibrary.py Library ../../../libraries/Common.py Variables ../../../variables/Variables.py +Resource ../../../libraries/Utils.txt *** Variables *** ${REST_CONTEXT} /restconf/operational/opendaylight-inventory:nodes +@{node_list} openflow:1 openflow:2 openflow:3 -*** Test Cases *** +*** Test Cases *** Get Stats for node 1 [Documentation] Get the stats for a node - ${resp} Get session ${REST_CONTEXT}/node/openflow:1 - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} flow-capable-node-connector-statistics - Should Contain ${resp.content} flow-table-statistics + Wait Until Keyword Succeeds 30s 2s Ensure All Nodes Are In Response ${REST_CONTEXT} ${node_list} + Wait Until Keyword Succeeds 30s 2s Check Nodes Stats openflow:1 Get Stats for node 2 [Documentation] Get the stats for a node - ${resp} Get session ${REST_CONTEXT}/node/openflow:2 - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} flow-capable-node-connector-statistics - Should Contain ${resp.content} flow-table-statistics + Wait Until Keyword Succeeds 30s 2s Check Nodes Stats openflow:2 Get Stats for node 3 [Documentation] Get the stats for a node - ${resp} Get session ${REST_CONTEXT}/node/openflow:3 - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} flow-capable-node-connector-statistics - Should Contain ${resp.content} flow-table-statistics + Wait Until Keyword Succeeds 30s 2s Check Nodes Stats openflow:3 diff --git a/test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/030__restconf_topology.txt b/test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/030__restconf_topology.txt index 8322bcfa11..51f60c7c08 100644 --- a/test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/030__restconf_topology.txt +++ b/test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/030__restconf_topology.txt @@ -1,18 +1,20 @@ *** Settings *** -Documentation Test suite RESTCONF Topology -Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} +Documentation Test suite RESTCONF Topology +Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} Suite Teardown Delete All Sessions Library Collections Library ../../../libraries/RequestsLibrary.py Library ../../../libraries/Common.py Variables ../../../variables/Variables.py +Resource ../../../libraries/Utils.txt *** Variables *** -${topology1} "flow:1" -${node1} "openflow:1" -${node2} "openflow:2" -${node3} "openflow:3" -${key} link +${topology1} "flow:1" +${node1} "openflow:1" +${node2} "openflow:2" +${node3} "openflow:3" +@{node_list} openflow:1 openflow:2 openflow:3 +${key} link ${REST_CONTEXT_1} /restconf/operational/network-topology:network-topology ${REST_CONTEXT_2} /restconf/operational/network-topology:network-topology/topology/flow:1 ${REST_CONTEXT_3} /restconf/config/network-topology:network-topology/topology/flow:1/link/userlink @@ -21,45 +23,39 @@ ${REST_CONTEXT_3} /restconf/config/network-topology:network-topology/topology Get RESTCONF Topology [Documentation] Get RESTCONF Topology and validate the result. [Tags] get + Wait Until Keyword Succeeds 30s 2s Ensure All Nodes Are In Response ${REST_CONTEXT_1} ${node_list} ${resp} Get session ${REST_CONTEXT_1} - Should Be Equal As Strings ${resp.status_code} 200 Log ${resp.content} - Should Contain ${resp.content} ${topology1} - + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} ${topology1} + List all the links [Documentation] List all the links in the topology. [Tags] get ${body1} Create Dictionary dest-node=openflow:1 dest-tp=openflow:1:2 ${body2} Create Dictionary source-node=openflow:3 source-tp=openflow:3:3 - ${link2} Create Dictionary link-id=openflow:3:3 destination=${body1} source=${body2} + ${link2} Create Dictionary link-id=openflow:3:3 destination=${body1} source=${body2} ${body1} Create Dictionary dest-node=openflow:1 dest-tp=openflow:1:1 ${body2} Create Dictionary source-node=openflow:2 source-tp=openflow:2:3 - ${link1} Create Dictionary link-id=openflow:2:3 destination=${body1} source=${body2} + ${link1} Create Dictionary link-id=openflow:2:3 destination=${body1} source=${body2} ${body1} Create Dictionary dest-node=openflow:3 dest-tp=openflow:3:3 ${body2} Create Dictionary source-node=openflow:1 source-tp=openflow:1:2 - ${link4} Create Dictionary link-id=openflow:1:2 destination=${body1} source=${body2} + ${link4} Create Dictionary link-id=openflow:1:2 destination=${body1} source=${body2} ${body1} Create Dictionary dest-node=openflow:2 dest-tp=openflow:2:3 ${body2} Create Dictionary source-node=openflow:1 source-tp=openflow:1:1 - ${link3} Create Dictionary link-id=openflow:1:1 destination=${body1} source=${body2} - ${links} Create List ${link1} ${link2} ${link3} ${link4} - ${resp} Get session ${REST_CONTEXT_2} - Should Be Equal As Strings ${resp.status_code} 200 - ${result} To JSON ${resp.content} - ${content} Get From Dictionary ${result} topology - ${topology} Get From List ${content} 0 - ${link} Get From Dictionary ${topology} link - Sort List ${link} - Lists Should be Equal ${link} ${links} + ${link3} Create Dictionary link-id=openflow:1:1 destination=${body1} source=${body2} + ${links} Create List ${link1} ${link2} ${link3} ${link4} + Wait Until Keyword Succeeds 30s 2s Verify Links ${links} Add a link [Documentation] Add a link, list to validate the result. [Tags] add - ${body1} Create Dictionary dest-node=openflow:3 dest-tp=openflow:3:1 - ${body2} Create Dictionary source-node=openflow:2 source-tp=openflow:2:1 - ${body3} Create Dictionary link-id=userlink destination=${body1} source=${body2} + ${body1} Create Dictionary dest-node=openflow:3 dest-tp=openflow:3:1 + ${body2} Create Dictionary source-node=openflow:2 source-tp=openflow:2:1 + ${body3} Create Dictionary link-id=userlink destination=${body1} source=${body2} ${links} Create List ${body3} ${body} Create Dictionary link=${links} - ${resp} Put session ${REST_CONTEXT_3} data=${body} + ${resp} Put session ${REST_CONTEXT_3} data=${body} Should Be Equal As Strings ${resp.status_code} 200 ${resp} Get session ${REST_CONTEXT_3} Should Be Equal As Strings ${resp.status_code} 200 @@ -67,11 +63,24 @@ Add a link ${link} Get From Dictionary ${result} link Lists Should be Equal ${link} ${links} - Remove a link [Documentation] Remove a link, list to validate the result. [Tags] remove - ${resp} Delete session ${REST_CONTEXT_3} + ${resp} Delete session ${REST_CONTEXT_3} Should Be Equal As Strings ${resp.status_code} 200 ${resp} Get session ${REST_CONTEXT_3} Should Be Equal As Strings ${resp.status_code} 404 + +*** Keywords *** +Verify Links + [Arguments] ${expected_links} + ${resp} Get session ${REST_CONTEXT_2} + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 + ${result} To JSON ${resp.content} + Log ${result} + ${content} Get From Dictionary ${result} topology + ${topology} Get From List ${content} 0 + ${link} Get From Dictionary ${topology} link + Sort List ${link} + Lists Should be Equal ${link} ${expected_links} diff --git a/test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/040__restconf_frm.txt b/test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/040__restconf_frm.txt index 6f1e0b07a6..6f847fa48e 100644 --- a/test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/040__restconf_frm.txt +++ b/test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/040__restconf_frm.txt @@ -1,102 +1,93 @@ *** Settings *** Documentation Test suite for RESTCONF FRM -Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML} +Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML} Suite Teardown Delete All Sessions Library Collections Library ../../../libraries/RequestsLibrary.py Library ../../../libraries/Common.py Variables ../../../variables/Variables.py +Resource ../../../libraries/Utils.txt *** Variables *** +${REST_CON} /restconf/config/opendaylight-inventory:nodes +${REST_OPR} /restconf/operational/opendaylight-inventory:nodes +${BODY1} 2Foo204810.0.10.1/32139200 +${BODY2} 2Foo204810.0.20.1/32152200160 -${REST_CON} /restconf/config/opendaylight-inventory:nodes -${REST_OPR} /restconf/operational/opendaylight-inventory:nodes -${BODY1} 2Foo204810.0.10.1/32139200 -${BODY2} 2Foo204810.0.20.1/32152200160 - -*** Test Cases *** +*** Test Cases *** Add a flow - Sending IPv4 Dest Address and Eth type [Documentation] Push a flow through REST-API - [Tags] Push - ${resp} Putxml session ${REST_CON}/node/openflow:1/table/2/flow/139 data=${BODY1} + [Tags] Push + ${resp} Putxml session ${REST_CON}/node/openflow:1/table/2/flow/139 data=${BODY1} Should Be Equal As Strings ${resp.status_code} 200 - + Verify after adding flow config - Sending IPv4 Dest Address and Eth type [Documentation] Verify the flow - [Tags] Get - ${resp} Get session ${REST_CON}/node/openflow:1/table/2 - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} 139 + [Tags] Get + ${resp} Get session ${REST_CON}/node/openflow:1/table/2 + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} 139 Verify after adding flow operational - Sending IPv4 Dest Address and Eth type [Documentation] Verify the flow - [Tags] Get - Sleep 30 - ${resp} Get session ${REST_OPR}/node/openflow:1/table/2 - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} 10.0.10.1 + [Tags] Get + ${elements}= Create List 10.0.10.1 + Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_OPR}/node/openflow:1/table/2 ${elements} Remove a flow - - Sending IPv4 Dest Address and Eth type [Documentation] Remove a flow [Tags] remove - ${resp} Delete session ${REST_CON}/node/openflow:1/table/2/flow/139 + ${resp} Delete session ${REST_CON}/node/openflow:1/table/2/flow/139 Should Be Equal As Strings ${resp.status_code} 200 - + Verify after deleting flow config - Sending IPv4 Dest Address and Eth type [Documentation] Verify the flow - [Tags] Get - ${resp} Get session ${REST_CON}/node/openflow:1/table/2 - Should Be Equal As Strings ${resp.status_code} 200 - Should Not Contain ${resp.content} 139 + [Tags] Get + ${resp} Get session ${REST_CON}/node/openflow:1/table/2 + Should Be Equal As Strings ${resp.status_code} 200 + Should Not Contain ${resp.content} 139 + # Reason in using high time is, I used STOPWATCH to check the timer after deleting the flow config -# Reason in using high time is, I used STOPWATCH to check the timer after deleting the flow config Verify after deleting flow operational - Sending IPv4 Dest Address and Eth type [Documentation] Verify the flow - [Tags] Get - Sleep 30 - ${resp} Get session ${REST_OPR}/node/openflow:1/table/2 - Should Be Equal As Strings ${resp.status_code} 200 - Should Not Contain ${resp.content} 10.0.10.1 - + [Tags] Get + ${elements}= Create List 10.0.10.1 + Wait Until Keyword Succeeds 40s 2s Check For Elements Not At URI ${REST_OPR}/node/openflow:1/table/2 ${elements} + Add a flow - Output to physical port# [Documentation] Push a flow through REST-API - [Tags] Push - ${resp} Putxml session ${REST_CON}/node/openflow:1/table/2/flow/152 data=${BODY2} + [Tags] Push + ${resp} Putxml session ${REST_CON}/node/openflow:1/table/2/flow/152 data=${BODY2} Should Be Equal As Strings ${resp.status_code} 200 Verify after adding flow config - Output to physical port# [Documentation] Verify the flow - [Tags] Get - ${resp} Get session ${REST_CON}/node/openflow:1/table/2 - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} 152 - + [Tags] Get + ${resp} Get session ${REST_CON}/node/openflow:1/table/2 + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} 152 + Verify after adding flow operational - Output to physical port# [Documentation] Verify the flow - [Tags] Get - Sleep 30 - ${resp} Get session ${REST_OPR}/node/openflow:1/table/2 - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} 10.0.20.1 + [Tags] Get + ${elements}= Create List 10.0.20.1 + Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_OPR}/node/openflow:1/table/2 ${elements} Remove a flow - Output to physical port# [Documentation] Remove a flow [Tags] remove - ${resp} Delete session ${REST_CON}/node/openflow:1/table/2/flow/152 + ${resp} Delete session ${REST_CON}/node/openflow:1/table/2/flow/152 Should Be Equal As Strings ${resp.status_code} 200 Verify after deleting flow config - Output to physical port# [Documentation] Verify the flow - [Tags] Get - ${resp} Get session ${REST_CON}/node/openflow:1/table/2 - Should Be Equal As Strings ${resp.status_code} 200 - Should Not Contain ${resp.content} 152 + [Tags] Get + ${resp} Get session ${REST_CON}/node/openflow:1/table/2 + Should Be Equal As Strings ${resp.status_code} 200 + Should Not Contain ${resp.content} 152 Verify after deleting flow operational - Output to physical port# [Documentation] Verify the flow - [Tags] Get - Sleep 40 - ${resp} Get session ${REST_OPR}/node/openflow:1/table/2 - Should Be Equal As Strings ${resp.status_code} 200 - Should Not Contain ${resp.content} 10.0.20.1 - + [Tags] Get + ${elements}= Create List 10.0.20.1 + Wait Until Keyword Succeeds 40s 2s Check For Elements Not At URI ${REST_OPR}/node/openflow:1/table/2 ${elements} diff --git a/test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/__init__.txt b/test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/__init__.txt index 7b77f73dc1..b46e60a8d5 100644 --- a/test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/__init__.txt +++ b/test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/__init__.txt @@ -3,25 +3,9 @@ Documentation Test suite for MD-SAL NSF mininet OF13 Suite Setup Start Suite Suite Teardown Stop Suite Library SSHLibrary +Resource ../../../libraries/Utils.txt *** Variables *** ${start}= sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 --switch ovsk,protocols=OpenFlow13 ** Keywords *** -Start Suite - Log Start mininet - Open Connection ${MININET} prompt=> - Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any - Write sudo ovs-vsctl set-manager ptcp:6644 - Write sudo mn -c - Sleep 2 - Write ${start} - Sleep 30 - Read -Stop Suite - Log Stop mininet - Read - Write exit - Sleep 6 - Read - Close Connection diff --git a/test/csit/suites/karaf-compatible/030__AD_SAL_NSF/020__statistics_manager.txt b/test/csit/suites/karaf-compatible/030__AD_SAL_NSF/020__statistics_manager.txt index 9bd466e39c..3f1595b1d8 100644 --- a/test/csit/suites/karaf-compatible/030__AD_SAL_NSF/020__statistics_manager.txt +++ b/test/csit/suites/karaf-compatible/030__AD_SAL_NSF/020__statistics_manager.txt @@ -1,43 +1,37 @@ *** Settings *** Documentation Test suite for Statistics Manager -Suite Setup Create Session session http://${CONTROLLER}:${RESTPORT} auth=${AUTH} headers=${HEADERS} +Suite Setup Create Session session http://${CONTROLLER}:${RESTPORT} auth=${AUTH} headers=${HEADERS} Suite Teardown Delete All Sessions Library Collections Library ../../../libraries/RequestsLibrary.py Library ../../../libraries/Common.py Variables ../../../variables/Variables.py +Resource ../../../libraries/Utils.txt *** Variables *** -${node1} "00:00:00:00:00:00:00:01" -${node2} "00:00:00:00:00:00:00:02" -${node3} "00:00:00:00:00:00:00:03" -${key} portStatistics +${node1} "00:00:00:00:00:00:00:01" +${node2} "00:00:00:00:00:00:00:02" +${node3} "00:00:00:00:00:00:00:03" +@{macaddr_list} ${node1} ${node2} ${node3} +@{node_list} openflow:1 openflow:2 openflow:3 +${key} portStatistics ${REST_CONTEXT} /controller/nb/v2/statistics *** Test Cases *** get port stats [Documentation] Show port stats and validate result [Tags] get - ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/port - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain X Times ${resp.content} ${node1} 4 - Should Contain X Times ${resp.content} ${node2} 5 - Should Contain X Times ${resp.content} ${node3} 5 + Wait Until Keyword Succeeds 30s 2s Ensure All Nodes Are In Response /restconf/operational/opendaylight-inventory:nodes ${node_list} + Wait Until Keyword Succeeds 10s 2s Check That Port Count Is Ok ${node1} 4 + Wait Until Keyword Succeeds 10s 1s Check That Port Count Is Ok ${node2} 5 + Wait Until Keyword Succeeds 10s 1s Check That Port Count Is Ok ${node3} 5 + get flow stats [Documentation] Show flow stats and validate result [Tags] get - ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/flow - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} ${node1} - Should Contain ${resp.content} ${node2} - Should Contain ${resp.content} ${node3} + Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT}/${CONTAINER}/flow ${macaddr_list} + get table stats [Documentation] Show flow stats and validate result [Tags] get - ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/table - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} ${node1} - Should Contain ${resp.content} ${node2} - Should Contain ${resp.content} ${node3} - - + Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT}/${CONTAINER}/table ${macaddr_list} diff --git a/test/csit/suites/karaf-compatible/030__AD_SAL_NSF/030__topology_manager.txt b/test/csit/suites/karaf-compatible/030__AD_SAL_NSF/030__topology_manager.txt index 230d6e771c..8e0a6a6dc5 100644 --- a/test/csit/suites/karaf-compatible/030__AD_SAL_NSF/030__topology_manager.txt +++ b/test/csit/suites/karaf-compatible/030__AD_SAL_NSF/030__topology_manager.txt @@ -1,16 +1,17 @@ *** Settings *** Documentation Test suite for Topology Manager -Suite Setup Create Session session http://${CONTROLLER}:${RESTPORT} auth=${AUTH} headers=${HEADERS} +Suite Setup Create Session session http://${CONTROLLER}:${RESTPORT} auth=${AUTH} headers=${HEADERS} Suite Teardown Delete All Sessions Library Collections Library ../../../libraries/RequestsLibrary.py Library ../../../libraries/Common.py Variables ../../../variables/Variables.py +Resource ../../../libraries/Utils.txt *** Variables *** -${node1} "00:00:00:00:00:00:00:01" -${node2} "00:00:00:00:00:00:00:02" -${node3} "00:00:00:00:00:00:00:03" +${node1} "00:00:00:00:00:00:00:01" +${node2} "00:00:00:00:00:00:00:02" +${node3} "00:00:00:00:00:00:00:03" ${name} test_userlink1 ${key} userLinks ${REST_CONTEXT} /controller/nb/v2/topology @@ -19,12 +20,10 @@ ${REST_CONTEXT} /controller/nb/v2/topology Get Topology [Documentation] Get Topology and validate the result. [Tags] get - ${resp} Get session ${REST_CONTEXT}/${CONTAINER} - Should Be Equal As Strings ${resp.status_code} 200 - Log ${resp.content} - Should Contain X Times ${resp.content} ${node1} 4 - Should Contain X Times ${resp.content} ${node2} 2 - Should Contain X Times ${resp.content} ${node3} 2 + Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${REST_CONTEXT}/${CONTAINER} ${node1} 4 + Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${REST_CONTEXT}/${CONTAINER} ${node1} 4 + Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${REST_CONTEXT}/${CONTAINER} ${node1} 4 + Add a userlink [Documentation] Add a userlink, list to validate the result. [Tags] add @@ -37,6 +36,7 @@ Add a userlink ${result} To JSON ${resp.content} ${content} Get From Dictionary ${result} ${key} List Should Contain Value ${content} ${body} + Remove a userlink [Documentation] Remove a userlink, list to validate the result. [Tags] remove diff --git a/test/csit/suites/karaf-compatible/030__AD_SAL_NSF/__init__.txt b/test/csit/suites/karaf-compatible/030__AD_SAL_NSF/__init__.txt index 207406366f..8a8c1943c6 100644 --- a/test/csit/suites/karaf-compatible/030__AD_SAL_NSF/__init__.txt +++ b/test/csit/suites/karaf-compatible/030__AD_SAL_NSF/__init__.txt @@ -3,25 +3,9 @@ Documentation Test suite for AD-SAL NSF Suite Setup Start Suite Suite Teardown Stop Suite Library SSHLibrary +Resource ../../../libraries/Utils.txt *** Variables *** ${start}= sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 ** Keywords *** -Start Suite - Log Start mininet - Open Connection ${MININET} prompt=> - Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any - Write sudo ovs-vsctl set-manager ptcp:6644 - Write sudo mn -c - Sleep 2 - Write ${start} - Sleep 30 - Read -Stop Suite - Log Stop mininet - Read - Write exit - Sleep 6 - Read - Close Connection diff --git a/test/csit/suites/karaf-compatible/040__AD_SAL_NSF_OF13/020__statistics_manager.txt b/test/csit/suites/karaf-compatible/040__AD_SAL_NSF_OF13/020__statistics_manager.txt index 9bd466e39c..3f1595b1d8 100644 --- a/test/csit/suites/karaf-compatible/040__AD_SAL_NSF_OF13/020__statistics_manager.txt +++ b/test/csit/suites/karaf-compatible/040__AD_SAL_NSF_OF13/020__statistics_manager.txt @@ -1,43 +1,37 @@ *** Settings *** Documentation Test suite for Statistics Manager -Suite Setup Create Session session http://${CONTROLLER}:${RESTPORT} auth=${AUTH} headers=${HEADERS} +Suite Setup Create Session session http://${CONTROLLER}:${RESTPORT} auth=${AUTH} headers=${HEADERS} Suite Teardown Delete All Sessions Library Collections Library ../../../libraries/RequestsLibrary.py Library ../../../libraries/Common.py Variables ../../../variables/Variables.py +Resource ../../../libraries/Utils.txt *** Variables *** -${node1} "00:00:00:00:00:00:00:01" -${node2} "00:00:00:00:00:00:00:02" -${node3} "00:00:00:00:00:00:00:03" -${key} portStatistics +${node1} "00:00:00:00:00:00:00:01" +${node2} "00:00:00:00:00:00:00:02" +${node3} "00:00:00:00:00:00:00:03" +@{macaddr_list} ${node1} ${node2} ${node3} +@{node_list} openflow:1 openflow:2 openflow:3 +${key} portStatistics ${REST_CONTEXT} /controller/nb/v2/statistics *** Test Cases *** get port stats [Documentation] Show port stats and validate result [Tags] get - ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/port - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain X Times ${resp.content} ${node1} 4 - Should Contain X Times ${resp.content} ${node2} 5 - Should Contain X Times ${resp.content} ${node3} 5 + Wait Until Keyword Succeeds 30s 2s Ensure All Nodes Are In Response /restconf/operational/opendaylight-inventory:nodes ${node_list} + Wait Until Keyword Succeeds 10s 2s Check That Port Count Is Ok ${node1} 4 + Wait Until Keyword Succeeds 10s 1s Check That Port Count Is Ok ${node2} 5 + Wait Until Keyword Succeeds 10s 1s Check That Port Count Is Ok ${node3} 5 + get flow stats [Documentation] Show flow stats and validate result [Tags] get - ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/flow - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} ${node1} - Should Contain ${resp.content} ${node2} - Should Contain ${resp.content} ${node3} + Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT}/${CONTAINER}/flow ${macaddr_list} + get table stats [Documentation] Show flow stats and validate result [Tags] get - ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/table - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${resp.content} ${node1} - Should Contain ${resp.content} ${node2} - Should Contain ${resp.content} ${node3} - - + Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT}/${CONTAINER}/table ${macaddr_list} diff --git a/test/csit/suites/karaf-compatible/040__AD_SAL_NSF_OF13/030__topology_manager.txt b/test/csit/suites/karaf-compatible/040__AD_SAL_NSF_OF13/030__topology_manager.txt index 230d6e771c..8e0a6a6dc5 100644 --- a/test/csit/suites/karaf-compatible/040__AD_SAL_NSF_OF13/030__topology_manager.txt +++ b/test/csit/suites/karaf-compatible/040__AD_SAL_NSF_OF13/030__topology_manager.txt @@ -1,16 +1,17 @@ *** Settings *** Documentation Test suite for Topology Manager -Suite Setup Create Session session http://${CONTROLLER}:${RESTPORT} auth=${AUTH} headers=${HEADERS} +Suite Setup Create Session session http://${CONTROLLER}:${RESTPORT} auth=${AUTH} headers=${HEADERS} Suite Teardown Delete All Sessions Library Collections Library ../../../libraries/RequestsLibrary.py Library ../../../libraries/Common.py Variables ../../../variables/Variables.py +Resource ../../../libraries/Utils.txt *** Variables *** -${node1} "00:00:00:00:00:00:00:01" -${node2} "00:00:00:00:00:00:00:02" -${node3} "00:00:00:00:00:00:00:03" +${node1} "00:00:00:00:00:00:00:01" +${node2} "00:00:00:00:00:00:00:02" +${node3} "00:00:00:00:00:00:00:03" ${name} test_userlink1 ${key} userLinks ${REST_CONTEXT} /controller/nb/v2/topology @@ -19,12 +20,10 @@ ${REST_CONTEXT} /controller/nb/v2/topology Get Topology [Documentation] Get Topology and validate the result. [Tags] get - ${resp} Get session ${REST_CONTEXT}/${CONTAINER} - Should Be Equal As Strings ${resp.status_code} 200 - Log ${resp.content} - Should Contain X Times ${resp.content} ${node1} 4 - Should Contain X Times ${resp.content} ${node2} 2 - Should Contain X Times ${resp.content} ${node3} 2 + Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${REST_CONTEXT}/${CONTAINER} ${node1} 4 + Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${REST_CONTEXT}/${CONTAINER} ${node1} 4 + Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${REST_CONTEXT}/${CONTAINER} ${node1} 4 + Add a userlink [Documentation] Add a userlink, list to validate the result. [Tags] add @@ -37,6 +36,7 @@ Add a userlink ${result} To JSON ${resp.content} ${content} Get From Dictionary ${result} ${key} List Should Contain Value ${content} ${body} + Remove a userlink [Documentation] Remove a userlink, list to validate the result. [Tags] remove diff --git a/test/csit/suites/karaf-compatible/040__AD_SAL_NSF_OF13/__init__.txt b/test/csit/suites/karaf-compatible/040__AD_SAL_NSF_OF13/__init__.txt index c79119017f..36c2d66210 100644 --- a/test/csit/suites/karaf-compatible/040__AD_SAL_NSF_OF13/__init__.txt +++ b/test/csit/suites/karaf-compatible/040__AD_SAL_NSF_OF13/__init__.txt @@ -3,25 +3,9 @@ Documentation Test suite for AD-SAL NSF mininet OF13 Suite Setup Start Suite Suite Teardown Stop Suite Library SSHLibrary +Resource ../../../libraries/Utils.txt *** Variables *** ${start}= sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 --switch ovsk,protocols=OpenFlow13 ** Keywords *** -Start Suite - Log Start mininet - Open Connection ${MININET} prompt=> - Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any - Write sudo ovs-vsctl set-manager ptcp:6644 - Write sudo mn -c - Sleep 2 - Write ${start} - Sleep 30 - Read -Stop Suite - Log Stop mininet - Read - Write exit - Sleep 6 - Read - Close Connection diff --git a/test/csit/suites/karaf-compatible/050__AD_SAL_Apps/__init__.txt b/test/csit/suites/karaf-compatible/050__AD_SAL_Apps/__init__.txt index a951e5a898..17abe5645c 100644 --- a/test/csit/suites/karaf-compatible/050__AD_SAL_Apps/__init__.txt +++ b/test/csit/suites/karaf-compatible/050__AD_SAL_Apps/__init__.txt @@ -3,25 +3,9 @@ Documentation Test suite for AD-SAL Applications Suite Setup Start Suite Suite Teardown Stop Suite Library SSHLibrary +Resource ../../../libraries/Utils.txt *** Variables *** ${start}= sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 ** Keywords *** -Start Suite - Log Start mininet - Open Connection ${MININET} prompt=> - Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any - Write sudo ovs-vsctl set-manager ptcp:6644 - Write sudo mn -c - Sleep 2 - Write ${start} - Sleep 30 - Read -Stop Suite - Log Stop mininet - Read - Write exit - Sleep 6 - Read - Close Connection diff --git a/test/csit/suites/karaf-compatible/060__AD_SAL_Apps_OF13/__init__.txt b/test/csit/suites/karaf-compatible/060__AD_SAL_Apps_OF13/__init__.txt index 0f342eaf56..a2546e9e12 100644 --- a/test/csit/suites/karaf-compatible/060__AD_SAL_Apps_OF13/__init__.txt +++ b/test/csit/suites/karaf-compatible/060__AD_SAL_Apps_OF13/__init__.txt @@ -3,25 +3,10 @@ Documentation Test suite for AD-SAL Applications mininet OF13 Suite Setup Start Suite Suite Teardown Stop Suite Library SSHLibrary +Resource ../../../libraries/Utils.txt + *** Variables *** ${start}= sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 --switch ovsk,protocols=OpenFlow13 ** Keywords *** -Start Suite - Log Start mininet - Open Connection ${MININET} prompt=> - Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any - Write sudo ovs-vsctl set-manager ptcp:6644 - Write sudo mn -c - Sleep 2 - Write ${start} - Sleep 30 - Read -Stop Suite - Log Stop mininet - Read - Write exit - Sleep 6 - Read - Close Connection diff --git a/test/csit/suites/karaf-compatible/070__Flows_OF13/__init__.txt b/test/csit/suites/karaf-compatible/070__Flows_OF13/__init__.txt index c4c6f00008..10ece1e24d 100644 --- a/test/csit/suites/karaf-compatible/070__Flows_OF13/__init__.txt +++ b/test/csit/suites/karaf-compatible/070__Flows_OF13/__init__.txt @@ -1,26 +1,9 @@ *** Settings *** -Documentation Test suite for the OpenDaylight base edition with of10 +Documentation Flow test suite for the OpenDaylight karaf-compatible feature set Suite Setup Start Suite Suite Teardown Stop Suite -Library SSHLibrary +Resource ../../../libraries/Utils.txt *** Variables *** -${start} sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,1 --switch ovsk,protocols=OpenFlow13 *** Keywords *** -Start Suite - Log Start the test on the base edition - Open Connection ${MININET} prompt=> - Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any - Write sudo ovs-vsctl set-manager ptcp:6644 - Write sudo mn -c - Read Until > - Write ${start} - Read Until mininet> - -Stop Suite - Log Stop the test on the base edition - Read - Write exit - Read Until > - Close Connection diff --git a/test/csit/suites/karaf-compatible/075__Flows_OF13_Stat_Manager/010__SM_add_upd_del_flows.txt b/test/csit/suites/karaf-compatible/075__Flows_OF13_Stat_Manager/010__SM_add_upd_del_flows.txt index 2666d05e2c..f1e303d2ea 100644 --- a/test/csit/suites/karaf-compatible/075__Flows_OF13_Stat_Manager/010__SM_add_upd_del_flows.txt +++ b/test/csit/suites/karaf-compatible/075__Flows_OF13_Stat_Manager/010__SM_add_upd_del_flows.txt @@ -1,251 +1,301 @@ *** Settings *** Documentation Test suite for Stats Manager flows collection -Library OperatingSystem -Library Collections -Library XML -Library ../../../libraries/XmlComparator.py -Variables ../../../variables/Variables.py -Library ../../../libraries/RequestsLibrary.py -Library ../../../libraries/Common.py Suite Setup Initialization Phase Suite Teardown Teardown Phase - +Library OperatingSystem +Library Collections +Library XML +Library ../../../libraries/XmlComparator.py +Variables ../../../variables/Variables.py +Library ../../../libraries/RequestsLibrary.py +Library ../../../libraries/Common.py *** Variables *** -${XmlsDir}= ${CURDIR}/../../../variables/xmls -${switch_idx}= 1 -${switch_name}= s${switch_idx} -@{xml_files}= f1.xml f2.xml f3.xml f5.xml f7.xml f8.xml f9.xml f10.xml f11.xml f12.xml f13.xml f14.xml f17.xml f19.xml f24.xml - +${XmlsDir} ${CURDIR}/../../../variables/xmls +${switch_idx} 1 +${switch_name} s${switch_idx} +@{xml_files} f1.xml f2.xml f3.xml f5.xml f7.xml f8.xml f9.xml +... f10.xml f11.xml f12.xml f13.xml f14.xml f17.xml f19.xml +... f24.xml *** Test Cases *** Test Add Flows - [Documentation] Add all flows and waits for SM to collect data - :FOR ${flowfile} IN @{xml_files} - \ Log ${flowfile} - \ Init Flow Variables ${flowfile} - \ Run Keyword And Continue On Failure Add Flow - Sleep 30s + [Documentation] Add all flows and waits for SM to collect data + : FOR ${flowfile} IN @{xml_files} + \ Log ${flowfile} + \ Init Flow Variables ${flowfile} + \ Run Keyword And Continue On Failure Add Flow + Test Is Flow 1 Added [Documentation] Checks if flow is configured and operational - Init Flow Variables f1.xml - Check Config Flow ${True} - Check Operational Table ${True} + Init Flow Variables f1.xml + Check Config Flow ${True} + Check Operational Table ${True} + Test Is Flow 2 Added [Documentation] Checks if flow is configured and operational - Init Flow Variables f2.xml - Check Config Flow ${True} - Check Operational Table ${True} + Init Flow Variables f2.xml + Check Config Flow ${True} + Check Operational Table ${True} + Test Is Flow 3 Added [Documentation] Checks if flow is configured and operational - Init Flow Variables f3.xml - Check Config Flow ${True} - Check Operational Table ${True} + Init Flow Variables f3.xml + Check Config Flow ${True} + Check Operational Table ${True} + Test Is Flow 5 Added [Documentation] Checks if flow is configured and operational - Init Flow Variables f5.xml - Check Config Flow ${True} - Check Operational Table ${True} + Init Flow Variables f5.xml + Check Config Flow ${True} + Check Operational Table ${True} + Test Is Flow 7 Added [Documentation] Checks if flow is configured and operational - Init Flow Variables f7.xml - Check Config Flow ${True} - Check Operational Table ${True} + Init Flow Variables f7.xml + Check Config Flow ${True} + Check Operational Table ${True} + Test Is Flow 8 Added [Documentation] Checks if flow is configured and operational - Init Flow Variables f8.xml - Check Config Flow ${True} - Check Operational Table ${True} + Init Flow Variables f8.xml + Check Config Flow ${True} + Check Operational Table ${True} + Test Is Flow 9 Added [Documentation] Checks if flow is configured and operational - Init Flow Variables f9.xml - Check Config Flow ${True} - Check Operational Table ${True} + Init Flow Variables f9.xml + Check Config Flow ${True} + Check Operational Table ${True} + Test Is Flow 10 Added [Documentation] Checks if flow is configured and operational - Init Flow Variables f10.xml - Check Config Flow ${True} - Check Operational Table ${True} + Init Flow Variables f10.xml + Check Config Flow ${True} + Check Operational Table ${True} + Test Is Flow 11 Added [Documentation] Checks if flow is configured and operational - Init Flow Variables f11.xml - Check Config Flow ${True} - Check Operational Table ${True} + Init Flow Variables f11.xml + Check Config Flow ${True} + Check Operational Table ${True} + Test Is Flow 12 Added [Documentation] Checks if flow is configured and operational - Init Flow Variables f12.xml - Check Config Flow ${True} - Check Operational Table ${True} + Init Flow Variables f12.xml + Check Config Flow ${True} + Check Operational Table ${True} + Test Is Flow 13 Added [Documentation] Checks if flow is configured and operational - Init Flow Variables f13.xml - Check Config Flow ${True} - Check Operational Table ${True} + Init Flow Variables f13.xml + Check Config Flow ${True} + Check Operational Table ${True} + Test Is Flow 14 Added [Documentation] Checks if flow is configured and operational - Init Flow Variables f14.xml - Check Config Flow ${True} - Check Operational Table ${True} + Init Flow Variables f14.xml + Check Config Flow ${True} + Check Operational Table ${True} + Test Is Flow 17 Added [Documentation] Checks if flow is configured and operational - Init Flow Variables f17.xml - Check Config Flow ${True} - Check Operational Table ${True} + Init Flow Variables f17.xml + Check Config Flow ${True} + Check Operational Table ${True} + Test Is Flow 19 Added [Documentation] Checks if flow is configured and operational - Init Flow Variables f19.xml - Check Config Flow ${True} - Check Operational Table ${True} + Init Flow Variables f19.xml + Check Config Flow ${True} + Check Operational Table ${True} + Test Is Flow 24 Added [Documentation] Checks if flow is configured and operational - Init Flow Variables f24.xml - Check Config Flow ${True} - Check Operational Table ${True} + Init Flow Variables f24.xml + Check Config Flow ${True} + Check Operational Table ${True} + Test Delete Flows - [Documentation] Delete all flows and waits for SM to collect data - :FOR ${flowfile} IN @{xml_files} - \ Log ${flowfile} - \ Init Flow Variables ${flowfile} - \ Run Keyword And Continue On Failure Delete Flow - Sleep 40s + [Documentation] Delete all flows and waits for SM to collect data + : FOR ${flowfile} IN @{xml_files} + \ Log ${flowfile} + \ Init Flow Variables ${flowfile} + \ Run Keyword And Continue On Failure Delete Flow + Test Is Flow 1 Deleted - [Documentation] Checks if flow is not configured and operational - Init Flow Variables f1.xml - Check Config Flow ${False} - Check Operational Table ${False} + [Documentation] Checks if flow is not configured and operational + Init Flow Variables f1.xml + Check Config Flow ${False} + Check Operational Table ${False} + Test Is Flow 2 Deleted - [Documentation] Checks if flow is not configured and operational - Init Flow Variables f2.xml - Check Config Flow ${False} - Check Operational Table ${False} + [Documentation] Checks if flow is not configured and operational + Init Flow Variables f2.xml + Check Config Flow ${False} + Check Operational Table ${False} + Test Is Flow 3 Deleted - [Documentation] Checks if flow is not configured and operational - Init Flow Variables f3.xml - Check Config Flow ${False} - Check Operational Table ${False} + [Documentation] Checks if flow is not configured and operational + Init Flow Variables f3.xml + Check Config Flow ${False} + Check Operational Table ${False} + Test Is Flow 5 Deleted - [Documentation] Checks if flow is not configured and operational - Init Flow Variables f5.xml - Check Config Flow ${False} - Check Operational Table ${False} + [Documentation] Checks if flow is not configured and operational + Init Flow Variables f5.xml + Check Config Flow ${False} + Check Operational Table ${False} + Test Is Flow 7 Deleted - [Documentation] Checks if flow is not configured and operational - Init Flow Variables f7.xml - Check Config Flow ${False} - Check Operational Table ${False} + [Documentation] Checks if flow is not configured and operational + Init Flow Variables f7.xml + Check Config Flow ${False} + Check Operational Table ${False} + Test Is Flow 8 Deleted - [Documentation] Checks if flow is not configured and operational - Init Flow Variables f8.xml - Check Config Flow ${False} - Check Operational Table ${False} + [Documentation] Checks if flow is not configured and operational + Init Flow Variables f8.xml + Check Config Flow ${False} + Check Operational Table ${False} + Test Is Flow 9 Deleted - [Documentation] Checks if flow is not configured and operational - Init Flow Variables f9.xml - Check Config Flow ${False} - Check Operational Table ${False} + [Documentation] Checks if flow is not configured and operational + Init Flow Variables f9.xml + Check Config Flow ${False} + Check Operational Table ${False} + Test Is Flow 10 Deleted - [Documentation] Checks if flow is not configured and operational - Init Flow Variables f10.xml - Check Config Flow ${False} - Check Operational Table ${False} + [Documentation] Checks if flow is not configured and operational + Init Flow Variables f10.xml + Check Config Flow ${False} + Check Operational Table ${False} + Test Is Flow 11 Deleted - [Documentation] Checks if flow is not configured and operational - Init Flow Variables f11.xml - Check Config Flow ${False} - Check Operational Table ${False} + [Documentation] Checks if flow is not configured and operational + Init Flow Variables f11.xml + Check Config Flow ${False} + Check Operational Table ${False} + Test Is Flow 12 Deleted - [Documentation] Checks if flow is not configured and operational - Init Flow Variables f12.xml - Check Config Flow ${False} - Check Operational Table ${False} + [Documentation] Checks if flow is not configured and operational + Init Flow Variables f12.xml + Check Config Flow ${False} + Check Operational Table ${False} + Test Is Flow 13 Deleted - [Documentation] Checks if flow is not configured and operational - Init Flow Variables f13.xml - Check Config Flow ${False} - Check Operational Table ${False} + [Documentation] Checks if flow is not configured and operational + Init Flow Variables f13.xml + Check Config Flow ${False} + Check Operational Table ${False} + Test Is Flow 14 Deleted - [Documentation] Checks if flow is not configured and operational - Init Flow Variables f14.xml - Check Config Flow ${False} - Check Operational Table ${False} + [Documentation] Checks if flow is not configured and operational + Init Flow Variables f14.xml + Check Config Flow ${False} + Check Operational Table ${False} + Test Is Flow 17 Deleted - [Documentation] Checks if flow is not configured and operational - Init Flow Variables f17.xml - Check Config Flow ${False} - Check Operational Table ${False} + [Documentation] Checks if flow is not configured and operational + Init Flow Variables f17.xml + Check Config Flow ${False} + Check Operational Table ${False} + Test Is Flow 19 Deleted - [Documentation] Checks if flow is not configured and operational - Init Flow Variables f19.xml - Check Config Flow ${False} - Check Operational Table ${False} -Test Is Flow 24 Deleted - [Documentation] Checks if flow is not configured and operational - Init Flow Variables f24.xml - Check Config Flow ${False} - Check Operational Table ${False} + [Documentation] Checks if flow is not configured and operational + Init Flow Variables f19.xml + Check Config Flow ${False} + Check Operational Table ${False} +Test Is Flow 24 Deleted + [Documentation] Checks if flow is not configured and operational + Init Flow Variables f24.xml + Check Config Flow ${False} + Check Operational Table ${False} *** Keywords *** -Init Flow Variables [Arguments] ${file} - ${data}= Get File ${XmlsDir}/${file} - ${xmlroot}= Parse Xml ${XmlsDir}/${file} - ${table_id}= Get Element Text ${xmlroot} table_id - ${flow_id}= Get Element Text ${xmlroot} id - ${flow_priority}= Get Element Text ${xmlroot} priority - Set Suite Variable ${table_id} - Set Suite Variable ${flow_id} - Set Suite Variable ${flow_priority} - Set Suite Variable ${data} - Set Suite Variable ${xmlroot} -Check Config Flow [Arguments] ${expected} - ${presence_flow} ${msg}= Flow Presence Config Flow - ${msgf}= Get Presence Failure Message config ${expected} ${presence_flow} ${msg} - Should Be Equal ${expected} ${presence_flow} msg=${msgf} +Init Flow Variables + [Arguments] ${file} + ${data}= Get File ${XmlsDir}/${file} + ${xmlroot}= Parse Xml ${XmlsDir}/${file} + ${table_id}= Get Element Text ${xmlroot} table_id + ${flow_id}= Get Element Text ${xmlroot} id + ${flow_priority}= Get Element Text ${xmlroot} priority + Set Suite Variable ${table_id} + Set Suite Variable ${flow_id} + Set Suite Variable ${flow_priority} + Set Suite Variable ${data} + Set Suite Variable ${xmlroot} + +Check Config Flow + [Arguments] ${expected} + Wait Until Keyword Succeeds 40s 2s Check Config Flow Presence ${expected} + +Check Config Flow Presence + [Arguments] ${expected} + ${presence_flow} ${msg}= Flow Presence Config Flow + ${msgf}= Get Presence Failure Message config ${expected} ${presence_flow} ${msg} + Should Be Equal ${expected} ${presence_flow} msg=${msgf} + Flow Presence Config Flow - ${headers}= Create Dictionary Accept application/xml - ${resp}= Get session /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} headers=${headers} - Log ${resp} - Log ${resp.content} - Return From Keyword If ${resp.status_code}!=200 ${False} ${EMPTY} - ${pres} ${msg}= Is Flow Configured ${data} ${resp.content} - Run Keyword If '''${msg}'''!='${EMPTY}' Log ${msg} - Return From Keyword ${pres} ${msg} -Check Operational Table [Arguments] ${expected} - ${presence_table} ${msg}= Flow Presence Operational Table - ${msgf}= Get Presence Failure Message config ${expected} ${presence_table} ${msg} - Should Be Equal ${expected} ${presence_table} msg=${msgf} -Flow Presence Operational Table - ${headers}= Create Dictionary Accept application/xml - ${resp}= Get session /restconf/operational/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id} headers=${headers} - Log ${resp} - Log ${resp.content} - Return From Keyword If ${resp.status_code}!=200 ${False} ${EMPTY} - ${pres} ${msg}= Is Flow Operational2 ${data} ${resp.content} - Run Keyword If '''${msg}'''!='${EMPTY}' Log ${msg} - Return From Keyword ${pres} ${msg} + ${headers}= Create Dictionary Accept application/xml + ${resp}= Get session /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} headers=${headers} + Log ${resp} + Log ${resp.content} + Return From Keyword If ${resp.status_code}!=200 ${False} ${EMPTY} + ${pres} ${msg}= Is Flow Configured ${data} ${resp.content} + Run Keyword If '''${msg}'''!='${EMPTY}' Log ${msg} + Return From Keyword ${pres} ${msg} + +Check Operational Table + [Arguments] ${expected} + Wait Until Keyword Succeeds 40s 2s Check Operational Table Presence ${expected} + +Check Operational Table Presence + [Arguments] ${expected} + ${presence_table} ${msg}= Flow Presence Operational Table + ${msgf}= Get Presence Failure Message config ${expected} ${presence_table} ${msg} + Should Be Equal ${expected} ${presence_table} msg=${msgf} + +Flow Presence Operational Table + ${headers}= Create Dictionary Accept application/xml + ${resp}= Get session /restconf/operational/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id} headers=${headers} + Log ${resp} + Log ${resp.content} + Return From Keyword If ${resp.status_code}!=200 ${False} ${EMPTY} + ${pres} ${msg}= Is Flow Operational2 ${data} ${resp.content} + Run Keyword If '''${msg}'''!='${EMPTY}' Log ${msg} + Return From Keyword ${pres} ${msg} + Add Flow - Log ${data} - ${resp}= Putxml session /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} data=${data} - ${msg}= Set Variable Adding flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received. - Should Be Equal As Strings ${resp.status_code} 200 msg=${msg} + Log ${data} + ${resp}= Putxml session /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} data=${data} + ${msg}= Set Variable Adding flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received. + Should Be Equal As Strings ${resp.status_code} 200 msg=${msg} + Delete Flow - ${resp}= Delete session /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} - ${msg}= Set Variable Delete flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received. - Should Be Equal As Strings ${resp.status_code} 200 msg=${msg} + ${resp}= Delete session /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} + ${msg}= Set Variable Delete flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received. + Should Be Equal As Strings ${resp.status_code} 200 msg=${msg} + Delete All Flows - [Documentation] Deletes all flows - :FOR ${flowfile} IN @{xml_files} - \ Log ${flowfile} - \ Init Flow Variables ${flowfile} - \ Delete Flow + [Documentation] Deletes all flows + : FOR ${flowfile} IN @{xml_files} + \ Log ${flowfile} + \ Init Flow Variables ${flowfile} + \ Delete Flow + Initialization Phase - [Documentation] Initiate tcp connection with controller - Create Session session http://${CONTROLLER}:${PORT} auth=${AUTH} headers=${HEADERS_XML} + [Documentation] Initiate tcp connection with controller + Create Session session http://${CONTROLLER}:${PORT} auth=${AUTH} headers=${HEADERS_XML} + Teardown Phase - [Documentation] Closes tcp connection with controller and removes flows - Delete All Sessions -Get Presence Failure Message [Arguments] ${ds} ${expected} ${presence} ${diffmsg} - Return From Keyword If '''${diffmsg}'''!='${EMPTY}' Flow found in ${ds} data store but: ${diffmsg} - ${msgf}= Set Variable If ${expected}==${True} The flow is expected in operational data store, but The flow is not expected in operational data store, but - ${msgp}= Set Variable If ${presence}==${True} it is present. it is not present. - Return From Keyword ${msgf} ${msgp} + [Documentation] Closes tcp connection with controller and removes flows + Delete All Sessions + +Get Presence Failure Message + [Arguments] ${ds} ${expected} ${presence} ${diffmsg} + Return From Keyword If '''${diffmsg}'''!='${EMPTY}' Flow found in ${ds} data store but: ${diffmsg} + ${msgf}= Set Variable If ${expected}==${True} The flow is expected in operational data store, but The flow is not expected in operational data store, but + ${msgp}= Set Variable If ${presence}==${True} it is present. it is not present. + Return From Keyword ${msgf} ${msgp} diff --git a/test/csit/suites/karaf-compatible/075__Flows_OF13_Stat_Manager/__init__.txt b/test/csit/suites/karaf-compatible/075__Flows_OF13_Stat_Manager/__init__.txt index e1c2c2381f..3a8e9b7fba 100644 --- a/test/csit/suites/karaf-compatible/075__Flows_OF13_Stat_Manager/__init__.txt +++ b/test/csit/suites/karaf-compatible/075__Flows_OF13_Stat_Manager/__init__.txt @@ -3,27 +3,8 @@ Documentation Test suite for the OpenDaylight base edition with of13, aimed Suite Setup Start Suite Suite Teardown Stop Suite Library SSHLibrary +Resource ../../../libraries/Utils.txt *** Variables *** -${start} sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,1 --switch ovsk,protocols=OpenFlow13 *** Keywords *** -Start Suite - Log Start the test on the base edition - Open Connection ${MININET} prompt=> - Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any - Write sudo ovs-vsctl set-manager ptcp:6644 - Write sudo mn -c - Sleep 2 - Write ${start} - Sleep 20 - Read - -Stop Suite - Log Stop the test on the base edition - Read - Write exit - Sleep 2 - Read - Close Connection - diff --git a/test/csit/suites/karaf-compatible/080__Inventory_Performance/010__restconf_inventory.txt b/test/csit/suites/karaf-compatible/080__Inventory_Performance/010__restconf_inventory.txt index e2c038aa37..fd1aba32d9 100644 --- a/test/csit/suites/karaf-compatible/080__Inventory_Performance/010__restconf_inventory.txt +++ b/test/csit/suites/karaf-compatible/080__Inventory_Performance/010__restconf_inventory.txt @@ -1,6 +1,6 @@ *** Settings *** Documentation Test suite for RESTCONF inventory -Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML} +Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML} Suite Teardown Delete All Sessions Library Collections Library ../../../libraries/RequestsLibrary.py @@ -10,48 +10,59 @@ Variables ../../../variables/Variables.py *** Variables *** ${REST_CONTEXT} /restconf/operational/opendaylight-inventory:nodes - -*** Test Cases *** +*** Test Cases *** Get list of nodes [Documentation] Get the inventory - ${resp} Get session ${REST_CONTEXT} + ${resp} Get session ${REST_CONTEXT} + Log ${resp.content} Should Be Equal As Strings ${resp.status_code} 200 - ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH} - ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} - ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT} - :FOR ${IND} IN RANGE 1 ${numnodes+1} - \ Should Contain ${resp.content} openflow:${IND} + ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH} + ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} + ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT} + : FOR ${IND} IN RANGE 1 ${numnodes+1} + \ Wait Until Keyword Succeeds 30s 2s Should Contain ${resp.content} openflow:${IND} -Get nodeconnector for the root node +Get nodeconnector for the root node [Documentation] Get the inventory for the root node - ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} + ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} ${resp} Get session ${REST_CONTEXT}/node/openflow:1 - Should Be Equal As Strings ${resp.status_code} 200 - Check conn loop ${TOPO_TREE_FANOUT} 1 ${resp.content} + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 + Wait Until Keyword Succeeds 30s 2s Check conn loop ${TOPO_TREE_FANOUT} 1 ${resp.content} -Get nodeconnector for a node +Get nodeconnector for a node [Documentation] Get the inventory for a node - ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH} - ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} - ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT} - :FOR ${IND} IN RANGE 2 ${numnodes+1} - \ ${resp} Get session ${REST_CONTEXT}/node/openflow:${IND} - \ Should Be Equal As Strings ${resp.status_code} 200 - \ Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.content} + ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH} + ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} + ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT} + Wait Until Keyword Succeeds 30s 2s Check Every Nodes Nodeconnector ${numnodes} Get Stats for a node [Documentation] Get the stats for a node - ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH} - ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} - ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT} - :FOR ${IND} IN RANGE 1 ${numnodes+1} - \ ${resp} Get session ${REST_CONTEXT}/node/openflow:${IND} - \ Should Be Equal As Strings ${resp.status_code} 200 - \ Should Contain ${resp.content} flow-capable-node-connector-statistics - \ Should Contain ${resp.content} flow-table-statistics + ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH} + ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} + ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT} + Wait Until Keyword Succeeds 60s 2s Check Every Nodes Stats ${numnodes} *** Keywords *** +Check Every Nodes Stats + [Arguments] ${numnodes} + : FOR ${IND} IN RANGE 1 ${numnodes+1} + \ ${resp} Get session ${REST_CONTEXT}/node/openflow:${IND} + \ Log ${resp.content} + \ Should Be Equal As Strings ${resp.status_code} 200 + \ Should Contain ${resp.content} flow-capable-node-connector-statistics + \ Should Contain ${resp.content} flow-table-statistics + +Check Every Nodes Nodeconnector + [Arguments] ${numnodes} + : FOR ${IND} IN RANGE 2 ${numnodes+1} + \ ${resp} Get session ${REST_CONTEXT}/node/openflow:${IND} + \ Log ${resp.content} + \ Should Be Equal As Strings ${resp.status_code} 200 + \ Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.content} + Check conn loop - [Arguments] ${arg} ${outerind} ${content} - :FOR ${var} IN RANGE 1 ${arg+1} - \ Should Contain ${content} openflow:${outerind}:${var} + [Arguments] ${arg} ${outerind} ${content} + : FOR ${var} IN RANGE 1 ${arg+1} + \ Should Contain ${content} openflow:${outerind}:${var} diff --git a/test/csit/suites/karaf-compatible/080__Inventory_Performance/015__restconf_topology.txt b/test/csit/suites/karaf-compatible/080__Inventory_Performance/015__restconf_topology.txt index ef1d359d95..b6b52bb26a 100644 --- a/test/csit/suites/karaf-compatible/080__Inventory_Performance/015__restconf_topology.txt +++ b/test/csit/suites/karaf-compatible/080__Inventory_Performance/015__restconf_topology.txt @@ -1,6 +1,6 @@ *** Settings *** Documentation Test suite for RESTCONF topology -Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML} +Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML} Suite Teardown Delete All Sessions Library Collections Library XML @@ -11,24 +11,27 @@ Variables ../../../variables/Variables.py *** Variables *** ${REST_CONTEXT} /restconf/operational/network-topology:network-topology/topology/flow:1 - -*** Test Cases *** +*** Test Cases *** Get Nodes Count [Documentation] Checks the number of switches - ${resp} Get session ${REST_CONTEXT} headers=${ACCEPT_XML} - Should Be Equal As Strings ${resp.status_code} 200 - ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH} - ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} - ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT} - ${count}= Get Element Count ${resp.content} xpath=node - Should Be Equal As Numbers ${count} ${numnodes} + ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH} + ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} + ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT} + Wait Until Keyword Succeeds 60s 2s Verify Element Count ${REST_CONTEXT} node ${numnodes} + Get Links Count [Documentation] Checks the number of links - ${resp} Get session ${REST_CONTEXT} headers=${ACCEPT_XML} - Should Be Equal As Strings ${resp.status_code} 200 - ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH} - ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} - ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT} - ${numlinks} Evaluate (${numnodes}-1)*2 - ${count}= Get Element Count ${resp.content} xpath=link - Should Be Equal As Numbers ${count} ${numlinks} + ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH} + ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} + ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT} + ${numlinks} Evaluate (${numnodes}-1)*2 + Wait Until Keyword Succeeds 60s 2s Verify Element Count ${REST_CONTEXT} link ${numlinks} + +*** Keywords *** +Verify Element Count + [Arguments] ${URI} ${xpath_location} ${expected_count} + ${resp} Get session ${REST_CONTEXT} headers=${ACCEPT_XML} + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 + ${count}= Get Element Count ${resp.content} xpath=${xpath_location} + Should Be Equal As Numbers ${count} ${expected_count} diff --git a/test/csit/suites/karaf-compatible/080__Inventory_Performance/020__switch_manager.txt b/test/csit/suites/karaf-compatible/080__Inventory_Performance/020__switch_manager.txt index 841a85de26..cb5f481f78 100644 --- a/test/csit/suites/karaf-compatible/080__Inventory_Performance/020__switch_manager.txt +++ b/test/csit/suites/karaf-compatible/080__Inventory_Performance/020__switch_manager.txt @@ -13,39 +13,44 @@ Library ../../../libraries/Topologynew.py ${REST_CONTEXT} /controller/nb/v2/switchmanager *** Test Cases *** - List all nodes [Documentation] List all nodes and their properties in the network. [Tags] list_info Log ${TOPO_TREE_LEVEL} ${topo_nodes} Get Nodes From Tree Topo (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT}) ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/default/nodes - Should Be Equal As Strings ${resp.status_code} 200 Response status code error + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 Response status code error ${jsondata}= To JSON ${resp.content} ${nodes} Extract All Nodes ${jsondata} - List Should Contain Sublist ${nodes} ${topo_nodes} + List Should Contain Sublist ${nodes} ${topo_nodes} -Check root node connectors +Check root node connectors [Documentation] List node connectors and verify all connectors are there [Tags] list_info ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/default/node/OF/00:00:00:00:00:00:00:01 - Should Be Equal As Strings ${resp.status_code} 200 Response status code error - ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} - Check conn loop ${TOPO_TREE_FANOUT} 1 ${resp.content} + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 Response status code error + ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} + Check conn loop ${TOPO_TREE_FANOUT} 1 ${resp.content} -Check node i connectors - [Documentation] List node connectors and verify all connectors are there +Check node i connectors + [Documentation] List node connectors and verify all connectors are there [Tags] list_info - ${topo_nodes} Get Nodes From Tree Topo (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT}) 1 - :FOR ${ITEM} IN @{topo_nodes} - \ ${IND} Get From Dictionary ${ITEM} id - \ ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/default/node/OF/${IND} - \ Should Be Equal As Strings ${resp.status_code} 200 - \ Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.content} + ${topo_nodes} Get Nodes From Tree Topo (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT}) 1 + Wait Until Keyword Succeeds 30s 2s Check Every Nodes Connectors ${topo_nodes} *** Keywords *** -Check conn loop - [Arguments] ${arg} ${outerind} ${content} - :FOR ${var} IN RANGE 0 ${arg+1} - \ Should Contain ${content} "id":"${var}" +Check Every Nodes Connectors + [Arguments] ${topo_nodes} + : FOR ${ITEM} IN @{topo_nodes} + \ ${IND} Get From Dictionary ${ITEM} id + \ ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/default/node/OF/${IND} + \ Log ${resp.content} + \ Should Be Equal As Strings ${resp.status_code} 200 + \ Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.content} +Check conn loop + [Arguments] ${arg} ${outerind} ${content} + : FOR ${var} IN RANGE 0 ${arg+1} + \ Should Contain ${content} "id":"${var}" diff --git a/test/csit/suites/karaf-compatible/080__Inventory_Performance/030__statistics_manager.txt b/test/csit/suites/karaf-compatible/080__Inventory_Performance/030__statistics_manager.txt index 790e59a7a6..c39df77215 100644 --- a/test/csit/suites/karaf-compatible/080__Inventory_Performance/030__statistics_manager.txt +++ b/test/csit/suites/karaf-compatible/080__Inventory_Performance/030__statistics_manager.txt @@ -1,48 +1,66 @@ *** Settings *** Documentation Test suite for Statistics Manager -Suite Setup Create Session session http://${CONTROLLER}:${RESTPORT} auth=${AUTH} headers=${HEADERS} +Suite Setup Create Session session http://${CONTROLLER}:${RESTPORT} auth=${AUTH} headers=${HEADERS} Suite Teardown Delete All Sessions Library Collections Library ../../../libraries/RequestsLibrary.py Library ../../../libraries/Common.py Library ../../../libraries/Topologynew.py Variables ../../../variables/Variables.py +Resource ../../../libraries/Utils.txt *** Variables *** -${nodeprefix} openflow: -${key} portStatistics +${nodeprefix} openflow: +${key} portStatistics ${REST_CONTEXT} /controller/nb/v2/statistics *** Test Cases *** get port stats [Documentation] Show port stats and validate result [Tags] get - ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/port - Should Be Equal As Strings ${resp.status_code} 200 - ${topo_nodes} Get Nodes From Tree Topo (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT}) 1 - Should Contain X Times ${resp.content} "00:00:00:00:00:00:00:01" ${TOPO_TREE_FANOUT+2} - :FOR ${ITEM} IN @{topo_nodes} - \ ${IND} Get From Dictionary ${ITEM} id - \ Should Contain X Times ${resp.content} "${IND}" ${TOPO_TREE_FANOUT+3} + ${topo_nodes} Get Nodes From Tree Topo (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT}) 1 + @{node_list} Create Nodes List ${topo_nodes} + Wait Until Keyword Succeeds 70s 2s Check For Elements At URI ${REST_CONTEXT}/${CONTAINER}/port ${node_list} get flow stats [Documentation] Show flow stats and validate result [Tags] get - ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/flow - Should Be Equal As Strings ${resp.status_code} 200 - ${topo_nodes} Get Nodes From Tree Topo (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT}) - :FOR ${ITEM} IN @{topo_nodes} - \ ${IND} Get From Dictionary ${ITEM} id - \ Should Contain ${resp.content} "${IND}" + ${topo_nodes} Get Nodes From Tree Topo (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT}) + @{node_list} Create Nodes List ${topo_nodes} + Wait Until Keyword Succeeds 70s 2s Check For Elements At URI ${REST_CONTEXT}/${CONTAINER}/flow ${node_list} get table stats [Documentation] Show flow stats and validate result [Tags] get - ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/table - Should Be Equal As Strings ${resp.status_code} 200 ${topo_nodes} Get Nodes From Tree Topo (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT}) - :FOR ${ITEM} IN @{topo_nodes} - \ ${IND} Get From Dictionary ${ITEM} id - \ Should Contain ${resp.content} "${IND}" + @{node_list} Create Nodes List ${topo_nodes} + Wait Until Keyword Succeeds 70s 2s Check For Elements At URI ${REST_CONTEXT}/${CONTAINER}/table ${node_list} + +*** Keywords *** +Check For Correct Number Of Nodes At URI + [Arguments] ${uri} ${topo_nodes} + ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/${uri} + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain X Times ${resp.content} "00:00:00:00:00:00:00:01" ${TOPO_TREE_FANOUT+2} + : FOR ${ITEM} IN @{topo_nodes} + \ ${IND} Get From Dictionary ${ITEM} id + \ Should Contain X Times ${resp.content} "${IND}" ${TOPO_TREE_FANOUT+3} + +Check For All Nodes At URI + [Arguments] ${uri} ${topo_nodes} + ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/${uri} + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 + : FOR ${ITEM} IN @{topo_nodes} + \ ${IND} Get From Dictionary ${ITEM} id + \ Should Contain ${resp.content} "${IND}" - +Create Nodes List + [Arguments] ${topo_dict} + ##init list + @{node_list}= Create List + : FOR ${ITEM} IN @{topo_dict} + \ ${IND} Get From Dictionary ${ITEM} id + \ Append To List ${node_list} ${IND} + [Return] @{node_list} diff --git a/test/csit/suites/karaf-compatible/080__Inventory_Performance/040__topology_manager.txt b/test/csit/suites/karaf-compatible/080__Inventory_Performance/040__topology_manager.txt index d510c46025..de58db5764 100644 --- a/test/csit/suites/karaf-compatible/080__Inventory_Performance/040__topology_manager.txt +++ b/test/csit/suites/karaf-compatible/080__Inventory_Performance/040__topology_manager.txt @@ -1,6 +1,6 @@ *** Settings *** Documentation Test suite for Topology Manager -Suite Setup Create Session session http://${CONTROLLER}:${RESTPORT} auth=${AUTH} headers=${HEADERS} +Suite Setup Create Session session http://${CONTROLLER}:${RESTPORT} auth=${AUTH} headers=${HEADERS} Suite Teardown Delete All Sessions Library Collections Library ../../../libraries/RequestsLibrary.py @@ -9,24 +9,27 @@ Library ../../../libraries/Topologynew.py Variables ../../../variables/Variables.py *** Variables *** -${nodeprefix} openflow: +${nodeprefix} openflow: ${REST_CONTEXT} /controller/nb/v2/topology *** Test Cases *** Get Topology [Documentation] Get Topology and validate the result. [Tags] get + ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH} + ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} + ${leaflist} Get Ids Of Leaf Nodes ${TOPO_TREE_FANOUT} ${TOPO_TREE_DEPTH} + ${topo_nodes} Get Nodes From Tree Topo (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT}) 1 + Wait Until Keyword Succeeds 30s 2s Check Link Counts For Each Node ${topo_nodes} ${leaflist} + +*** Keywords *** +Check Link Counts For Each Node + [Arguments] ${topo_nodes} ${leaflist} ${resp} Get session ${REST_CONTEXT}/${CONTAINER} - Should Be Equal As Strings ${resp.status_code} 200 Log ${resp.content} - ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH} - ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} - Should Contain X Times ${resp.content} "00:00:00:00:00:00:00:01" ${TOPO_TREE_FANOUT*2} - ${leaflist} Get Ids Of Leaf Nodes ${TOPO_TREE_FANOUT} ${TOPO_TREE_DEPTH} - ${topo_nodes} Get Nodes From Tree Topo (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT}) 1 - :FOR ${ITEM} IN @{topo_nodes} - \ ${IND} Get From Dictionary ${ITEM} id - \ ${linkcnt} Num Of Links For Node ${IND} ${leaflist} ${TOPO_TREE_FANOUT} - \ Should Contain X Times ${resp.content} "${IND}" ${linkcnt*2} - - + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain X Times ${resp.content} "00:00:00:00:00:00:00:01" ${TOPO_TREE_FANOUT*2} + : FOR ${ITEM} IN @{topo_nodes} + \ ${IND} Get From Dictionary ${ITEM} id + \ ${linkcnt} Num Of Links For Node ${IND} ${leaflist} ${TOPO_TREE_FANOUT} + \ Should Contain X Times ${resp.content} "${IND}" ${linkcnt*2} diff --git a/test/csit/suites/karaf-compatible/080__Inventory_Performance/050__ping_test.txt b/test/csit/suites/karaf-compatible/080__Inventory_Performance/050__ping_test.txt index 204634104a..348ff96c74 100644 --- a/test/csit/suites/karaf-compatible/080__Inventory_Performance/050__ping_test.txt +++ b/test/csit/suites/karaf-compatible/080__Inventory_Performance/050__ping_test.txt @@ -11,12 +11,11 @@ Variables ../../../variables/Variables.py *** Test Cases *** Ping all [Documentation] Do ping all test, verify no packet loss - [Tags] pingall - ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH} - ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} - ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT} - Write pingall - Sleep ${numnodes} + [Tags] pingall + ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH} + ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} + ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT} + Write pingall + Sleep ${numnodes} ${result} Read - Should Not Contain ${result} X - + Should Not Contain ${result} X diff --git a/test/csit/suites/karaf-compatible/080__Inventory_Performance/__init__.txt b/test/csit/suites/karaf-compatible/080__Inventory_Performance/__init__.txt index b295c01cb9..47d0a79084 100644 --- a/test/csit/suites/karaf-compatible/080__Inventory_Performance/__init__.txt +++ b/test/csit/suites/karaf-compatible/080__Inventory_Performance/__init__.txt @@ -2,35 +2,30 @@ Documentation Test suite for MD-SAL NSF Suite Setup Start Suite Suite Teardown Stop Suite -Library SSHLibrary -Library ../../../libraries/Common.py -Variables ../../../variables/Variables.py +Library SSHLibrary +Library ../../../libraries/Common.py +Variables ../../../variables/Variables.py *** Variables *** +${start} sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT} -${start}= sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT} - -** Keywords *** -Start Suite +*** Keywords *** +Start Suite Log Start mininet ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} - ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT} - Open Connection ${MININET} prompt=> - Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any + ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT} + Open Connection ${MININET} prompt=> timeout=${numnodes*2+30} + Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any Write sudo ovs-vsctl set-manager ptcp:6644 Write sudo mn -c - Sleep 2 + Read Until > Write ${start} - Sleep ${numnodes*2+30} - Read + Read Until mininet> + Stop Suite Log Stop mininet - ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH} - ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} - ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT} Read - Write exit - Sleep ${numnodes*2} - Read - Close Connection + Write exit + Read Until > + Close Connection diff --git a/test/csit/suites/karaf-compatible/090__OVSDB/__init__.txt b/test/csit/suites/karaf-compatible/090__OVSDB/__init__.txt index 278306451f..4feeb8805f 100644 --- a/test/csit/suites/karaf-compatible/090__OVSDB/__init__.txt +++ b/test/csit/suites/karaf-compatible/090__OVSDB/__init__.txt @@ -3,25 +3,10 @@ Documentation Test suite for OVSDB Suite Setup Start Suite Suite Teardown Stop Suite Library SSHLibrary +Resource ../../../libraries/Utils.txt + *** Variables *** ${start}= sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 ** Keywords *** -Start Suite - Log Start mininet - Open Connection ${MININET} prompt=> - Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any - Write sudo ovs-vsctl set-manager ptcp:6644 - Write sudo mn -c - Sleep 2 - Write ${start} - Sleep 20 - Read -Stop Suite - Log Stop mininet - Read - Write exit - Sleep 6 - Read - Close Connection diff --git a/test/csit/suites/karaf-compatible/100__OVSDB_OF13/__init__.txt b/test/csit/suites/karaf-compatible/100__OVSDB_OF13/__init__.txt index a6e6479ca3..f04089e657 100644 --- a/test/csit/suites/karaf-compatible/100__OVSDB_OF13/__init__.txt +++ b/test/csit/suites/karaf-compatible/100__OVSDB_OF13/__init__.txt @@ -3,25 +3,9 @@ Documentation Test suite for OVSDB mininet OF13 Suite Setup Start Suite Suite Teardown Stop Suite Library SSHLibrary +Resource ../../../libraries/Utils.txt *** Variables *** ${start}= sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 --switch ovsk,protocols=OpenFlow13 ** Keywords *** -Start Suite - Log Start mininet - Open Connection ${MININET} prompt=> - Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any - Write sudo ovs-vsctl set-manager ptcp:6644 - Write sudo mn -c - Sleep 2 - Write ${start} - Sleep 20 - Read -Stop Suite - Log Stop mininet - Read - Write exit - Sleep 6 - Read - Close Connection