*** Variables ***
${start} sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,1 --switch ovsk,protocols=OpenFlow13
-${linux_prompt} >
+${linux_prompt} >
*** 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
- ${mininet_conn_id}= Open Connection ${MININET} prompt=${linux_prompt} timeout=30s
- Set Suite Variable ${mininet_conn_id}
+ ${mininet_conn_id}= Open Connection ${MININET} prompt=${linux_prompt} timeout=30s
+ Set Suite Variable ${mininet_conn_id}
Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any
- Write sudo ovs-vsctl set-manager ptcp:6644
- Read Until ${linux_prompt}
- Write sudo mn -c
- Read Until ${linux_prompt}
+ Execute Command sudo ovs-vsctl set-manager ptcp:6644
+ Execute Command sudo mn -c
Write ${start}
Read Until mininet>
Sleep 6
[Documentation] Cleanup/Shutdown work that should be done at the completion of all
... tests
Log Stop the test on the base edition
- Switch Connection ${mininet_conn_id}
+ Switch Connection ${mininet_conn_id}
Read
Write exit
Read Until ${linux_prompt}
[Return] ${string_to_return}
Run Command On Remote System
- [Arguments] ${remote_system} ${cmd} ${user}=${MININET_USER} ${prompt}=${LINUX_PROMPT} ${prompt_timeout}=30s
- [Documentation] Reduces the common work of running a command on a remote system to a single higher level robot keyword,
- ... taking care to log in with a public key and. The command given is written and the output returned. No test conditions
- ... are checked.
+ [Arguments] ${remote_system} ${cmd} ${user}=${MININET_USER} ${prompt}=${LINUX_PROMPT} ${prompt_timeout}=30s
+ [Documentation] Reduces the common work of running a command on a remote system to a single higher level robot keyword,
+ ... taking care to log in with a public key and. The command given is written and the output returned. No test conditions
+ ... are checked.
Log Attempting to execute ${cmd} on ${remote_system}
- ${conn_id}= Open Connection ${remote_system} prompt=${prompt} timeout=${prompt_timeout}
+ ${conn_id}= Open Connection ${remote_system} prompt=${prompt} timeout=${prompt_timeout}
Login With Public Key ${user} ${USER_HOME}/.ssh/id_rsa any
Write ${cmd}
- ${output}= Read Until ${linux_prompt}
+ ${output}= Read Until ${linux_prompt}
Close Connection
[Return] ${output}
Verify File Exists On Remote System
- [Arguments] ${remote_system} ${file} ${user}=${MININET_USER} ${prompt}=${LINUX_PROMPT} ${prompt_timeout}=5s
- [Documentation] Will create connection with public key and will PASS if the given ${file} exists, otherwise will FAIL
- ${conn_id}= Open Connection ${remote_system} prompt=${prompt} timeout=${prompt_timeout}
+ [Arguments] ${remote_system} ${file} ${user}=${MININET_USER} ${prompt}=${LINUX_PROMPT} ${prompt_timeout}=5s
+ [Documentation] Will create connection with public key and will PASS if the given ${file} exists, otherwise will FAIL
+ ${conn_id}= Open Connection ${remote_system} prompt=${prompt} timeout=${prompt_timeout}
Login With Public Key ${user} ${USER_HOME}/.ssh/id_rsa any
- SSHLibrary.File Should Exist ${file}
+ SSHLibrary.File Should Exist ${file}
Close Connection
Verify Controller Is Not Dead
- [Arguments] ${controller_ip}=${CONTROLLER}
- [Documentation] Will execute any tests to verify the controller is not dead. Some checks are
- ... Out Of Memory Execptions.
- Check Karaf Log File Does Not Have Messages ${controller_ip} java.lang.OutOfMemoryError
+ [Arguments] ${controller_ip}=${CONTROLLER}
+ [Documentation] Will execute any tests to verify the controller is not dead. Some checks are
+ ... Out Of Memory Execptions.
+ Check Karaf Log File Does Not Have Messages ${controller_ip} java.lang.OutOfMemoryError
${resp} RequestsLibrary.Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/nodes
Should Be Equal As Strings ${resp.status_code} 200 Response status code error
${result} TO JSON ${resp.content}
- ${node} Create Dictionary id ${node_id} type ${node_type}
+ ${node} Create Dictionary id=${node_id} type={node_type}
${content} Extract All Nodes ${result}
Log ${content}
List Should Contain Value ${content} ${node}
Log ${result}
${nodes} Extract All Nodes ${result}
${property_values} Extract Node Property Values ${result} ${property}
- ${node} Create Dictionary id ${node_id} type ${node_type}
- ${property_value} Create Dictionary value ${value}
+ ${node} Create Dictionary id=${node_id} type=${node_type}
+ ${property_value} Create Dictionary value=${value}
Log ${property_value}
List Should Contain Value ${nodes} ${node}
List Should Contain Value ${property_values} ${property_value}
Log ${result}
${nodes} Extract All Nodes ${result}
${properties} Extract Node Property Values ${result} ${property}
- ${node} Create Dictionary id ${node_id} type ${node_type}
- ${property} Create Dictionary value ${value}
+ ${node} Create Dictionary id=${node_id} type=${node_type}
+ ${property} Create Dictionary value=${value}
Log ${property}
List Should Contain Value ${nodes} ${node}
List Should Not Contain Value ${properties} ${property}
Log ${result}
${property_values} Extract Nodeconnector Property Values ${result} ${property}
Log ${property_values}
- ${property_value} Create Dictionary value ${value}
+ ${property_value} Create Dictionary value=${value}
List Should Contain Value ${property_values} ${property_value}
Nodeconnector property should not exist
Log ${result}
${property_values} Extract Nodeconnector Property Values ${result} ${property}
Log ${property_values}
- ${property_value} Create Dictionary value ${value}
+ ${property_value} Create Dictionary value=${value}
List Should not Contain Value ${property_values} ${property_value}
List all nodeconnectors of node
Add a userlink
[Documentation] Add a userlink, list to validate the result.
[Tags] adsal
- ${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
+ ${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
${resp} RequestsLibrary.Put session ${REST_CONTEXT}/${CONTAINER}/userLink/${name} data=${body}
Should Be Equal As Strings ${resp.status_code} 201
${resp} RequestsLibrary.Get session ${REST_CONTEXT}/${CONTAINER}/userLinks
Remove a userlink
[Documentation] Remove a userlink, list to validate the result.
[Tags] adsal
- ${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
+ ${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
${resp} RequestsLibrary.Delete session ${REST_CONTEXT}/${CONTAINER}/userLink/${name}
Should Be Equal As Strings ${resp.status_code} 204
${resp} RequestsLibrary.Get session ${REST_CONTEXT}/${CONTAINER}/userLinks
Add a flow
[Documentation] Add a flow, list to validate the result.
[Tags] adsal
- ${node} Create Dictionary type OF id ${node_id}
+ ${node} Create Dictionary type=OF id=${node_id}
${actions} Create List OUTPUT=1
- ${body} Create Dictionary name ${name} installInHw true node
- ... ${node} priority 1 etherType 0x800 nwDst
- ... 10.0.0.1/32 actions ${actions}
+ ${body} Create Dictionary name=${name} installInHw=true node=${node}
+ ... priority=1 etherType=0x800 nwDst=10.0.0.1/32 actions=${actions}
${resp} RequestsLibrary.Put session ${REST_CONTEXT}/${CONTAINER}/node/OF/${node_id}/staticFlow/${name} data=${body}
Should Be Equal As Strings ${resp.status_code} 201
${resp} RequestsLibrary.Get session ${REST_CONTEXT}/${CONTAINER}
Remove a flow
[Documentation] Remove a flow, list to validate the result.
[Tags] adsal
- ${node} Create Dictionary type OF id ${node_id}
+ ${node} Create Dictionary type=OF id=${node_id}
${actions} Create List OUTPUT=1
- ${body} Create Dictionary name ${name} installInHw true node
- ... ${node} priority 1 etherType 0x800 nwDst
- ... 10.0.0.1/32 actions ${actions}
+ ${body} Create Dictionary name=${name} installInHw=true node=${node}
+ ... priority=1 etherType=0x800 nwDst=10.0.0.1/32 actions=${actions}
${resp} RequestsLibrary.Delete session ${REST_CONTEXT}/${CONTAINER}/node/OF/${node_id}/staticFlow/${name}
Should Be Equal As Strings ${resp.status_code} 204
${resp} RequestsLibrary.Get session ${REST_CONTEXT}/${CONTAINER}
${resp} RequestsLibrary.Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/nodes
Should Be Equal As Strings ${resp.status_code} 200 Response status code error
${result} TO JSON ${resp.content}
- ${node} Create Dictionary id ${node_id} type ${node_type}
+ ${node} Create Dictionary id=${node_id} type={node_type}
${content} Extract All Nodes ${result}
Log ${content}
List Should Contain Value ${content} ${node}
Log ${result}
${nodes} Extract All Nodes ${result}
${property_values} Extract Node Property Values ${result} ${property}
- ${node} Create Dictionary id ${node_id} type ${node_type}
- ${property_value} Create Dictionary value ${value}
+ ${node} Create Dictionary id=${node_id} type=${node_type}
+ ${property_value} Create Dictionary value=${value}
Log ${property_value}
List Should Contain Value ${nodes} ${node}
List Should Contain Value ${property_values} ${property_value}
Log ${result}
${nodes} Extract All Nodes ${result}
${properties} Extract Node Property Values ${result} ${property}
- ${node} Create Dictionary id ${node_id} type ${node_type}
- ${property} Create Dictionary value ${value}
+ ${node} Create Dictionary id=${node_id} type=${node_type}
+ ${property} Create Dictionary value=${value}
Log ${property}
List Should Contain Value ${nodes} ${node}
List Should Not Contain Value ${properties} ${property}
Log ${result}
${property_values} Extract Nodeconnector Property Values ${result} ${property}
Log ${property_values}
- ${property_value} Create Dictionary value ${value}
+ ${property_value} Create Dictionary value=${value}
List Should Contain Value ${property_values} ${property_value}
Nodeconnector property should not exist
Log ${result}
${property_values} Extract Nodeconnector Property Values ${result} ${property}
Log ${property_values}
- ${property_value} Create Dictionary value ${value}
+ ${property_value} Create Dictionary value=${value}
List Should not Contain Value ${property_values} ${property_value}
List all nodeconnectors of node
Add a userlink
[Documentation] Add a userlink, list to validate the result.
[Tags] adsal
- ${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
+ ${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
${resp} RequestsLibrary.Put session ${REST_CONTEXT}/${CONTAINER}/userLink/${name} data=${body}
Should Be Equal As Strings ${resp.status_code} 201
${resp} RequestsLibrary.Get session ${REST_CONTEXT}/${CONTAINER}/userLinks
Remove a userlink
[Documentation] Remove a userlink, list to validate the result.
[Tags] adsal
- ${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
+ ${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
${resp} RequestsLibrary.Delete session ${REST_CONTEXT}/${CONTAINER}/userLink/${name}
Should Be Equal As Strings ${resp.status_code} 204
${resp} RequestsLibrary.Get session ${REST_CONTEXT}/${CONTAINER}/userLinks
Add a flow
[Documentation] Add a flow, list to validate the result.
[Tags] adsal
- ${node} Create Dictionary type OF id ${node_id}
+ ${node} Create Dictionary type=OF id=${node_id}
${actions} Create List OUTPUT=1
- ${body} Create Dictionary name ${name} installInHw true node
- ... ${node} priority 1 etherType 0x800 nwDst
- ... 10.0.0.1/32 actions ${actions}
+ ${body} Create Dictionary name=${name} installInHw=true node=${node}
+ ... priority=1 etherType=0x800 nwDst=10.0.0.1/32 actions=${actions}
${resp} RequestsLibrary.Put session ${REST_CONTEXT}/${CONTAINER}/node/OF/${node_id}/staticFlow/${name} data=${body}
Should Be Equal As Strings ${resp.status_code} 201
${resp} RequestsLibrary.Get session ${REST_CONTEXT}/${CONTAINER}
Remove a flow
[Documentation] Remove a flow, list to validate the result.
[Tags] adsal
- ${node} Create Dictionary type OF id ${node_id}
+ ${node} Create Dictionary type=OF id=${node_id}
${actions} Create List OUTPUT=1
- ${body} Create Dictionary name ${name} installInHw true node
- ... ${node} priority 1 etherType 0x800 nwDst
- ... 10.0.0.1/32 actions ${actions}
+ ${body} Create Dictionary name=${name} installInHw=true node=${node}
+ ... priority=1 etherType=0x800 nwDst=10.0.0.1/32 actions=${actions}
${resp} RequestsLibrary.Delete session ${REST_CONTEXT}/${CONTAINER}/node/OF/${node_id}/staticFlow/${name}
Should Be Equal As Strings ${resp.status_code} 204
${resp} RequestsLibrary.Get session ${REST_CONTEXT}/${CONTAINER}
*** Settings ***
-Documentation Test suite for AD-SAL NSF mininet OF13
+Documentation Test suite for AD-SAL NSF 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
+${start}= sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 --switch ovsk,protocols=OpenFlow13
** Keywords ***
*** Variables ***
${REST_CONTEXT} /restconf/operational/opendaylight-inventory:nodes
+${VENDOR} Nicira, Inc.
+${HARDWARE} Open vSwitch
@{node_list} openflow:1 openflow:2 openflow:3
*** Test Cases ***
Get list of nodes
[Documentation] Get the inventory
- Log ${start}
+ Set Suite Variable ${SW_IPADDRESS} "flow-node-inventory:ip-address":"${MININET}"
+ Set Suite Variable ${SW_VENDOR} "flow-node-inventory:manufacturer":"${VENDOR}"
+ Set Suite Variable ${SW_HARDWARE} "flow-node-inventory:manufacturer":"${HARDWARE}"
+ Set Suite Variable @{SW_CAPABILITIES} "flow-node-inventory:flow-feature-capability-flow-stats" "flow-node-inventory:flow-feature-capability-table-stats" "flow-node-inventory:flow-feature-capability-port-stats" "flow-node-inventory:flow-feature-capability-queue-stats"
Wait Until Keyword Succeeds 30s 2s Ensure All Nodes Are In Response ${REST_CONTEXT} ${node_list}
+ ${resp} RequestsLibrary.Get session ${REST_CONTEXT}
+ Log ${resp.content}
-Get nodeconnector for a node 1
+Get node 1 inventory
[Documentation] Get the inventory for a node
- ${resp} RequestsLibrary.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
+ @{list} Append To List ${SW_CAPABILITIES} ${SW_VENDOR} ${SW_IPADDRESS} ${SW_HARDWARE} openflow:1:1
+ ... openflow:1:2
+ Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT}/node/openflow:1 ${list}
-Get nodeconnector for a node 2
+Get node 2 inventory
[Documentation] Get the inventory for a node
- ${resp} RequestsLibrary.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
+ @{list} Append To List ${SW_CAPABILITIES} ${SW_VENDOR} ${SW_IPADDRESS} ${SW_HARDWARE} openflow:2:1
+ ... openflow:2:2 openflow:2:3
+ Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT}/node/openflow:2 ${list}
-Get nodeconnector for a node 3
+Get node 3 inventory
[Documentation] Get the inventory for a node
- ${resp} RequestsLibrary.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
+ @{list} Append To List ${SW_CAPABILITIES} ${SW_VENDOR} ${SW_IPADDRESS} ${SW_HARDWARE} openflow:3:1
+ ... openflow:3:2 openflow:3:3
+ Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT}/node/openflow:3 ${list}
+
+Link Down
+ [Documentation] Take link s1-s2 down
+ Write link s1 s2 down
+ Read Until mininet>
+ @{list} Create List "link-down":true
+ Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT}/node/openflow:1/node-connector/openflow:1:1 ${list}
+ Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT}/node/openflow:2/node-connector/openflow:2:3 ${list}
+
+Link Up
+ [Documentation] Take link s1-s2 up
+ Write link s1 s2 up
+ Read Until mininet>
+ @{list} Create List "link-down":false
+ Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT}/node/openflow:1/node-connector/openflow:1:1 ${list}
+ Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT}/node/openflow:2/node-connector/openflow:2:3 ${list}
+
+Remove Port
+ [Documentation] Remove port s2-eth1
+ Write sh ovs-vsctl del-port s2 s2-eth1
+ Read Until mininet>
+ @{list} Create List openflow:2:1
+ Wait Until Keyword Succeeds 30s 2s Check For Elements Not At URI ${REST_CONTEXT} ${list}
+
+Add Port
+ [Documentation] Add port s2-eth1, new id 4
+ Write sh ovs-vsctl add-port s2 s2-eth1
+ Read Until mininet>
+ @{list} Create List openflow:2:4
+ Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT} ${list}
Resource ../../../libraries/Utils.txt
*** Variables ***
-${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
+${REST_CONTEXT} /restconf/operational/network-topology:network-topology
*** Test Cases ***
Get RESTCONF Topology
[Documentation] Get RESTCONF Topology and validate the result.
- Wait Until Keyword Succeeds 30s 2s Ensure All Nodes Are In Response ${REST_CONTEXT_1} ${node_list}
- ${resp} RequestsLibrary.Get session ${REST_CONTEXT_1}
- Should Be Equal As Strings ${resp.status_code} 200
+ Wait Until Keyword Succeeds 30s 2s Ensure All Nodes Are In Response ${REST_CONTEXT} ${node_list}
+ ${resp} RequestsLibrary.Get session ${REST_CONTEXT}
Log ${resp.content}
- Should Contain ${resp.content} ${topology1}
List all the links
[Documentation] List all the links in the topology.
${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}
+ Set Suite Variable ${link2}
${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}
+ Set Suite Variable ${link1}
${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}
+ Set Suite Variable ${link4}
${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}
+ Set Suite Variable ${link3}
${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.
- ${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} RequestsLibrary.Put session ${REST_CONTEXT_3} data=${body}
- Should Be Equal As Strings ${resp.status_code} 200
- ${resp} RequestsLibrary.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}
+Link Down
+ [Documentation] Take link s1-s2 down
+ Write link s1 s2 down
+ Read Until mininet>
+ ${links} Create List ${link2} ${link4}
+ Wait Until Keyword Succeeds 30s 2s Verify Links ${links}
-Remove a link
- [Documentation] Remove a link, list to validate the result.
- ${resp} RequestsLibrary.Delete session ${REST_CONTEXT_3}
- Should Be Equal As Strings ${resp.status_code} 200
- ${resp} RequestsLibrary.Get session ${REST_CONTEXT_3}
- Should Be Equal As Strings ${resp.status_code} 404
+Link Up
+ [Documentation] Take link s1-s2 up
+ Write link s1 s2 up
+ Read Until mininet>
+ ${links} Create List ${link1} ${link2} ${link3} ${link4}
+ Wait Until Keyword Succeeds 30s 2s Verify Links ${links}
+
+Remove Port
+ [Documentation] Remove port s2-eth2
+ Write sh ovs-vsctl del-port s2 s2-eth2
+ Read Until mininet>
+ @{list} Create List openflow:2:2
+ Wait Until Keyword Succeeds 30s 2s Check For Elements Not At URI ${REST_CONTEXT} ${list}
+
+Add Port
+ [Documentation] Add port s2-eth2, new id 5
+ Write sh ovs-vsctl add-port s2 s2-eth2
+ Read Until mininet>
+ @{list} Create List openflow:2:5
+ Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT} ${list}
*** Keywords ***
Verify Links
[Arguments] ${expected_links}
- ${resp} RequestsLibrary.Get session ${REST_CONTEXT_2}
+ ${resp} RequestsLibrary.Get session ${REST_CONTEXT}/topology/flow:1
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${result} To JSON ${resp.content}
*** Variables ***
${REST_CONTEXT} /restconf/operational/opendaylight-inventory:nodes
+${VENDOR} Nicira, Inc.
+${HARDWARE} Open vSwitch
@{node_list} openflow:1 openflow:2 openflow:3
*** Test Cases ***
Get list of nodes
[Documentation] Get the inventory
- ${resp} RequestsLibrary.Get session ${REST_CONTEXT}
+ Set Suite Variable ${SW_IPADDRESS} "flow-node-inventory:ip-address":"${MININET}"
+ Set Suite Variable ${SW_VENDOR} "flow-node-inventory:manufacturer":"${VENDOR}"
+ Set Suite Variable ${SW_HARDWARE} "flow-node-inventory:manufacturer":"${HARDWARE}"
+ Set Suite Variable @{SW_CAPABILITIES} "flow-node-inventory:flow-feature-capability-flow-stats" "flow-node-inventory:flow-feature-capability-table-stats" "flow-node-inventory:flow-feature-capability-port-stats" "flow-node-inventory:flow-feature-capability-queue-stats"
Wait Until Keyword Succeeds 30s 2s Ensure All Nodes Are In Response ${REST_CONTEXT} ${node_list}
+ ${resp} RequestsLibrary.Get session ${REST_CONTEXT}
+ Log ${resp.content}
-Get nodeconnector for a node 1
+Get node 1 inventory
[Documentation] Get the inventory for a node
- ${resp} RequestsLibrary.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
+ @{list} Append To List ${SW_CAPABILITIES} ${SW_VENDOR} ${SW_IPADDRESS} ${SW_HARDWARE} openflow:1:1
+ ... openflow:1:2
+ Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT}/node/openflow:1 ${list}
-Get nodeconnector for a node 2
+Get node 2 inventory
[Documentation] Get the inventory for a node
- ${resp} RequestsLibrary.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
+ @{list} Append To List ${SW_CAPABILITIES} ${SW_VENDOR} ${SW_IPADDRESS} ${SW_HARDWARE} openflow:2:1
+ ... openflow:2:2 openflow:2:3
+ Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT}/node/openflow:2 ${list}
-Get nodeconnector for a node 3
+Get node 3 inventory
[Documentation] Get the inventory for a node
- ${resp} RequestsLibrary.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
+ @{list} Append To List ${SW_CAPABILITIES} ${SW_VENDOR} ${SW_IPADDRESS} ${SW_HARDWARE} openflow:3:1
+ ... openflow:3:2 openflow:3:3
+ Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT}/node/openflow:3 ${list}
+
+Link Down
+ [Documentation] Take link s1-s2 down
+ Write link s1 s2 down
+ Read Until mininet>
+ @{list} Create List "link-down":true
+ Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT}/node/openflow:1/node-connector/openflow:1:1 ${list}
+ Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT}/node/openflow:2/node-connector/openflow:2:3 ${list}
+
+Link Up
+ [Documentation] Take link s1-s2 up
+ Write link s1 s2 up
+ Read Until mininet>
+ @{list} Create List "link-down":false
+ Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT}/node/openflow:1/node-connector/openflow:1:1 ${list}
+ Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT}/node/openflow:2/node-connector/openflow:2:3 ${list}
+
+Remove Port
+ [Documentation] Remove port s2-eth1
+ Write sh ovs-vsctl del-port s2 s2-eth1
+ Read Until mininet>
+ @{list} Create List openflow:2:1
+ Wait Until Keyword Succeeds 30s 2s Check For Elements Not At URI ${REST_CONTEXT} ${list}
+
+Add Port
+ [Documentation] Add port s2-eth1, new id 4
+ Write sh ovs-vsctl add-port s2 s2-eth1
+ Read Until mininet>
+ @{list} Create List openflow:2:4
+ Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT} ${list}
*** Settings ***
-Documentation Test suite RESTCONF Topology
+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
Resource ../../../libraries/Utils.txt
*** Variables ***
-${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
+${REST_CONTEXT} /restconf/operational/network-topology:network-topology
*** Test Cases ***
Get RESTCONF Topology
[Documentation] Get RESTCONF Topology and validate the result.
- Wait Until Keyword Succeeds 30s 2s Ensure All Nodes Are In Response ${REST_CONTEXT_1} ${node_list}
- ${resp} RequestsLibrary.Get session ${REST_CONTEXT_1}
+ Wait Until Keyword Succeeds 30s 2s Ensure All Nodes Are In Response ${REST_CONTEXT} ${node_list}
+ ${resp} RequestsLibrary.Get session ${REST_CONTEXT}
Log ${resp.content}
- 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.
${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}
+ Set Suite Variable ${link2}
${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}
+ Set Suite Variable ${link1}
${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}
+ Set Suite Variable ${link4}
${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}
+ Set Suite Variable ${link3}
${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.
- ${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} RequestsLibrary.Put session ${REST_CONTEXT_3} data=${body}
- Should Be Equal As Strings ${resp.status_code} 200
- ${resp} RequestsLibrary.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}
+Link Down
+ [Documentation] Take link s1-s2 down
+ Write link s1 s2 down
+ Read Until mininet>
+ ${links} Create List ${link2} ${link4}
+ Wait Until Keyword Succeeds 30s 2s Verify Links ${links}
-Remove a link
- [Documentation] Remove a link, list to validate the result.
- ${resp} RequestsLibrary.Delete session ${REST_CONTEXT_3}
- Should Be Equal As Strings ${resp.status_code} 200
- ${resp} RequestsLibrary.Get session ${REST_CONTEXT_3}
- Should Be Equal As Strings ${resp.status_code} 404
+Link Up
+ [Documentation] Take link s1-s2 up
+ Write link s1 s2 up
+ Read Until mininet>
+ ${links} Create List ${link1} ${link2} ${link3} ${link4}
+ Wait Until Keyword Succeeds 30s 2s Verify Links ${links}
+
+Remove Port
+ [Documentation] Remove port s2-eth2
+ Write sh ovs-vsctl del-port s2 s2-eth2
+ Read Until mininet>
+ @{list} Create List openflow:2:2
+ Wait Until Keyword Succeeds 30s 2s Check For Elements Not At URI ${REST_CONTEXT} ${list}
+
+Add Port
+ [Documentation] Add port s2-eth2, new id 5
+ Write sh ovs-vsctl add-port s2 s2-eth2
+ Read Until mininet>
+ @{list} Create List openflow:2:5
+ Wait Until Keyword Succeeds 30s 2s Check For Elements At URI ${REST_CONTEXT} ${list}
*** Keywords ***
Verify Links
[Arguments] ${expected_links}
- ${resp} RequestsLibrary.Get session ${REST_CONTEXT_2}
+ ${resp} RequestsLibrary.Get session ${REST_CONTEXT}/topology/flow:1
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${result} To JSON ${resp.content}
*** Test Cases ***
Get Stats for all nodes
- [Documentation] Get the stats for a node
+ [Documentation] Get the stats for all nodes
Wait Until Keyword Succeeds 30s 2s Ensure All Nodes Are In Response ${REST_CONTEXT} ${node_list}
Get Stats for node 1
[Documentation] Get the stats for a node