Adding link/port bounce test to basic openflow suite
authorLuis Gomez <ecelgp@gmail.com>
Tue, 28 Apr 2015 21:42:19 +0000 (14:42 -0700)
committerLuis Gomez <ecelgp@gmail.com>
Wed, 29 Apr 2015 03:47:41 +0000 (20:47 -0700)
Adding switch capabilities and IP check

Also fixing some of the robot warnings

Creating variables for switch vendor

Change-Id: Ib373e8b236e65af0f5018237ba9e40959840f230
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
13 files changed:
test/csit/libraries/Utils.txt
test/csit/suites/openflowplugin/AD_SAL_NSF_OF10/010__switch_manager.robot
test/csit/suites/openflowplugin/AD_SAL_NSF_OF10/020__topology_manager.robot
test/csit/suites/openflowplugin/AD_SAL_NSF_OF10/040__flow_programmer.robot
test/csit/suites/openflowplugin/AD_SAL_NSF_OF13/010__switch_manager.robot
test/csit/suites/openflowplugin/AD_SAL_NSF_OF13/020__topology_manager.robot
test/csit/suites/openflowplugin/AD_SAL_NSF_OF13/040__flow_programmer.robot
test/csit/suites/openflowplugin/AD_SAL_NSF_OF13/__init__.robot
test/csit/suites/openflowplugin/MD_SAL_NSF_OF10/010__restconf_inventory.robot
test/csit/suites/openflowplugin/MD_SAL_NSF_OF10/020__restconf_topology.robot
test/csit/suites/openflowplugin/MD_SAL_NSF_OF13/010__restconf_inventory.robot
test/csit/suites/openflowplugin/MD_SAL_NSF_OF13/020__restconf_topology.robot
test/csit/suites/openflowplugin/MD_SAL_NSF_OF13/030__restconf_statistics.robot

index 0d2a6d8b5615e674f5353086ed85ff285368ac54..73517c5a80c1f105851eb5de4029dcc79c42b758 100644 (file)
@@ -5,20 +5,18 @@ Resource          KarafKeywords.txt
 
 *** 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
@@ -27,7 +25,7 @@ Stop Suite
     [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}
@@ -107,28 +105,28 @@ Strip Quotes
     [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
index 43f6bf3b95017d36e914e3911359c0639d629e83..23d86cbc6466b264e992d6b5dd942999f6d282e5 100644 (file)
@@ -79,7 +79,7 @@ Get node
     ${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}
@@ -117,8 +117,8 @@ Node property should exist
     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}
@@ -132,8 +132,8 @@ Node property should not exist
     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}
@@ -147,7 +147,7 @@ Nodeconnector property should 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 Contain Value    ${property_values}    ${property_value}
 
 Nodeconnector property should not exist
@@ -159,7 +159,7 @@ 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
index eff4b481c6628ad8320acc38437b706ae158218f..e12690001ed1f762c7b983be444ed0ce93a0cdf7 100644 (file)
@@ -27,8 +27,8 @@ Get Topology
 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
@@ -40,8 +40,8 @@ Add a userlink
 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
index 000d24db519f83e29a4d33d05ae8545b7313a836..41afc05430e90e833286efc7ab5e65ef636af1d2 100644 (file)
@@ -19,11 +19,10 @@ ${REST_CONTEXT_ST}    /controller/nb/v2/statistics
 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}
@@ -41,11 +40,10 @@ Check flow in flow stats
 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}
index 43f6bf3b95017d36e914e3911359c0639d629e83..23d86cbc6466b264e992d6b5dd942999f6d282e5 100644 (file)
@@ -79,7 +79,7 @@ Get node
     ${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}
@@ -117,8 +117,8 @@ Node property should exist
     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}
@@ -132,8 +132,8 @@ Node property should not exist
     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}
@@ -147,7 +147,7 @@ Nodeconnector property should 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 Contain Value    ${property_values}    ${property_value}
 
 Nodeconnector property should not exist
@@ -159,7 +159,7 @@ 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
index eff4b481c6628ad8320acc38437b706ae158218f..e12690001ed1f762c7b983be444ed0ce93a0cdf7 100644 (file)
@@ -27,8 +27,8 @@ Get Topology
 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
@@ -40,8 +40,8 @@ Add a userlink
 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
index 000d24db519f83e29a4d33d05ae8545b7313a836..41afc05430e90e833286efc7ab5e65ef636af1d2 100644 (file)
@@ -19,11 +19,10 @@ ${REST_CONTEXT_ST}    /controller/nb/v2/statistics
 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}
@@ -41,11 +40,10 @@ Check flow in flow stats
 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}
index 36c2d662109751f4fed4ada7a64340d3dcb8787b..3de99b19a3acbd851bab19bf0262fac834f3742e 100644 (file)
@@ -1,11 +1,11 @@
 *** 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 ***
index 447e686a694decf604bcb4619458687d875ba82e..00189689f960952e8bbd7cfc3e78fc718b490952 100644 (file)
@@ -10,33 +10,65 @@ Resource          ../../../libraries/Utils.txt
 
 *** 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}
index d7b8f06ca26ab82cc589c59c9338921284d853f1..13a214eeaff4968dfd4bf2c5102d2d559bc445e0 100644 (file)
@@ -9,68 +9,69 @@ Variables         ../../../variables/Variables.py
 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}
index 50a50e3494c36260a90cb12a05ae1961480b441b..00189689f960952e8bbd7cfc3e78fc718b490952 100644 (file)
@@ -10,33 +10,65 @@ Resource          ../../../libraries/Utils.txt
 
 *** 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}
index f6d3f60a83c085516dad5f55fb1436c53f9c15a1..13a214eeaff4968dfd4bf2c5102d2d559bc445e0 100644 (file)
@@ -1,5 +1,5 @@
 *** 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
@@ -9,68 +9,69 @@ Variables         ../../../variables/Variables.py
 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}
index f842c5a9cfd8b1edcfceab020beaa5cce3e205e3..d225cea97593b60fa7b93ec7bbc244e6c825aad9 100644 (file)
@@ -14,7 +14,7 @@ ${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
 
 *** 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