--- /dev/null
+*** 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}
+
+
*** 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
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}
[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
[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
*** 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
${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}
${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}
*** 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
${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
${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
+++ /dev/null
-*** 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}
--- /dev/null
+*** 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}
*** 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
[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
[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
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
${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
[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
${result} To JSON ${resp.content}
${content} Get From Dictionary ${result} ${key}
List Should Not Contain Value ${content} ${body}
-