From 25e0b5b6496c79278fffb8701c04a6e70f7c49ff Mon Sep 17 00:00:00 2001 From: Luis Gomez Date: Sun, 1 Dec 2013 04:14:06 -0800 Subject: [PATCH] Create stats mgr + Complete some test cases with mininet + fix test file names Change-Id: If337c3ce050f392a0760788b70ddd96ec44fcc66 Signed-off-by: Luis Gomez --- .../suites/base/010__statistics_manager.txt | 54 ++++++++++++++++ ..._manager.txt => 015__topology_manager.txt} | 7 +-- ....txt => 020__forwarding_rules_manager.txt} | 5 +- ...host_tracker.txt => 025__host_tracker.txt} | 5 +- test/csit/suites/base/025_arp_handler.txt | 41 ------------ test/csit/suites/base/030__arp_handler.txt | 62 +++++++++++++++++++ ...anager.txt => 035__forwarding_manager.txt} | 5 +- ...OVSDB_plugin.txt => 050__OVSDB_plugin.txt} | 12 +++- 8 files changed, 130 insertions(+), 61 deletions(-) create mode 100644 test/csit/suites/base/010__statistics_manager.txt rename test/csit/suites/base/{010_topology_manager.txt => 015__topology_manager.txt} (85%) rename test/csit/suites/base/{015_forwarding_rules_manager.txt => 020__forwarding_rules_manager.txt} (87%) rename test/csit/suites/base/{020_host_tracker.txt => 025__host_tracker.txt} (86%) delete mode 100644 test/csit/suites/base/025_arp_handler.txt create mode 100644 test/csit/suites/base/030__arp_handler.txt rename test/csit/suites/base/{030_forwarding_manager.txt => 035__forwarding_manager.txt} (84%) rename test/csit/suites/base/{050_OVSDB_plugin.txt => 050__OVSDB_plugin.txt} (95%) diff --git a/test/csit/suites/base/010__statistics_manager.txt b/test/csit/suites/base/010__statistics_manager.txt new file mode 100644 index 0000000000..3b2e789926 --- /dev/null +++ b/test/csit/suites/base/010__statistics_manager.txt @@ -0,0 +1,54 @@ +*** Settings *** +Documentation Test suite for the statistics manager module +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 *** +${node1} "node":{"type":"OF","id":"00:00:00:00:00:00:00:01"} +${node2} "node":{"type":"OF","id":"00:00:00:00:00:00:00:02"} +${node3} "node":{"type":"OF","id":"00:00:00:00:00:00:00:03"} +${nodeconn1} "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:01"},"id":"1"} +${nodeconn2} "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:01"},"id":"2"} +${nodeconn3} "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:02"},"id":"1"} +${nodeconn4} "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:02"},"id":"2"} +${nodeconn5} "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:02"},"id":"3"} +${nodeconn6} "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:03"},"id":"1"} +${nodeconn7} "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:03"},"id":"2"} +${nodeconn8} "nodeConnector":{"type":"OF","node":{"type":"OF","id":"00:00:00:00:00:00:00:03"},"id":"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 Contain ${resp.content} ${nodeconn1} + Should Contain ${resp.content} ${nodeconn2} + Should Contain ${resp.content} ${nodeconn3} + Should Contain ${resp.content} ${nodeconn4} + Should Contain ${resp.content} ${nodeconn5} + Should Contain ${resp.content} ${nodeconn6} + Should Contain ${resp.content} ${nodeconn7} + Should Contain ${resp.content} ${nodeconn8} +get flow stats + [Documentation] Show flow stats and validate result + [Tags] get + ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/flow + Should Contain ${resp.content} ${node1} + Should Contain ${resp.content} ${node2} + Should Contain ${resp.content} ${node3} +get table stats + [Documentation] Show flow stats and validate result + [Tags] get + ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/table + Should Contain ${resp.content} ${node1} + Should Contain ${resp.content} ${node2} + Should Contain ${resp.content} ${node3} + + diff --git a/test/csit/suites/base/010_topology_manager.txt b/test/csit/suites/base/015__topology_manager.txt similarity index 85% rename from test/csit/suites/base/010_topology_manager.txt rename to test/csit/suites/base/015__topology_manager.txt index 1b12f4c628..e9ae23aa5f 100644 --- a/test/csit/suites/base/010_topology_manager.txt +++ b/test/csit/suites/base/015__topology_manager.txt @@ -1,5 +1,6 @@ *** Settings *** Documentation Test suite for 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 @@ -19,8 +20,6 @@ ${REST_CONTEXT} /controller/nb/v2/topology Get Topology [Documentation] Get Topology and validate the result. [Tags] get - ${headers} Create Dictionary Content-Type application/json - Create Session session http://${CONTROLLER}:8080 headers=${headers} auth=${auth} ${resp} Get session ${REST_CONTEXT}/${CONTAINER} Should Be Equal As Strings ${resp.status_code} 200 Response status code error Log ${resp.content} @@ -33,8 +32,6 @@ Add a userlink [Tags] add ${body} Create Dictionary name ${name} status Success srcNodeConnector ... OF|1@OF|00:00:00:00:00:00:00:02 dstNodeConnector OF|1@OF|00:00:00:00:00:00:00:03 - ${headers} Create Dictionary Content-Type application/json - Create Session session http://${CONTROLLER}:8080 headers=${headers} auth=${auth} ${resp} Put session ${REST_CONTEXT}/${CONTAINER}/userLink/${name} data=${body} Should Be Equal As Strings ${resp.status_code} 201 Response status code error ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/userLinks @@ -48,8 +45,6 @@ Remove a userlink [Tags] remove ${body} Create Dictionary name ${name} status Success srcNodeConnector ... OF|1@OF|00:00:00:00:00:00:00:02 dstNodeConnector OF|1@OF|00:00:00:00:00:00:00:03 - ${headers} Create Dictionary Content-Type application/json - Create Session session http://${CONTROLLER}:8080 headers=${headers} auth=${auth} ${resp} Delete session ${REST_CONTEXT}/${CONTAINER}/userLink/${name} Should Be Equal As Strings ${resp.status_code} 204 Response status code error ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/userLinks diff --git a/test/csit/suites/base/015_forwarding_rules_manager.txt b/test/csit/suites/base/020__forwarding_rules_manager.txt similarity index 87% rename from test/csit/suites/base/015_forwarding_rules_manager.txt rename to test/csit/suites/base/020__forwarding_rules_manager.txt index 88c2fa5eb7..1dcb2a4838 100644 --- a/test/csit/suites/base/015_forwarding_rules_manager.txt +++ b/test/csit/suites/base/020__forwarding_rules_manager.txt @@ -1,5 +1,6 @@ *** Settings *** Documentation Test suite for the forwarding rule manager module. +Suite Setup Create Session session http://${CONTROLLER}:8080 auth=${AUTH} headers=${HEADERS} Suite Teardown Delete All Sessions Library Collections Library ../../libraries/RequestsLibrary.py @@ -21,8 +22,6 @@ Add a flow ${body} Create Dictionary name ${name} installInHw true node ... ${node} priority 1 etherType 0x800 nwDst ... 10.0.0.1/32 actions ${actions} - ${headers} Create Dictionary Content-Type application/json - Create Session session http://${CONTROLLER}:8080 headers=${headers} auth=${auth} ${resp} Put session ${REST_CONTEXT}/${CONTAINER}/node/OF/${node_id}/staticFlow/${name} data=${body} Should Be Equal As Strings ${resp.status_code} 201 Response status code error ${resp} Get session ${REST_CONTEXT}/${CONTAINER} @@ -39,8 +38,6 @@ Remove a flow ${body} Create Dictionary name ${name} installInHw true node ... ${node} priority 1 etherType 0x800 nwDst ... 10.0.0.1/32 actions ${actions} - ${headers} Create Dictionary Content-Type application/json - Create Session session http://${CONTROLLER}:8080 headers=${headers} auth=${auth} ${resp} Delete session ${REST_CONTEXT}/${CONTAINER}/node/OF/${node_id}/staticFlow/${name} Should Be Equal As Strings ${resp.status_code} 204 Response status code error ${resp} Get session ${REST_CONTEXT}/${CONTAINER} diff --git a/test/csit/suites/base/020_host_tracker.txt b/test/csit/suites/base/025__host_tracker.txt similarity index 86% rename from test/csit/suites/base/020_host_tracker.txt rename to test/csit/suites/base/025__host_tracker.txt index a01f73b409..f82715f1cd 100644 --- a/test/csit/suites/base/020_host_tracker.txt +++ b/test/csit/suites/base/025__host_tracker.txt @@ -1,5 +1,6 @@ *** Settings *** Documentation Test suite for the host tracker module. +Suite Setup Create Session session http://${CONTROLLER}:8080 auth=${AUTH} headers=${HEADERS} Suite Teardown Delete All Sessions Library Collections Library ../../libraries/RequestsLibrary.py @@ -18,8 +19,6 @@ Add a host ${body} Create Dictionary nodeType OF dataLayerAddress 5e:bf:79:84:10:a6 vlan ... 1 nodeId 00:00:00:00:00:00:00:03 nodeConnectorId 9 networkAddress ... 10.0.1.4 staticHost ${True} nodeConnectorType OF - ${headers} Create Dictionary Content-Type application/json - Create Session session http://${CONTROLLER}:8080 headers=${headers} auth=${auth} ${resp} Put session ${REST_CONTEXT}/${CONTAINER}/address/${name} data=${body} Should Be Equal As Strings ${resp.status_code} 201 Response status code error ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/hosts/inactive @@ -34,8 +33,6 @@ Remove a host ${body} Create Dictionary nodeType OF dataLayerAddress 5e:bf:79:84:10:a6 vlan ... 1 nodeId 00:00:00:00:00:00:00:03 nodeConnectorId 9 networkAddress ... 10.0.1.4 staticHost ${True} nodeConnectorType OF - ${headers} Create Dictionary Content-Type application/json - Create Session session http://${CONTROLLER}:8080 headers=${headers} auth=${auth} ${resp} Delete session ${REST_CONTEXT}/${CONTAINER}/address/${name} Should Be Equal As Strings ${resp.status_code} 204 Response status code error ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/hosts/inactive diff --git a/test/csit/suites/base/025_arp_handler.txt b/test/csit/suites/base/025_arp_handler.txt deleted file mode 100644 index 3b01649c96..0000000000 --- a/test/csit/suites/base/025_arp_handler.txt +++ /dev/null @@ -1,41 +0,0 @@ -*** Settings *** -Documentation Test suite for the arp handler module. -Suite Teardown Delete All Sessions -Library Collections -Library ../../libraries/RequestsLibrary.py -Library ../../libraries/Common.py -Variables ../../variables/Variables.py - -*** Variables *** -${name} test -${key} subnetConfig -${REST_CONTEXT} /controller/nb/v2/subnetservice - -*** Test Cases *** -Add a subnet - [Documentation] Add a subnet, list to validate the result. - [Tags] add - ${body} Create Dictionary name ${name} subnet 10.0.0.254/8 - ${headers} Create Dictionary Content-Type application/json - Create Session session http://${CONTROLLER}:8080 headers=${headers} auth=${auth} - ${resp} Put session ${REST_CONTEXT}/${CONTAINER}/subnet/${name} data=${body} - Should Be Equal As Strings ${resp.status_code} 201 Response status code error - ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/subnets - Should Be Equal As Strings ${resp.status_code} 200 Response status code error - ${result} To JSON ${resp.content} - ${content} Get From Dictionary ${result} ${key} - List Should Contain Value ${content} ${body} - -Remove a subnet - [Documentation] Remove a subnet, list to validate the result. - [Tags] remove - ${body} Create Dictionary name ${name} subnet 10.0.0.254/8 - ${headers} Create Dictionary Content-Type application/json - Create Session session http://${CONTROLLER}:8080 headers=${headers} auth=${auth} - ${resp} Delete session ${REST_CONTEXT}/${CONTAINER}/subnet/${name} - Should Be Equal As Strings ${resp.status_code} 204 Response status code error - ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/subnets - Should Be Equal As Strings ${resp.status_code} 200 Response status code error - ${result} To JSON ${resp.content} - ${content} Get From Dictionary ${result} ${key} - List Should Not Contain Value ${content} ${body} diff --git a/test/csit/suites/base/030__arp_handler.txt b/test/csit/suites/base/030__arp_handler.txt new file mode 100644 index 0000000000..691a26b45e --- /dev/null +++ b/test/csit/suites/base/030__arp_handler.txt @@ -0,0 +1,62 @@ +*** Settings *** +Documentation Test suite for the arp handler module. +Suite Setup Create Session session http://${CONTROLLER}:8080 auth=${AUTH} headers=${HEADERS} +Suite Teardown Delete All Sessions +Library SSHLibrary +Library Collections +Library ../../libraries/RequestsLibrary.py +Library ../../libraries/Common.py +Variables ../../variables/Variables.py + +*** Variables *** +${name} test +${key} subnetConfig +${REST_CONTEXT} /controller/nb/v2/subnetservice +${REST_CONTEXT_HT} /controller/nb/v2/hosttracker + +*** Test Cases *** +List Subnets + [Documentation] List subnets and verify default is there + [Tags] Get + ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/subnets + Should Be Equal As Strings ${resp.status_code} 200 + ${result} To JSON ${resp.content} + ${subnet} Get From Dictionary ${result} ${key} + ${content} Get From List ${subnet} 0 + Dictionary Should Contain Value ${content} 0.0.0.0/0 +Ping h1 to h4 + [Documentation] Ping h1 to h4, verify no packet loss + [Tags] Get + Write h1 ping -c 3 h4 + Sleep 6 + ${result} Read + Should Contain ${result} 64 bytes +List hosts + [Documentation] List hosts and verify h1 and h4 + [Tags] Get + ${resp} Get session ${REST_CONTEXT_HT}/${CONTAINER}/hosts/active + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} 10.0.0.1 + Should Contain ${resp.content} 10.0.0.4 +Add a subnet + [Documentation] Add a subnet, list to validate the result. + [Tags] add + ${body} Create Dictionary name ${name} subnet 11.0.0.254/8 + ${resp} Put session ${REST_CONTEXT}/${CONTAINER}/subnet/${name} data=${body} + Should Be Equal As Strings ${resp.status_code} 201 + ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/subnets + Should Be Equal As Strings ${resp.status_code} 200 + ${result} To JSON ${resp.content} + ${content} Get From Dictionary ${result} ${key} + List Should Contain Value ${content} ${body} +Remove a subnet + [Documentation] Remove a subnet, list to validate the result. + [Tags] remove + ${body} Create Dictionary name ${name} subnet 11.0.0.254/8 + ${resp} Delete session ${REST_CONTEXT}/${CONTAINER}/subnet/${name} + Should Be Equal As Strings ${resp.status_code} 204 + ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/subnets + Should Be Equal As Strings ${resp.status_code} 200 + ${result} To JSON ${resp.content} + ${content} Get From Dictionary ${result} ${key} + List Should Not Contain Value ${content} ${body} diff --git a/test/csit/suites/base/030_forwarding_manager.txt b/test/csit/suites/base/035__forwarding_manager.txt similarity index 84% rename from test/csit/suites/base/030_forwarding_manager.txt rename to test/csit/suites/base/035__forwarding_manager.txt index 0a2d3e9543..d69a7b99aa 100644 --- a/test/csit/suites/base/030_forwarding_manager.txt +++ b/test/csit/suites/base/035__forwarding_manager.txt @@ -1,5 +1,6 @@ *** Settings *** Documentation Test suite for the forwarding manager module. +Suite Setup Create Session session http://${CONTROLLER}:8080 auth=${AUTH} headers=${HEADERS} Suite Teardown Delete All Sessions Library Collections Library ../../libraries/RequestsLibrary.py @@ -17,8 +18,6 @@ Add a static route [Tags] add ${body} Create Dictionary name ${name} prefix 192.168.1.0/24 nextHop ... 10.0.0.2 - ${headers} Create Dictionary Content-Type application/json - Create Session session http://${CONTROLLER}:8080 headers=${headers} auth=${auth} ${resp} Put session ${REST_CONTEXT}/${CONTAINER}/route/${name} data=${body} Should Be Equal As Strings ${resp.status_code} 201 Response status code error ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/routes @@ -32,8 +31,6 @@ Remove a static route [Tags] remove ${body} Create Dictionary name ${name} prefix 192.168.1.0/24 nextHop ... 10.0.0.2 - ${headers} Create Dictionary Content-Type application/json - Create Session session http://${CONTROLLER}:8080 headers=${headers} auth=${auth} ${resp} Delete session ${REST_CONTEXT}/${CONTAINER}/route/${name} Should Be Equal As Strings ${resp.status_code} 204 Response status code error ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/routes diff --git a/test/csit/suites/base/050_OVSDB_plugin.txt b/test/csit/suites/base/050__OVSDB_plugin.txt similarity index 95% rename from test/csit/suites/base/050_OVSDB_plugin.txt rename to test/csit/suites/base/050__OVSDB_plugin.txt index 084d35395a..63fbf0c6af 100644 --- a/test/csit/suites/base/050_OVSDB_plugin.txt +++ b/test/csit/suites/base/050__OVSDB_plugin.txt @@ -2,6 +2,7 @@ Documentation Test suite for OVSDB plugin Suite Setup Create Session session http://${CONTROLLER}:8080 auth=${AUTH} headers=${HEADERS} Suite Teardown Delete All Sessions +Library SSHLibrary Library Collections Library ../../libraries/RequestsLibrary.py Library ../../libraries/Common.py @@ -36,7 +37,7 @@ Connect to mininet ${result} To JSON ${resp.content} ${content} Get From Dictionary ${result} ${key} List Should Contain Value ${content} ${body} - Sleep 1 + Sleep 2 Add bridge s4 [Documentation] Add bridge s4 [Tags] add @@ -91,6 +92,14 @@ Delete bridge s1 [Tags] Delete ${resp} Delete session ${REST_CONTEXT_BD}/bridge/OVS/MININET/s1 Should Be Equal As Strings ${resp.status_code} 200 + Sleep 5 +Ping h1 to h4 + [Documentation] Ping h1 to h4, verify no packet loss + [Tags] Get + Write h1 ping -c 3 h4 + Sleep 6 + ${result} Read + Should Contain ${result} 64 bytes Disconnect mininet [Documentation] Disconnect mininet, list the nodes and validate result [Tags] delete @@ -102,4 +111,3 @@ Disconnect mininet ${result} To JSON ${resp.content} ${content} Get From Dictionary ${result} ${key} List Should Not Contain Value ${content} ${body} - -- 2.36.6