From 704f750dcf96793322cff861e0e4ad09ea92f77a Mon Sep 17 00:00:00 2001 From: Luis Gomez Date: Thu, 15 May 2014 17:15:44 -0700 Subject: [PATCH] Adding extra TCs for RESTCONF Change-Id: I51a4adcbba7f28d924ffb1a1c042f66c23ee0f7f Signed-off-by: Luis Gomez --- ...entory.txt => 002__restconf_inventory.txt} | 0 .../base-of13/004__restconf_statistics.txt | 33 ++++++++ .../base-of13/006__restconf_topology.txt | 77 +++++++++++++++++++ ...entory.txt => 102__restconf_inventory.txt} | 0 .../base-of13/104__restconf_statistics.txt | 33 ++++++++ .../base-of13/106__restconf_topology.txt | 77 +++++++++++++++++++ 6 files changed, 220 insertions(+) rename test/csit/suites/base-of13/{005__restconf_inventory.txt => 002__restconf_inventory.txt} (100%) create mode 100644 test/csit/suites/base-of13/004__restconf_statistics.txt create mode 100644 test/csit/suites/base-of13/006__restconf_topology.txt rename test/csit/suites/base-of13/{105__restconf_inventory.txt => 102__restconf_inventory.txt} (100%) create mode 100644 test/csit/suites/base-of13/104__restconf_statistics.txt create mode 100644 test/csit/suites/base-of13/106__restconf_topology.txt diff --git a/test/csit/suites/base-of13/005__restconf_inventory.txt b/test/csit/suites/base-of13/002__restconf_inventory.txt similarity index 100% rename from test/csit/suites/base-of13/005__restconf_inventory.txt rename to test/csit/suites/base-of13/002__restconf_inventory.txt diff --git a/test/csit/suites/base-of13/004__restconf_statistics.txt b/test/csit/suites/base-of13/004__restconf_statistics.txt new file mode 100644 index 0000000000..d83453ed24 --- /dev/null +++ b/test/csit/suites/base-of13/004__restconf_statistics.txt @@ -0,0 +1,33 @@ +*** Settings *** +Documentation Test suite for RESTCONF statistics +Suite Setup Create Session session http://${CONTROLLER}:8080 auth=${AUTH} headers=${HEADERS_XML} +Suite Teardown Delete All Sessions +Library Collections +Library ../../libraries/RequestsLibrary.py +Library ../../libraries/Common.py +Variables ../../variables/Variables.py + +*** Variables *** +${REST_CONTEXT} /restconf/operational/opendaylight-inventory:nodes + +*** 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} opendaylight-port-statistics + Should Contain ${resp.content} opendaylight-flow-table-statistics + +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} opendaylight-port-statistics + Should Contain ${resp.content} opendaylight-flow-table-statistics + +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} opendaylight-port-statistics + Should Contain ${resp.content} opendaylight-flow-table-statistics diff --git a/test/csit/suites/base-of13/006__restconf_topology.txt b/test/csit/suites/base-of13/006__restconf_topology.txt new file mode 100644 index 0000000000..99d8d44dee --- /dev/null +++ b/test/csit/suites/base-of13/006__restconf_topology.txt @@ -0,0 +1,77 @@ +*** Settings *** +Documentation Test suite for MD-SAL based Topology Manager +Suite Setup Create Session session http://${CONTROLLER}:8080 auth=${AUTH} headers=${HEADERS} +Suite Teardown Delete All Sessions +Library Collections +Library ../../libraries/RequestsLibrary.py +Library ../../libraries/Common.py +Variables ../../variables/Variables.py + +*** Variables *** +${topology1} "flow:1" +${node1} "openflow:1" +${node2} "openflow:2" +${node3} "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 + +*** Test Cases *** +Get RESTCONF Topology + [Documentation] Get RESTCONF Topology and validate the result. + [Tags] get + ${resp} Get session ${REST_CONTEXT_1} + Should Be Equal As Strings ${resp.status_code} 200 + Log ${resp.content} + 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} + ${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} + ${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} + ${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} + +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} + ${links} Create List ${body3} + ${body} Create Dictionary link=${links} + ${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 + ${result} To JSON ${resp.content} + ${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} + Should Be Equal As Strings ${resp.status_code} 200 + ${resp} Get session ${REST_CONTEXT_3} + Should Be Equal As Strings ${resp.status_code} 404 diff --git a/test/csit/suites/base-of13/105__restconf_inventory.txt b/test/csit/suites/base-of13/102__restconf_inventory.txt similarity index 100% rename from test/csit/suites/base-of13/105__restconf_inventory.txt rename to test/csit/suites/base-of13/102__restconf_inventory.txt diff --git a/test/csit/suites/base-of13/104__restconf_statistics.txt b/test/csit/suites/base-of13/104__restconf_statistics.txt new file mode 100644 index 0000000000..d83453ed24 --- /dev/null +++ b/test/csit/suites/base-of13/104__restconf_statistics.txt @@ -0,0 +1,33 @@ +*** Settings *** +Documentation Test suite for RESTCONF statistics +Suite Setup Create Session session http://${CONTROLLER}:8080 auth=${AUTH} headers=${HEADERS_XML} +Suite Teardown Delete All Sessions +Library Collections +Library ../../libraries/RequestsLibrary.py +Library ../../libraries/Common.py +Variables ../../variables/Variables.py + +*** Variables *** +${REST_CONTEXT} /restconf/operational/opendaylight-inventory:nodes + +*** 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} opendaylight-port-statistics + Should Contain ${resp.content} opendaylight-flow-table-statistics + +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} opendaylight-port-statistics + Should Contain ${resp.content} opendaylight-flow-table-statistics + +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} opendaylight-port-statistics + Should Contain ${resp.content} opendaylight-flow-table-statistics diff --git a/test/csit/suites/base-of13/106__restconf_topology.txt b/test/csit/suites/base-of13/106__restconf_topology.txt new file mode 100644 index 0000000000..99d8d44dee --- /dev/null +++ b/test/csit/suites/base-of13/106__restconf_topology.txt @@ -0,0 +1,77 @@ +*** Settings *** +Documentation Test suite for MD-SAL based Topology Manager +Suite Setup Create Session session http://${CONTROLLER}:8080 auth=${AUTH} headers=${HEADERS} +Suite Teardown Delete All Sessions +Library Collections +Library ../../libraries/RequestsLibrary.py +Library ../../libraries/Common.py +Variables ../../variables/Variables.py + +*** Variables *** +${topology1} "flow:1" +${node1} "openflow:1" +${node2} "openflow:2" +${node3} "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 + +*** Test Cases *** +Get RESTCONF Topology + [Documentation] Get RESTCONF Topology and validate the result. + [Tags] get + ${resp} Get session ${REST_CONTEXT_1} + Should Be Equal As Strings ${resp.status_code} 200 + Log ${resp.content} + 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} + ${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} + ${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} + ${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} + +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} + ${links} Create List ${body3} + ${body} Create Dictionary link=${links} + ${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 + ${result} To JSON ${resp.content} + ${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} + Should Be Equal As Strings ${resp.status_code} 200 + ${resp} Get session ${REST_CONTEXT_3} + Should Be Equal As Strings ${resp.status_code} 404 -- 2.36.6