large rework to optimize test code.
authorJamo Luhrsen <james.luhrsen@hp.com>
Tue, 23 Sep 2014 20:07:44 +0000 (13:07 -0700)
committerChristopher O'Shea <christopher.o.shea@ericsson.com>
Thu, 25 Sep 2014 04:05:14 +0000 (21:05 -0700)
removed lots of sleeps in favor of "Wait Until Keyword Succeeds" (WUKS) calls
moved common functionality in to higher level keywords in the new Utils.txt
resource

Change stats for performance from 30s to 60s

Change-Id: Iab144bfb46c9789bbb0d8a9bc2e27eb57082881e
Signed-off-by: Jamo Luhrsen <james.luhrsen@hp.com>
31 files changed:
test/csit/libraries/Utils.txt [new file with mode: 0644]
test/csit/suites/karaf-compatible/010__MD_SAL_NSF/010__restconf_inventory.txt
test/csit/suites/karaf-compatible/010__MD_SAL_NSF/020__restconf_statistics.txt
test/csit/suites/karaf-compatible/010__MD_SAL_NSF/030__restconf_topology.txt
test/csit/suites/karaf-compatible/010__MD_SAL_NSF/040__restconf_frm.txt
test/csit/suites/karaf-compatible/010__MD_SAL_NSF/__init__.txt
test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/010__restconf_inventory.txt
test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/020__restconf_statistics.txt
test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/030__restconf_topology.txt
test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/040__restconf_frm.txt
test/csit/suites/karaf-compatible/020__MD_SAL_NSF_OF13/__init__.txt
test/csit/suites/karaf-compatible/030__AD_SAL_NSF/020__statistics_manager.txt
test/csit/suites/karaf-compatible/030__AD_SAL_NSF/030__topology_manager.txt
test/csit/suites/karaf-compatible/030__AD_SAL_NSF/__init__.txt
test/csit/suites/karaf-compatible/040__AD_SAL_NSF_OF13/020__statistics_manager.txt
test/csit/suites/karaf-compatible/040__AD_SAL_NSF_OF13/030__topology_manager.txt
test/csit/suites/karaf-compatible/040__AD_SAL_NSF_OF13/__init__.txt
test/csit/suites/karaf-compatible/050__AD_SAL_Apps/__init__.txt
test/csit/suites/karaf-compatible/060__AD_SAL_Apps_OF13/__init__.txt
test/csit/suites/karaf-compatible/070__Flows_OF13/__init__.txt
test/csit/suites/karaf-compatible/075__Flows_OF13_Stat_Manager/010__SM_add_upd_del_flows.txt
test/csit/suites/karaf-compatible/075__Flows_OF13_Stat_Manager/__init__.txt
test/csit/suites/karaf-compatible/080__Inventory_Performance/010__restconf_inventory.txt
test/csit/suites/karaf-compatible/080__Inventory_Performance/015__restconf_topology.txt
test/csit/suites/karaf-compatible/080__Inventory_Performance/020__switch_manager.txt
test/csit/suites/karaf-compatible/080__Inventory_Performance/030__statistics_manager.txt
test/csit/suites/karaf-compatible/080__Inventory_Performance/040__topology_manager.txt
test/csit/suites/karaf-compatible/080__Inventory_Performance/050__ping_test.txt
test/csit/suites/karaf-compatible/080__Inventory_Performance/__init__.txt
test/csit/suites/karaf-compatible/090__OVSDB/__init__.txt
test/csit/suites/karaf-compatible/100__OVSDB_OF13/__init__.txt

diff --git a/test/csit/libraries/Utils.txt b/test/csit/libraries/Utils.txt
new file mode 100644 (file)
index 0000000..cfd7a0d
--- /dev/null
@@ -0,0 +1,86 @@
+*** Settings ***
+Library           SSHLibrary
+
+*** Variables ***
+${start}          sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,1 --switch ovsk,protocols=OpenFlow13
+
+*** 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
+    Open Connection    ${MININET}    prompt=>    timeout=30s
+    Login With Public Key    ${MININET_USER}    ${USER_HOME}/.ssh/id_rsa    any
+    Write    sudo ovs-vsctl set-manager ptcp:6644
+    Write    sudo mn -c
+    Read Until    >
+    Write    ${start}
+    Read Until    mininet>
+
+Stop Suite
+    [Documentation]    Cleanup/Shutdown work that should be done at the completion of all
+    ...    tests
+    Log    Stop the test on the base edition
+    Read
+    Write    exit
+    Read Until    >
+    Close Connection
+
+Ensure All Nodes Are In Response
+    [Arguments]    ${URI}    ${node_list}
+    [Documentation]    A GET is made to the supplied ${URI} and every item in the ${node_list}
+    ...    is verified to exist in the repsonse. This keyword currently implies that it's node
+    ...    specific but any list of strings can be given in ${node_list}. Refactoring of this
+    ...    to make it more generic should be done. (see keyword "Check For Elements At URI")
+    : FOR    ${node}    IN    @{node_list}
+    \    ${resp}    Get    session    ${URI}
+    \    Should Be Equal As Strings    ${resp.status_code}    200
+    \    Should Contain    ${resp.content}    ${node}
+
+Check Nodes Stats
+    [Arguments]    ${node}
+    [Documentation]    A GET on the /node/${node} API is made and specific flow stat
+    ...    strings are checked for existence.
+    ${resp}    Get    session    ${REST_CONTEXT}/node/${node}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    flow-capable-node-connector-statistics
+    Should Contain    ${resp.content}    flow-table-statistics
+
+Check That Port Count Is Ok
+    [Arguments]    ${node}    ${count}
+    [Documentation]    A GET on the /port API is made and the specified port ${count} is
+    ...    verified. A more generic Keyword "Check For Specific Number Of Elements At URI"
+    ...    also does this work and further consolidation should be done.
+    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/port
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain X Times    ${resp.content}    ${node}    ${count}
+
+Check For Specific Number Of Elements At URI
+    [Arguments]    ${uri}    ${element}    ${expected_count}
+    [Documentation]    A GET is made to the specified ${URI} and the specific count of a
+    ...    given element is done (as supplied by ${element} and ${expected_count})
+    ${resp}    Get    session    ${uri}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain X Times    ${resp.content}    ${element}    ${expected_count}
+
+Check For Elements At URI
+    [Arguments]    ${uri}    ${elements}
+    [Documentation]    A GET is made at the supplied ${URI} and every item in the list of
+    ...    ${elements} is verified to exist in the response
+    ${resp}    Get    session    ${uri}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    : FOR    ${i}    IN    @{elements}
+    \    Should Contain    ${resp.content}    ${i}
+
+Check For Elements Not At URI
+    [Arguments]    ${uri}    ${elements}
+    [Documentation]    A GET is made at the supplied ${URI} and every item in the list of
+    ...    ${elements} is verified to NOT exist in the response
+    ${resp}    Get    session    ${uri}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    : FOR    ${i}    IN    @{elements}
+    \    Should Not Contain    ${resp.content}    ${i}
index ab87a8961aac44cb422abd7fde15d1f83f8b0575..14e38554c979d5b5ab656135d3a23f7f311ef707 100644 (file)
@@ -1,46 +1,42 @@
 *** Settings ***
 Documentation     Test suite for RESTCONF inventory
-Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTCONFPORT}   auth=${AUTH}   headers=${HEADERS_XML}
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
 Suite Teardown    Delete All Sessions
 Library           Collections
 Library           ../../../libraries/RequestsLibrary.py
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
 ${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
+@{node_list}      openflow:1    openflow:2    openflow:3
 
-*** Test Cases *** 
+*** Test Cases ***
 Get list of nodes
     [Documentation]    Get the inventory
-       ${resp}    Get    session    ${REST_CONTEXT}
-       Should Be Equal As Strings    ${resp.status_code}    200
-       Should Contain     ${resp.content}      openflow:1
-       Should Contain     ${resp.content}      openflow:2
-       Should Contain     ${resp.content}      openflow:3
-       
+    Log    ${start}
+    Wait Until Keyword Succeeds    30s    2s    Ensure All Nodes Are In Response    ${REST_CONTEXT}    ${node_list}
+
 Get nodeconnector for a node 1
     [Documentation]    Get the inventory for a node
-        ${resp}    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
+    ${resp}    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
 
 Get nodeconnector for a node 2
     [Documentation]    Get the inventory for a node
-        ${resp}    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
+    ${resp}    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
 
 Get nodeconnector for a node 3
     [Documentation]    Get the inventory for a node
-       ${resp}    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
-
-       
-    
+    ${resp}    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
index 17c33c0f9407678d1aac73dea1e54bd23057d403..162542ad80a90c4f80126a69908475588fbce6c7 100644 (file)
@@ -1,33 +1,27 @@
 *** Settings ***
 Documentation     Test suite for RESTCONF statistics
-Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTCONFPORT}   auth=${AUTH}   headers=${HEADERS_XML}
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
 Suite Teardown    Delete All Sessions
 Library           Collections
 Library           ../../../libraries/RequestsLibrary.py
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
 ${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
+@{node_list}      openflow:1    openflow:2    openflow:3
 
-*** Test Cases ***     
+*** Test Cases ***
 Get Stats for node 1
     [Documentation]    Get the stats for a node
-        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:1
-        Should Be Equal As Strings   ${resp.status_code}    200
-        Should Contain     ${resp.content}      flow-capable-node-connector-statistics
-        Should Contain     ${resp.content}      flow-table-statistics
+    Wait Until Keyword Succeeds    30s    2s    Ensure All Nodes Are In Response    ${REST_CONTEXT}    ${node_list}
+    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:1
 
 Get Stats for node 2
     [Documentation]    Get the stats for a node
-        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:2
-        Should Be Equal As Strings   ${resp.status_code}    200
-        Should Contain     ${resp.content}      flow-capable-node-connector-statistics
-        Should Contain     ${resp.content}      flow-table-statistics
+    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:2
 
 Get Stats for node 3
     [Documentation]    Get the stats for a node
-       ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:3
-       Should Be Equal As Strings   ${resp.status_code}    200
-       Should Contain     ${resp.content}      flow-capable-node-connector-statistics
-       Should Contain     ${resp.content}      flow-table-statistics    
+    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:3
index b4e3495f54b531f2fc9e65c60325525f4047b134..6feb9dacbb7b3459dde204b63a6d26eabb4884ce 100644 (file)
@@ -1,18 +1,20 @@
 *** Settings ***
-Documentation     Test suite for RESTCONF Topology 
-Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTCONFPORT}   auth=${AUTH}   headers=${HEADERS}
+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
 Library           ../../../libraries/RequestsLibrary.py
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
-${topology1}    "flow:1"
-${node1}    "openflow:1"
-${node2}    "openflow:2"
-${node3}    "openflow:3"
-${key}       link
+${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
@@ -21,45 +23,39 @@ ${REST_CONTEXT_3}    /restconf/config/network-topology:network-topology/topology
 Get RESTCONF Topology
     [Documentation]    Get RESTCONF Topology and validate the result.
     [Tags]    get
+    Wait Until Keyword Succeeds    30s    2s    Ensure All Nodes Are In Response    ${REST_CONTEXT_1}    ${node_list}
     ${resp}    Get    session    ${REST_CONTEXT_1}
-    Should Be Equal As Strings    ${resp.status_code}    200 
+    Should Be Equal As Strings    ${resp.status_code}    200
     Log    ${resp.content}
-    Should Contain   ${resp.content}   ${topology1}  
-   
+    Should Contain    ${resp.content}    ${topology1}
+
 List all the links
     [Documentation]    List all the links in the topology.
     [Tags]    get
     ${body1}    Create Dictionary    dest-node=openflow:1    dest-tp=openflow:1:2
     ${body2}    Create Dictionary    source-node=openflow:3    source-tp=openflow:3:3
-    ${link2}    Create Dictionary    link-id=openflow:3:3  destination=${body1}    source=${body2}
+    ${link2}    Create Dictionary    link-id=openflow:3:3    destination=${body1}    source=${body2}
     ${body1}    Create Dictionary    dest-node=openflow:1    dest-tp=openflow:1:1
     ${body2}    Create Dictionary    source-node=openflow:2    source-tp=openflow:2:3
-    ${link1}    Create Dictionary    link-id=openflow:2:3  destination=${body1}    source=${body2}
+    ${link1}    Create Dictionary    link-id=openflow:2:3    destination=${body1}    source=${body2}
     ${body1}    Create Dictionary    dest-node=openflow:3    dest-tp=openflow:3:3
     ${body2}    Create Dictionary    source-node=openflow:1    source-tp=openflow:1:2
-    ${link4}    Create Dictionary    link-id=openflow:1:2  destination=${body1}    source=${body2}
+    ${link4}    Create Dictionary    link-id=openflow:1:2    destination=${body1}    source=${body2}
     ${body1}    Create Dictionary    dest-node=openflow:2    dest-tp=openflow:2:3
     ${body2}    Create Dictionary    source-node=openflow:1    source-tp=openflow:1:1
-    ${link3}    Create Dictionary    link-id=openflow:1:1  destination=${body1}    source=${body2}
-    ${links}    Create List    ${link1}    ${link2}   ${link3}   ${link4}
-    ${resp}    Get    session    ${REST_CONTEXT_2}
-    Should Be Equal As Strings    ${resp.status_code}    200 
-    ${result}    To JSON    ${resp.content}
-    ${content}    Get From Dictionary    ${result}    topology
-    ${topology}    Get From List   ${content}    0
-    ${link}      Get From Dictionary    ${topology}    link
-    Sort List    ${link}
-    Lists Should be Equal    ${link}    ${links}
+    ${link3}    Create Dictionary    link-id=openflow:1:1    destination=${body1}    source=${body2}
+    ${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.
     [Tags]    add
-    ${body1}    Create Dictionary    dest-node=openflow:3    dest-tp=openflow:3:1 
-    ${body2}    Create Dictionary    source-node=openflow:2    source-tp=openflow:2:1 
-    ${body3}    Create Dictionary    link-id=userlink  destination=${body1}    source=${body2}
+    ${body1}    Create Dictionary    dest-node=openflow:3    dest-tp=openflow:3:1
+    ${body2}    Create Dictionary    source-node=openflow:2    source-tp=openflow:2:1
+    ${body3}    Create Dictionary    link-id=userlink    destination=${body1}    source=${body2}
     ${links}    Create List    ${body3}
     ${body}    Create Dictionary    link=${links}
-    ${resp}    Put    session    ${REST_CONTEXT_3}   data=${body}
+    ${resp}    Put    session    ${REST_CONTEXT_3}    data=${body}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${resp}    Get    session    ${REST_CONTEXT_3}
     Should Be Equal As Strings    ${resp.status_code}    200
@@ -67,11 +63,24 @@ Add a link
     ${link}    Get From Dictionary    ${result}    link
     Lists Should be Equal    ${link}    ${links}
 
-
 Remove a link
     [Documentation]    Remove a link, list to validate the result.
     [Tags]    remove
-    ${resp}    Delete   session    ${REST_CONTEXT_3}  
+    ${resp}    Delete    session    ${REST_CONTEXT_3}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${resp}    Get    session    ${REST_CONTEXT_3}
     Should Be Equal As Strings    ${resp.status_code}    404
+
+*** Keywords ***
+Verify Links
+    [Arguments]    ${expected_links}
+    ${resp}    Get    session    ${REST_CONTEXT_2}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    Log    ${result}
+    ${content}    Get From Dictionary    ${result}    topology
+    ${topology}    Get From List    ${content}    0
+    ${link}    Get From Dictionary    ${topology}    link
+    Sort List    ${link}
+    Lists Should be Equal    ${link}    ${expected_links}
index a4d4cfd839c6a12ca27607d962e5561224adce80..1e8ce38242c58c798300d49d0a6cc8b8390802bb 100644 (file)
@@ -1,60 +1,54 @@
 *** Settings ***
 Documentation     Test suite for RESTCONF FRM
-Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTCONFPORT}   auth=${AUTH}   headers=${HEADERS_XML}
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
 Suite Teardown    Delete All Sessions
 Library           Collections
 Library           ../../../libraries/RequestsLibrary.py
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${BODY2}          <flow xmlns="urn:opendaylight:flow:inventory"><priority>2</priority><flow-name>Foo</flow-name><match><ethernet-match><ethernet-type><type>2048</type></ethernet-type></ethernet-match><ipv4-destination>10.0.20.1/32</ipv4-destination></match><id>152</id><table_id>0</table_id><instructions><instruction><order>0</order><apply-actions><action><order>0</order><output-action><output-node-connector>openflow:1:1</output-node-connector></output-action></action></apply-actions></instruction></instructions></flow>
 
-${REST_CON}        /restconf/config/opendaylight-inventory:nodes
-${REST_OPR}        /restconf/operational/opendaylight-inventory:nodes
-${BODY2}                  <flow xmlns="urn:opendaylight:flow:inventory"><priority>2</priority><flow-name>Foo</flow-name><match><ethernet-match><ethernet-type><type>2048</type></ethernet-type></ethernet-match><ipv4-destination>10.0.20.1/32</ipv4-destination></match><id>152</id><table_id>0</table_id><instructions><instruction><order>0</order><apply-actions><action><order>0</order><output-action><output-node-connector>openflow:1:1</output-node-connector></output-action></action></apply-actions></instruction></instructions></flow>
-
-*** Test Cases *** 
+*** Test Cases ***
 Add a flow - Output to physical port#
     [Documentation]    Push a flow through REST-API
-    [Tags]   Push
-    ${resp}   Putxml    session   ${REST_CON}/node/openflow:1/table/0/flow/152    data=${BODY2}
+    [Tags]    Push
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/0/flow/152    data=${BODY2}
     Should Be Equal As Strings    ${resp.status_code}    200
 
 Verify after adding flow config - Output to physical port#
     [Documentation]    Verify the flow
-    [Tags]   Get
-    ${resp}    Get    session     ${REST_CON}/node/openflow:1/table/0
-    Should Be Equal As Strings    ${resp.status_code}    200  
-    Should Contain     ${resp.content}    152
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/0
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    152
+
 Verify after adding flow operational - Output to physical port#
     [Documentation]    Verify the flow
-    [Tags]   Get
-    Sleep    30
-    ${resp}    Get    session     ${REST_OPR}/node/openflow:1/table/0
-    Should Be Equal As Strings    ${resp.status_code}    200
-    Should Contain     ${resp.content}    10.0.20.1
+    [Tags]    Get
+    ${elements}=    Create List    10.0.20.1
+    Wait Until Keyword Succeeds    30s    2s    Check For Elements At URI    ${REST_OPR}/node/openflow:1/table/0    ${elements}
 
 Remove a flow - Output to physical port#
     [Documentation]    Remove a flow
     [Tags]    remove
-    ${resp}   Delete    session   ${REST_CON}/node/openflow:1/table/0/flow/152    
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/0/flow/152
     Should Be Equal As Strings    ${resp.status_code}    200
 
 Verify after deleting flow config - Output to physical port#
     [Documentation]    Verify the flow
-    [Tags]   Get
-    ${resp}    Get    session     ${REST_CON}/node/openflow:1/table/0
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/0
     Should Be Equal As Strings    ${resp.status_code}    200
-    Should Not Contain     ${resp.content}    152
+    Should Not Contain    ${resp.content}    152
+    #    Standing bug #368 - This has been fixed
 
-#    Standing bug #368 - This has been fixed
 Verify after deleting flow operational - Output to physical port#
     [Documentation]    Verify the flow
-    [Tags]   Get
-    Sleep    40
-    ${resp}    Get    session     ${REST_OPR}/node/openflow:1/table/0
-    Should Be Equal As Strings    ${resp.status_code}    200
-    Should Not Contain     ${resp.content}    10.0.20.1
-
+    [Tags]    Get
+    ${elements}=    Create List    10.0.20.1
+    Wait Until Keyword Succeeds    40s    2s    Check For Elements Not At URI    ${REST_OPR}/node/openflow:1/table/0    ${elements}
index ea644f144eff7b90f03284301c2a1a5d07b03d19..c8f389ca7126c37e408e8271bfe04b2e17555199 100644 (file)
@@ -2,26 +2,8 @@
 Documentation     Test suite for MD-SAL NSF
 Suite Setup       Start Suite
 Suite Teardown    Stop Suite
-Library     SSHLibrary
+Library           SSHLibrary
+Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
-${start}=   sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2 
-
-** Keywords ***
-Start Suite  
-    Log    Start mininet
-    Open Connection   ${MININET}     prompt=>
-    Login With Public Key    ${MININET_USER}   ${USER_HOME}/.ssh/id_rsa   any 
-    Write    sudo ovs-vsctl set-manager ptcp:6644
-    Write    sudo mn -c
-    Sleep    2
-    Write    ${start}
-    Sleep    30
-    Read
-Stop Suite
-    Log    Stop mininet
-    Read
-    Write    exit 
-    Sleep    6
-    Read 
-    Close Connection 
+${start}          sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,2
index ab87a8961aac44cb422abd7fde15d1f83f8b0575..bb7c8207c53c90cd9913ce65d14cca9f169a3edb 100644 (file)
@@ -1,46 +1,42 @@
 *** Settings ***
 Documentation     Test suite for RESTCONF inventory
-Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTCONFPORT}   auth=${AUTH}   headers=${HEADERS_XML}
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
 Suite Teardown    Delete All Sessions
 Library           Collections
 Library           ../../../libraries/RequestsLibrary.py
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
 ${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
+@{node_list}      openflow:1    openflow:2    openflow:3
 
-*** Test Cases *** 
+*** Test Cases ***
 Get list of nodes
     [Documentation]    Get the inventory
-       ${resp}    Get    session    ${REST_CONTEXT}
-       Should Be Equal As Strings    ${resp.status_code}    200
-       Should Contain     ${resp.content}      openflow:1
-       Should Contain     ${resp.content}      openflow:2
-       Should Contain     ${resp.content}      openflow:3
-       
+    ${resp}    Get    session    ${REST_CONTEXT}
+    Wait Until Keyword Succeeds    30s    2s    Ensure All Nodes Are In Response    ${REST_CONTEXT}    ${node_list}
+
 Get nodeconnector for a node 1
     [Documentation]    Get the inventory for a node
-        ${resp}    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
+    ${resp}    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
 
 Get nodeconnector for a node 2
     [Documentation]    Get the inventory for a node
-        ${resp}    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
+    ${resp}    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
 
 Get nodeconnector for a node 3
     [Documentation]    Get the inventory for a node
-       ${resp}    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
-
-       
-    
+    ${resp}    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
index 63f2886efeaf5b5c318620bfaaf4b1315ad347cc..162542ad80a90c4f80126a69908475588fbce6c7 100644 (file)
@@ -1,33 +1,27 @@
 *** Settings ***
 Documentation     Test suite for RESTCONF statistics
-Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTCONFPORT}   auth=${AUTH}   headers=${HEADERS_XML}
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
 Suite Teardown    Delete All Sessions
 Library           Collections
 Library           ../../../libraries/RequestsLibrary.py
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
 ${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
+@{node_list}      openflow:1    openflow:2    openflow:3
 
-*** Test Cases ***     
+*** Test Cases ***
 Get Stats for node 1
     [Documentation]    Get the stats for a node
-        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:1
-        Should Be Equal As Strings   ${resp.status_code}    200
-        Should Contain     ${resp.content}      flow-capable-node-connector-statistics
-        Should Contain     ${resp.content}      flow-table-statistics
+    Wait Until Keyword Succeeds    30s    2s    Ensure All Nodes Are In Response    ${REST_CONTEXT}    ${node_list}
+    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:1
 
 Get Stats for node 2
     [Documentation]    Get the stats for a node
-        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:2
-        Should Be Equal As Strings   ${resp.status_code}    200
-        Should Contain     ${resp.content}      flow-capable-node-connector-statistics
-        Should Contain     ${resp.content}      flow-table-statistics
+    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:2
 
 Get Stats for node 3
     [Documentation]    Get the stats for a node
-       ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:3
-       Should Be Equal As Strings   ${resp.status_code}    200
-       Should Contain     ${resp.content}      flow-capable-node-connector-statistics  
-       Should Contain     ${resp.content}      flow-table-statistics    
+    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:3
index 8322bcfa11543a8c5be142a4daee3c2ff73bda70..51f60c7c08d9b49af708cb0283c19ab3acb21236 100644 (file)
@@ -1,18 +1,20 @@
 *** Settings ***
-Documentation     Test suite RESTCONF Topology 
-Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTCONFPORT}   auth=${AUTH}   headers=${HEADERS}
+Documentation     Test suite RESTCONF Topology
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
 Suite Teardown    Delete All Sessions
 Library           Collections
 Library           ../../../libraries/RequestsLibrary.py
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
-${topology1}    "flow:1"
-${node1}    "openflow:1"
-${node2}    "openflow:2"
-${node3}    "openflow:3"
-${key}       link
+${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
@@ -21,45 +23,39 @@ ${REST_CONTEXT_3}    /restconf/config/network-topology:network-topology/topology
 Get RESTCONF Topology
     [Documentation]    Get RESTCONF Topology and validate the result.
     [Tags]    get
+    Wait Until Keyword Succeeds    30s    2s    Ensure All Nodes Are In Response    ${REST_CONTEXT_1}    ${node_list}
     ${resp}    Get    session    ${REST_CONTEXT_1}
-    Should Be Equal As Strings    ${resp.status_code}    200 
     Log    ${resp.content}
-    Should Contain   ${resp.content}   ${topology1}  
-   
+    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.
     [Tags]    get
     ${body1}    Create Dictionary    dest-node=openflow:1    dest-tp=openflow:1:2
     ${body2}    Create Dictionary    source-node=openflow:3    source-tp=openflow:3:3
-    ${link2}    Create Dictionary    link-id=openflow:3:3  destination=${body1}    source=${body2}
+    ${link2}    Create Dictionary    link-id=openflow:3:3    destination=${body1}    source=${body2}
     ${body1}    Create Dictionary    dest-node=openflow:1    dest-tp=openflow:1:1
     ${body2}    Create Dictionary    source-node=openflow:2    source-tp=openflow:2:3
-    ${link1}    Create Dictionary    link-id=openflow:2:3  destination=${body1}    source=${body2}
+    ${link1}    Create Dictionary    link-id=openflow:2:3    destination=${body1}    source=${body2}
     ${body1}    Create Dictionary    dest-node=openflow:3    dest-tp=openflow:3:3
     ${body2}    Create Dictionary    source-node=openflow:1    source-tp=openflow:1:2
-    ${link4}    Create Dictionary    link-id=openflow:1:2  destination=${body1}    source=${body2}
+    ${link4}    Create Dictionary    link-id=openflow:1:2    destination=${body1}    source=${body2}
     ${body1}    Create Dictionary    dest-node=openflow:2    dest-tp=openflow:2:3
     ${body2}    Create Dictionary    source-node=openflow:1    source-tp=openflow:1:1
-    ${link3}    Create Dictionary    link-id=openflow:1:1  destination=${body1}    source=${body2}
-    ${links}    Create List    ${link1}    ${link2}   ${link3}   ${link4}
-    ${resp}    Get    session    ${REST_CONTEXT_2}
-    Should Be Equal As Strings    ${resp.status_code}    200 
-    ${result}    To JSON    ${resp.content}
-    ${content}    Get From Dictionary    ${result}    topology
-    ${topology}    Get From List   ${content}    0
-    ${link}      Get From Dictionary    ${topology}    link
-    Sort List    ${link}
-    Lists Should be Equal    ${link}    ${links}
+    ${link3}    Create Dictionary    link-id=openflow:1:1    destination=${body1}    source=${body2}
+    ${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.
     [Tags]    add
-    ${body1}    Create Dictionary    dest-node=openflow:3    dest-tp=openflow:3:1 
-    ${body2}    Create Dictionary    source-node=openflow:2    source-tp=openflow:2:1 
-    ${body3}    Create Dictionary    link-id=userlink  destination=${body1}    source=${body2}
+    ${body1}    Create Dictionary    dest-node=openflow:3    dest-tp=openflow:3:1
+    ${body2}    Create Dictionary    source-node=openflow:2    source-tp=openflow:2:1
+    ${body3}    Create Dictionary    link-id=userlink    destination=${body1}    source=${body2}
     ${links}    Create List    ${body3}
     ${body}    Create Dictionary    link=${links}
-    ${resp}    Put    session    ${REST_CONTEXT_3}   data=${body}
+    ${resp}    Put    session    ${REST_CONTEXT_3}    data=${body}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${resp}    Get    session    ${REST_CONTEXT_3}
     Should Be Equal As Strings    ${resp.status_code}    200
@@ -67,11 +63,24 @@ Add a link
     ${link}    Get From Dictionary    ${result}    link
     Lists Should be Equal    ${link}    ${links}
 
-
 Remove a link
     [Documentation]    Remove a link, list to validate the result.
     [Tags]    remove
-    ${resp}    Delete   session    ${REST_CONTEXT_3}  
+    ${resp}    Delete    session    ${REST_CONTEXT_3}
     Should Be Equal As Strings    ${resp.status_code}    200
     ${resp}    Get    session    ${REST_CONTEXT_3}
     Should Be Equal As Strings    ${resp.status_code}    404
+
+*** Keywords ***
+Verify Links
+    [Arguments]    ${expected_links}
+    ${resp}    Get    session    ${REST_CONTEXT_2}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    To JSON    ${resp.content}
+    Log    ${result}
+    ${content}    Get From Dictionary    ${result}    topology
+    ${topology}    Get From List    ${content}    0
+    ${link}    Get From Dictionary    ${topology}    link
+    Sort List    ${link}
+    Lists Should be Equal    ${link}    ${expected_links}
index 6f1e0b07a6bd34aa367a85c58e56518f97d1592b..6f847fa48e71cffc8e006fa1f2085ad1b0edb1d8 100644 (file)
 *** Settings ***
 Documentation     Test suite for RESTCONF FRM
-Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTCONFPORT}   auth=${AUTH}   headers=${HEADERS_XML}
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
 Suite Teardown    Delete All Sessions
 Library           Collections
 Library           ../../../libraries/RequestsLibrary.py
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
+${REST_CON}       /restconf/config/opendaylight-inventory:nodes
+${REST_OPR}       /restconf/operational/opendaylight-inventory:nodes
+${BODY1}          <flow xmlns="urn:opendaylight:flow:inventory"><priority>2</priority><flow-name>Foo</flow-name><match><ethernet-match><ethernet-type><type>2048</type></ethernet-type></ethernet-match><ipv4-destination>10.0.10.1/32</ipv4-destination></match><id>139</id><table_id>2</table_id><instructions><instruction><order>0</order><apply-actions><action><order>0</order><dec-nw-ttl/></action></apply-actions></instruction></instructions></flow>
+${BODY2}          <flow xmlns="urn:opendaylight:flow:inventory"><priority>2</priority><flow-name>Foo</flow-name><match><ethernet-match><ethernet-type><type>2048</type></ethernet-type></ethernet-match><ipv4-destination>10.0.20.1/32</ipv4-destination></match><id>152</id><table_id>2</table_id><instructions><instruction><order>0</order><apply-actions><action><order>0</order><output-action><output-node-connector>1</output-node-connector><max-length>60</max-length></output-action></action></apply-actions></instruction></instructions></flow>
 
-${REST_CON}        /restconf/config/opendaylight-inventory:nodes
-${REST_OPR}        /restconf/operational/opendaylight-inventory:nodes
-${BODY1}                  <flow xmlns="urn:opendaylight:flow:inventory"><priority>2</priority><flow-name>Foo</flow-name><match><ethernet-match><ethernet-type><type>2048</type></ethernet-type></ethernet-match><ipv4-destination>10.0.10.1/32</ipv4-destination></match><id>139</id><table_id>2</table_id><instructions><instruction><order>0</order><apply-actions><action><order>0</order><dec-nw-ttl/></action></apply-actions></instruction></instructions></flow>
-${BODY2}                  <flow xmlns="urn:opendaylight:flow:inventory"><priority>2</priority><flow-name>Foo</flow-name><match><ethernet-match><ethernet-type><type>2048</type></ethernet-type></ethernet-match><ipv4-destination>10.0.20.1/32</ipv4-destination></match><id>152</id><table_id>2</table_id><instructions><instruction><order>0</order><apply-actions><action><order>0</order><output-action><output-node-connector>1</output-node-connector><max-length>60</max-length></output-action></action></apply-actions></instruction></instructions></flow>
-
-*** Test Cases *** 
+*** Test Cases ***
 Add a flow - Sending IPv4 Dest Address and Eth type
     [Documentation]    Push a flow through REST-API
-    [Tags]   Push
-    ${resp}   Putxml    session   ${REST_CON}/node/openflow:1/table/2/flow/139    data=${BODY1}
+    [Tags]    Push
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/2/flow/139    data=${BODY1}
     Should Be Equal As Strings    ${resp.status_code}    200
-       
+
 Verify after adding flow config - Sending IPv4 Dest Address and Eth type
     [Documentation]    Verify the flow
-    [Tags]   Get
-    ${resp}    Get    session     ${REST_CON}/node/openflow:1/table/2
-    Should Be Equal As Strings    ${resp.status_code}    200  
-    Should Contain     ${resp.content}    139    
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/2
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    139
 
 Verify after adding flow operational - Sending IPv4 Dest Address and Eth type
     [Documentation]    Verify the flow
-    [Tags]   Get
-    Sleep   30
-    ${resp}    Get    session     ${REST_OPR}/node/openflow:1/table/2
-    Should Be Equal As Strings    ${resp.status_code}    200
-    Should Contain     ${resp.content}    10.0.10.1
+    [Tags]    Get
+    ${elements}=    Create List    10.0.10.1
+    Wait Until Keyword Succeeds    30s    2s    Check For Elements At URI    ${REST_OPR}/node/openflow:1/table/2    ${elements}
 
 Remove a flow - - Sending IPv4 Dest Address and Eth type
     [Documentation]    Remove a flow
     [Tags]    remove
-    ${resp}   Delete    session   ${REST_CON}/node/openflow:1/table/2/flow/139    
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/2/flow/139
     Should Be Equal As Strings    ${resp.status_code}    200
-   
+
 Verify after deleting flow config - Sending IPv4 Dest Address and Eth type
     [Documentation]    Verify the flow
-    [Tags]   Get
-    ${resp}    Get    session     ${REST_CON}/node/openflow:1/table/2
-    Should Be Equal As Strings    ${resp.status_code}    200  
-    Should Not Contain     ${resp.content}    139
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/2
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Not Contain    ${resp.content}    139
+    # Reason in using high time is, I used STOPWATCH to check the timer after deleting the flow config
 
-# Reason in using high time is, I used STOPWATCH to check the timer after deleting the flow config
 Verify after deleting flow operational - Sending IPv4 Dest Address and Eth type
     [Documentation]    Verify the flow
-    [Tags]   Get
-    Sleep   30
-    ${resp}    Get    session     ${REST_OPR}/node/openflow:1/table/2
-    Should Be Equal As Strings    ${resp.status_code}    200
-    Should Not Contain     ${resp.content}    10.0.10.1
+    [Tags]    Get
+    ${elements}=    Create List    10.0.10.1
+    Wait Until Keyword Succeeds    40s    2s    Check For Elements Not At URI    ${REST_OPR}/node/openflow:1/table/2    ${elements}
+
 Add a flow - Output to physical port#
     [Documentation]    Push a flow through REST-API
-    [Tags]   Push
-    ${resp}   Putxml    session   ${REST_CON}/node/openflow:1/table/2/flow/152    data=${BODY2}
+    [Tags]    Push
+    ${resp}    Putxml    session    ${REST_CON}/node/openflow:1/table/2/flow/152    data=${BODY2}
     Should Be Equal As Strings    ${resp.status_code}    200
 
 Verify after adding flow config - Output to physical port#
     [Documentation]    Verify the flow
-    [Tags]   Get
-    ${resp}    Get    session     ${REST_CON}/node/openflow:1/table/2
-    Should Be Equal As Strings    ${resp.status_code}    200  
-    Should Contain     ${resp.content}    152
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/2
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    152
+
 Verify after adding flow operational - Output to physical port#
     [Documentation]    Verify the flow
-    [Tags]   Get
-    Sleep    30        
-    ${resp}    Get    session     ${REST_OPR}/node/openflow:1/table/2
-    Should Be Equal As Strings    ${resp.status_code}    200
-    Should Contain     ${resp.content}    10.0.20.1
+    [Tags]    Get
+    ${elements}=    Create List    10.0.20.1
+    Wait Until Keyword Succeeds    30s    2s    Check For Elements At URI    ${REST_OPR}/node/openflow:1/table/2    ${elements}
 
 Remove a flow - Output to physical port#
     [Documentation]    Remove a flow
     [Tags]    remove
-    ${resp}   Delete    session   ${REST_CON}/node/openflow:1/table/2/flow/152    
+    ${resp}    Delete    session    ${REST_CON}/node/openflow:1/table/2/flow/152
     Should Be Equal As Strings    ${resp.status_code}    200
 
 Verify after deleting flow config - Output to physical port#
     [Documentation]    Verify the flow
-    [Tags]   Get
-    ${resp}    Get    session     ${REST_CON}/node/openflow:1/table/2
-    Should Be Equal As Strings    ${resp.status_code}    200 
-    Should Not Contain     ${resp.content}    152
+    [Tags]    Get
+    ${resp}    Get    session    ${REST_CON}/node/openflow:1/table/2
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Not Contain    ${resp.content}    152
 
 Verify after deleting flow operational - Output to physical port#
     [Documentation]    Verify the flow
-    [Tags]   Get
-    Sleep    40
-    ${resp}    Get    session     ${REST_OPR}/node/openflow:1/table/2
-    Should Be Equal As Strings    ${resp.status_code}    200
-    Should Not Contain     ${resp.content}    10.0.20.1
-
+    [Tags]    Get
+    ${elements}=    Create List    10.0.20.1
+    Wait Until Keyword Succeeds    40s    2s    Check For Elements Not At URI    ${REST_OPR}/node/openflow:1/table/2    ${elements}
index 7b77f73dc1abbe35e8840cbd5c2fe191ac7ac92d..b46e60a8d529f505df22a1916d43a662d4a9e892 100644 (file)
@@ -3,25 +3,9 @@ Documentation     Test suite for MD-SAL NSF mininet 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 
 
 ** Keywords ***
-Start Suite  
-    Log    Start mininet
-    Open Connection   ${MININET}     prompt=>
-    Login With Public Key    ${MININET_USER}   ${USER_HOME}/.ssh/id_rsa   any 
-    Write    sudo ovs-vsctl set-manager ptcp:6644
-    Write    sudo mn -c
-    Sleep    2
-    Write    ${start}
-    Sleep    30
-    Read
-Stop Suite
-    Log    Stop mininet
-    Read
-    Write    exit 
-    Sleep    6
-    Read 
-    Close Connection 
index 9bd466e39c4226427ce76479a7944eda8a96a7de..3f1595b1d89f9a18b6741cdf1707624dca3aaf02 100644 (file)
@@ -1,43 +1,37 @@
 *** Settings ***
 Documentation     Test suite for Statistics Manager
-Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTPORT}   auth=${AUTH}   headers=${HEADERS}
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
 Suite Teardown    Delete All Sessions
 Library           Collections
 Library           ../../../libraries/RequestsLibrary.py
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
-${node1}       "00:00:00:00:00:00:00:01"
-${node2}       "00:00:00:00:00:00:00:02"
-${node3}       "00:00:00:00:00:00:00:03"
-${key}             portStatistics
+${node1}          "00:00:00:00:00:00:00:01"
+${node2}          "00:00:00:00:00:00:00:02"
+${node3}          "00:00:00:00:00:00:00:03"
+@{macaddr_list}    ${node1}    ${node2}    ${node3}
+@{node_list}      openflow:1    openflow:2    openflow: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 Be Equal As Strings    ${resp.status_code}    200 
-    Should Contain X Times   ${resp.content}    ${node1}    4
-    Should Contain X Times   ${resp.content}    ${node2}    5
-    Should Contain X Times   ${resp.content}    ${node3}    5
+    Wait Until Keyword Succeeds    30s    2s    Ensure All Nodes Are In Response    /restconf/operational/opendaylight-inventory:nodes    ${node_list}
+    Wait Until Keyword Succeeds    10s    2s    Check That Port Count Is Ok    ${node1}    4
+    Wait Until Keyword Succeeds    10s    1s    Check That Port Count Is Ok    ${node2}    5
+    Wait Until Keyword Succeeds    10s    1s    Check That Port Count Is Ok    ${node3}    5
+
 get flow stats
     [Documentation]    Show flow stats and validate result
     [Tags]    get
-    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/flow
-    Should Be Equal As Strings    ${resp.status_code}    200 
-    Should Contain    ${resp.content}    ${node1}
-    Should Contain    ${resp.content}    ${node2}
-    Should Contain    ${resp.content}    ${node3}
+    Wait Until Keyword Succeeds    30s    2s    Check For Elements At URI    ${REST_CONTEXT}/${CONTAINER}/flow    ${macaddr_list}
+
 get table stats
     [Documentation]    Show flow stats and validate result
     [Tags]    get
-    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/table
-    Should Be Equal As Strings    ${resp.status_code}    200 
-    Should Contain    ${resp.content}    ${node1}
-    Should Contain    ${resp.content}    ${node2}
-    Should Contain    ${resp.content}    ${node3}
-
+    Wait Until Keyword Succeeds    30s    2s    Check For Elements At URI    ${REST_CONTEXT}/${CONTAINER}/table    ${macaddr_list}
index 230d6e771c651d980b1e61ec25dab89010c6671b..8e0a6a6dc581964736b5b4dac40cec0e189f3fb4 100644 (file)
@@ -1,16 +1,17 @@
 *** Settings ***
 Documentation     Test suite for Topology Manager
-Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTPORT}   auth=${AUTH}   headers=${HEADERS}
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
 Suite Teardown    Delete All Sessions
 Library           Collections
 Library           ../../../libraries/RequestsLibrary.py
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
-${node1}   "00:00:00:00:00:00:00:01"
-${node2}   "00:00:00:00:00:00:00:02"
-${node3}   "00:00:00:00:00:00:00:03"
+${node1}          "00:00:00:00:00:00:00:01"
+${node2}          "00:00:00:00:00:00:00:02"
+${node3}          "00:00:00:00:00:00:00:03"
 ${name}           test_userlink1
 ${key}            userLinks
 ${REST_CONTEXT}    /controller/nb/v2/topology
@@ -19,12 +20,10 @@ ${REST_CONTEXT}    /controller/nb/v2/topology
 Get Topology
     [Documentation]    Get Topology and validate the result.
     [Tags]    get
-    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}
-    Should Be Equal As Strings    ${resp.status_code}    200 
-    Log    ${resp.content}
-    Should Contain X Times  ${resp.content}   ${node1}   4
-    Should Contain X Times  ${resp.content}   ${node2}   2
-    Should Contain X Times  ${resp.content}   ${node3}   2
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${REST_CONTEXT}/${CONTAINER}    ${node1}    4
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${REST_CONTEXT}/${CONTAINER}    ${node1}    4
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${REST_CONTEXT}/${CONTAINER}    ${node1}    4
+
 Add a userlink
     [Documentation]    Add a userlink, list to validate the result.
     [Tags]    add
@@ -37,6 +36,7 @@ Add a userlink
     ${result}    To JSON    ${resp.content}
     ${content}    Get From Dictionary    ${result}    ${key}
     List Should Contain Value    ${content}    ${body}
+
 Remove a userlink
     [Documentation]    Remove a userlink, list to validate the result.
     [Tags]    remove
index 207406366f607991aecaf3a743a277e0cbcea5ae..8a8c1943c6bd9e3d48a075c7b4ea23eeac7933bf 100644 (file)
@@ -3,25 +3,9 @@ Documentation     Test suite for AD-SAL NSF
 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 
 
 ** Keywords ***
-Start Suite  
-    Log    Start mininet
-    Open Connection   ${MININET}     prompt=>
-    Login With Public Key    ${MININET_USER}   ${USER_HOME}/.ssh/id_rsa   any 
-    Write    sudo ovs-vsctl set-manager ptcp:6644
-    Write    sudo mn -c
-    Sleep    2
-    Write    ${start}
-    Sleep    30
-    Read
-Stop Suite
-    Log    Stop mininet
-    Read
-    Write    exit 
-    Sleep    6
-    Read 
-    Close Connection 
index 9bd466e39c4226427ce76479a7944eda8a96a7de..3f1595b1d89f9a18b6741cdf1707624dca3aaf02 100644 (file)
@@ -1,43 +1,37 @@
 *** Settings ***
 Documentation     Test suite for Statistics Manager
-Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTPORT}   auth=${AUTH}   headers=${HEADERS}
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
 Suite Teardown    Delete All Sessions
 Library           Collections
 Library           ../../../libraries/RequestsLibrary.py
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
-${node1}       "00:00:00:00:00:00:00:01"
-${node2}       "00:00:00:00:00:00:00:02"
-${node3}       "00:00:00:00:00:00:00:03"
-${key}             portStatistics
+${node1}          "00:00:00:00:00:00:00:01"
+${node2}          "00:00:00:00:00:00:00:02"
+${node3}          "00:00:00:00:00:00:00:03"
+@{macaddr_list}    ${node1}    ${node2}    ${node3}
+@{node_list}      openflow:1    openflow:2    openflow: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 Be Equal As Strings    ${resp.status_code}    200 
-    Should Contain X Times   ${resp.content}    ${node1}    4
-    Should Contain X Times   ${resp.content}    ${node2}    5
-    Should Contain X Times   ${resp.content}    ${node3}    5
+    Wait Until Keyword Succeeds    30s    2s    Ensure All Nodes Are In Response    /restconf/operational/opendaylight-inventory:nodes    ${node_list}
+    Wait Until Keyword Succeeds    10s    2s    Check That Port Count Is Ok    ${node1}    4
+    Wait Until Keyword Succeeds    10s    1s    Check That Port Count Is Ok    ${node2}    5
+    Wait Until Keyword Succeeds    10s    1s    Check That Port Count Is Ok    ${node3}    5
+
 get flow stats
     [Documentation]    Show flow stats and validate result
     [Tags]    get
-    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/flow
-    Should Be Equal As Strings    ${resp.status_code}    200 
-    Should Contain    ${resp.content}    ${node1}
-    Should Contain    ${resp.content}    ${node2}
-    Should Contain    ${resp.content}    ${node3}
+    Wait Until Keyword Succeeds    30s    2s    Check For Elements At URI    ${REST_CONTEXT}/${CONTAINER}/flow    ${macaddr_list}
+
 get table stats
     [Documentation]    Show flow stats and validate result
     [Tags]    get
-    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/table
-    Should Be Equal As Strings    ${resp.status_code}    200 
-    Should Contain    ${resp.content}    ${node1}
-    Should Contain    ${resp.content}    ${node2}
-    Should Contain    ${resp.content}    ${node3}
-
+    Wait Until Keyword Succeeds    30s    2s    Check For Elements At URI    ${REST_CONTEXT}/${CONTAINER}/table    ${macaddr_list}
index 230d6e771c651d980b1e61ec25dab89010c6671b..8e0a6a6dc581964736b5b4dac40cec0e189f3fb4 100644 (file)
@@ -1,16 +1,17 @@
 *** Settings ***
 Documentation     Test suite for Topology Manager
-Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTPORT}   auth=${AUTH}   headers=${HEADERS}
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
 Suite Teardown    Delete All Sessions
 Library           Collections
 Library           ../../../libraries/RequestsLibrary.py
 Library           ../../../libraries/Common.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
-${node1}   "00:00:00:00:00:00:00:01"
-${node2}   "00:00:00:00:00:00:00:02"
-${node3}   "00:00:00:00:00:00:00:03"
+${node1}          "00:00:00:00:00:00:00:01"
+${node2}          "00:00:00:00:00:00:00:02"
+${node3}          "00:00:00:00:00:00:00:03"
 ${name}           test_userlink1
 ${key}            userLinks
 ${REST_CONTEXT}    /controller/nb/v2/topology
@@ -19,12 +20,10 @@ ${REST_CONTEXT}    /controller/nb/v2/topology
 Get Topology
     [Documentation]    Get Topology and validate the result.
     [Tags]    get
-    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}
-    Should Be Equal As Strings    ${resp.status_code}    200 
-    Log    ${resp.content}
-    Should Contain X Times  ${resp.content}   ${node1}   4
-    Should Contain X Times  ${resp.content}   ${node2}   2
-    Should Contain X Times  ${resp.content}   ${node3}   2
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${REST_CONTEXT}/${CONTAINER}    ${node1}    4
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${REST_CONTEXT}/${CONTAINER}    ${node1}    4
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${REST_CONTEXT}/${CONTAINER}    ${node1}    4
+
 Add a userlink
     [Documentation]    Add a userlink, list to validate the result.
     [Tags]    add
@@ -37,6 +36,7 @@ Add a userlink
     ${result}    To JSON    ${resp.content}
     ${content}    Get From Dictionary    ${result}    ${key}
     List Should Contain Value    ${content}    ${body}
+
 Remove a userlink
     [Documentation]    Remove a userlink, list to validate the result.
     [Tags]    remove
index c79119017fb571a085670459471d262af6dc5335..36c2d662109751f4fed4ada7a64340d3dcb8787b 100644 (file)
@@ -3,25 +3,9 @@ Documentation     Test suite for AD-SAL NSF mininet 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 
 
 ** Keywords ***
-Start Suite  
-    Log    Start mininet
-    Open Connection   ${MININET}     prompt=>
-    Login With Public Key    ${MININET_USER}   ${USER_HOME}/.ssh/id_rsa   any 
-    Write    sudo ovs-vsctl set-manager ptcp:6644
-    Write    sudo mn -c
-    Sleep    2
-    Write    ${start}
-    Sleep    30
-    Read
-Stop Suite
-    Log    Stop mininet
-    Read
-    Write    exit 
-    Sleep    6
-    Read 
-    Close Connection 
index a951e5a8982fb2a1ab73fa7b23bd9bee17c11ad0..17abe5645c947479e606b9d58c2530a7fbf394ec 100644 (file)
@@ -3,25 +3,9 @@ Documentation     Test suite for AD-SAL Applications
 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 
 
 ** Keywords ***
-Start Suite  
-    Log    Start mininet
-    Open Connection   ${MININET}     prompt=>
-    Login With Public Key    ${MININET_USER}   ${USER_HOME}/.ssh/id_rsa   any 
-    Write    sudo ovs-vsctl set-manager ptcp:6644
-    Write    sudo mn -c
-    Sleep    2
-    Write    ${start}
-    Sleep    30
-    Read
-Stop Suite
-    Log    Stop mininet
-    Read
-    Write    exit 
-    Sleep    6
-    Read 
-    Close Connection 
index 0f342eaf5623aa4c60441d40d98ea750cd2eec90..a2546e9e1245fbb897fad8906fe8926bfef258de 100644 (file)
@@ -3,25 +3,10 @@ Documentation     Test suite for AD-SAL Applications mininet 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 
 
 ** Keywords ***
-Start Suite  
-    Log    Start mininet
-    Open Connection   ${MININET}     prompt=>
-    Login With Public Key    ${MININET_USER}   ${USER_HOME}/.ssh/id_rsa   any 
-    Write    sudo ovs-vsctl set-manager ptcp:6644
-    Write    sudo mn -c
-    Sleep    2
-    Write    ${start}
-    Sleep    30
-    Read
-Stop Suite
-    Log    Stop mininet
-    Read
-    Write    exit 
-    Sleep    6
-    Read 
-    Close Connection 
index c4c6f0000856d38ff61d91bd6c77948e4375b104..10ece1e24de140cae4038eefd0666a361109512d 100644 (file)
@@ -1,26 +1,9 @@
 *** Settings ***
-Documentation     Test suite for the OpenDaylight base edition with of10
+Documentation     Flow test suite for the OpenDaylight karaf-compatible feature set
 Suite Setup       Start Suite
 Suite Teardown    Stop Suite
-Library           SSHLibrary
+Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
-${start}          sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,1 --switch ovsk,protocols=OpenFlow13
 
 *** Keywords ***
-Start Suite
-    Log    Start the test on the base edition
-    Open Connection    ${MININET}    prompt=>
-    Login With Public Key    ${MININET_USER}    ${USER_HOME}/.ssh/id_rsa    any
-    Write    sudo ovs-vsctl set-manager ptcp:6644
-    Write    sudo mn -c
-    Read Until  > 
-    Write    ${start}
-    Read Until  mininet>
-
-Stop Suite
-    Log    Stop the test on the base edition
-    Read
-    Write    exit
-    Read Until  >
-    Close Connection
index 2666d05e2ccbed76c0d02d953e5b7be01aa8d6a5..f1e303d2eaf15c4a1349c2498df806cf283e7844 100644 (file)
 *** Settings ***
 Documentation     Test suite for Stats Manager flows collection
-Library        OperatingSystem
-Library        Collections
-Library        XML
-Library        ../../../libraries/XmlComparator.py
-Variables      ../../../variables/Variables.py
-Library        ../../../libraries/RequestsLibrary.py
-Library        ../../../libraries/Common.py
 Suite Setup       Initialization Phase
 Suite Teardown    Teardown Phase
-
+Library           OperatingSystem
+Library           Collections
+Library           XML
+Library           ../../../libraries/XmlComparator.py
+Variables         ../../../variables/Variables.py
+Library           ../../../libraries/RequestsLibrary.py
+Library           ../../../libraries/Common.py
 
 *** Variables ***
-${XmlsDir}=       ${CURDIR}/../../../variables/xmls
-${switch_idx}=    1
-${switch_name}=   s${switch_idx}
-@{xml_files}=     f1.xml  f2.xml  f3.xml  f5.xml  f7.xml  f8.xml  f9.xml  f10.xml  f11.xml  f12.xml  f13.xml  f14.xml  f17.xml  f19.xml  f24.xml
-
+${XmlsDir}        ${CURDIR}/../../../variables/xmls
+${switch_idx}     1
+${switch_name}    s${switch_idx}
+@{xml_files}      f1.xml    f2.xml    f3.xml    f5.xml    f7.xml    f8.xml    f9.xml
+...               f10.xml    f11.xml    f12.xml    f13.xml    f14.xml    f17.xml    f19.xml
+...               f24.xml
 
 *** Test Cases ***
 Test Add Flows
-   [Documentation]    Add all flows and waits for SM to collect data
-     :FOR   ${flowfile}   IN   @{xml_files}
-     \       Log   ${flowfile}
-     \       Init Flow Variables  ${flowfile}
-     \       Run Keyword And Continue On Failure   Add Flow
-     Sleep  30s
+    [Documentation]    Add all flows and waits for SM to collect data
+    : FOR    ${flowfile}    IN    @{xml_files}
+    \    Log    ${flowfile}
+    \    Init Flow Variables    ${flowfile}
+    \    Run Keyword And Continue On Failure    Add Flow
+
 Test Is Flow 1 Added
     [Documentation]    Checks if flow is configured and operational
-      Init Flow Variables       f1.xml
-      Check Config Flow         ${True}
-      Check Operational Table   ${True}
+    Init Flow Variables    f1.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
 Test Is Flow 2 Added
     [Documentation]    Checks if flow is configured and operational
-      Init Flow Variables       f2.xml
-      Check Config Flow         ${True}
-      Check Operational Table   ${True}
+    Init Flow Variables    f2.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
 Test Is Flow 3 Added
     [Documentation]    Checks if flow is configured and operational
-      Init Flow Variables       f3.xml
-      Check Config Flow         ${True}
-      Check Operational Table   ${True}
+    Init Flow Variables    f3.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
 Test Is Flow 5 Added
     [Documentation]    Checks if flow is configured and operational
-      Init Flow Variables       f5.xml
-      Check Config Flow         ${True}
-      Check Operational Table   ${True}
+    Init Flow Variables    f5.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
 Test Is Flow 7 Added
     [Documentation]    Checks if flow is configured and operational
-      Init Flow Variables       f7.xml
-      Check Config Flow         ${True}
-      Check Operational Table   ${True}
+    Init Flow Variables    f7.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
 Test Is Flow 8 Added
     [Documentation]    Checks if flow is configured and operational
-      Init Flow Variables       f8.xml
-      Check Config Flow         ${True}
-      Check Operational Table   ${True}
+    Init Flow Variables    f8.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
 Test Is Flow 9 Added
     [Documentation]    Checks if flow is configured and operational
-      Init Flow Variables       f9.xml
-      Check Config Flow         ${True}
-      Check Operational Table   ${True}
+    Init Flow Variables    f9.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
 Test Is Flow 10 Added
     [Documentation]    Checks if flow is configured and operational
-      Init Flow Variables       f10.xml
-      Check Config Flow         ${True}
-      Check Operational Table   ${True}
+    Init Flow Variables    f10.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
 Test Is Flow 11 Added
     [Documentation]    Checks if flow is configured and operational
-      Init Flow Variables       f11.xml
-      Check Config Flow         ${True}
-      Check Operational Table   ${True}
+    Init Flow Variables    f11.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
 Test Is Flow 12 Added
     [Documentation]    Checks if flow is configured and operational
-      Init Flow Variables       f12.xml
-      Check Config Flow         ${True}
-      Check Operational Table   ${True}
+    Init Flow Variables    f12.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
 Test Is Flow 13 Added
     [Documentation]    Checks if flow is configured and operational
-      Init Flow Variables       f13.xml
-      Check Config Flow         ${True}
-      Check Operational Table   ${True}
+    Init Flow Variables    f13.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
 Test Is Flow 14 Added
     [Documentation]    Checks if flow is configured and operational
-      Init Flow Variables       f14.xml
-      Check Config Flow         ${True}
-      Check Operational Table   ${True}
+    Init Flow Variables    f14.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
 Test Is Flow 17 Added
     [Documentation]    Checks if flow is configured and operational
-      Init Flow Variables       f17.xml
-      Check Config Flow         ${True}
-      Check Operational Table   ${True}
+    Init Flow Variables    f17.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
 Test Is Flow 19 Added
     [Documentation]    Checks if flow is configured and operational
-      Init Flow Variables       f19.xml
-      Check Config Flow         ${True}
-      Check Operational Table   ${True}
+    Init Flow Variables    f19.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
 Test Is Flow 24 Added
     [Documentation]    Checks if flow is configured and operational
-      Init Flow Variables       f24.xml
-      Check Config Flow         ${True}
-      Check Operational Table   ${True}
+    Init Flow Variables    f24.xml
+    Check Config Flow    ${True}
+    Check Operational Table    ${True}
+
 Test Delete Flows
-   [Documentation]    Delete all flows and waits for SM to collect data
-     :FOR   ${flowfile}   IN   @{xml_files}
-     \       Log   ${flowfile}
-     \       Init Flow Variables   ${flowfile}
-     \       Run Keyword And Continue On Failure   Delete Flow
-     Sleep  40s
+    [Documentation]    Delete all flows and waits for SM to collect data
+    : FOR    ${flowfile}    IN    @{xml_files}
+    \    Log    ${flowfile}
+    \    Init Flow Variables    ${flowfile}
+    \    Run Keyword And Continue On Failure    Delete Flow
+
 Test Is Flow 1 Deleted
-    [Documentation]    Checks if flow is not configured and operational 
-      Init Flow Variables       f1.xml
-      Check Config Flow         ${False}
-      Check Operational Table   ${False}
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f1.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
 Test Is Flow 2 Deleted
-    [Documentation]    Checks if flow is not configured and operational 
-      Init Flow Variables       f2.xml
-      Check Config Flow         ${False}
-      Check Operational Table   ${False}
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f2.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
 Test Is Flow 3 Deleted
-    [Documentation]    Checks if flow is not configured and operational 
-      Init Flow Variables       f3.xml
-      Check Config Flow         ${False}
-      Check Operational Table   ${False}
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f3.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
 Test Is Flow 5 Deleted
-    [Documentation]    Checks if flow is not configured and operational 
-      Init Flow Variables       f5.xml
-      Check Config Flow         ${False}
-      Check Operational Table   ${False}
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f5.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
 Test Is Flow 7 Deleted
-    [Documentation]    Checks if flow is not configured and operational 
-      Init Flow Variables       f7.xml
-      Check Config Flow         ${False}
-      Check Operational Table   ${False}
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f7.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
 Test Is Flow 8 Deleted
-    [Documentation]    Checks if flow is not configured and operational 
-      Init Flow Variables       f8.xml
-      Check Config Flow         ${False}
-      Check Operational Table   ${False}
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f8.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
 Test Is Flow 9 Deleted
-    [Documentation]    Checks if flow is not configured and operational 
-      Init Flow Variables       f9.xml
-      Check Config Flow         ${False}
-      Check Operational Table   ${False}
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f9.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
 Test Is Flow 10 Deleted
-    [Documentation]    Checks if flow is not configured and operational 
-      Init Flow Variables       f10.xml
-      Check Config Flow         ${False}
-      Check Operational Table   ${False}
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f10.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
 Test Is Flow 11 Deleted
-    [Documentation]    Checks if flow is not configured and operational 
-      Init Flow Variables       f11.xml
-      Check Config Flow         ${False}
-      Check Operational Table   ${False}
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f11.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
 Test Is Flow 12 Deleted
-    [Documentation]    Checks if flow is not configured and operational 
-      Init Flow Variables       f12.xml
-      Check Config Flow         ${False}
-      Check Operational Table   ${False}
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f12.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
 Test Is Flow 13 Deleted
-    [Documentation]    Checks if flow is not configured and operational 
-      Init Flow Variables       f13.xml
-      Check Config Flow         ${False}
-      Check Operational Table   ${False}
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f13.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
 Test Is Flow 14 Deleted
-    [Documentation]    Checks if flow is not configured and operational 
-      Init Flow Variables       f14.xml
-      Check Config Flow         ${False}
-      Check Operational Table   ${False}
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f14.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
 Test Is Flow 17 Deleted
-    [Documentation]    Checks if flow is not configured and operational 
-      Init Flow Variables       f17.xml
-      Check Config Flow         ${False}
-      Check Operational Table   ${False}
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f17.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
+
 Test Is Flow 19 Deleted
-    [Documentation]    Checks if flow is not configured and operational 
-      Init Flow Variables       f19.xml
-      Check Config Flow         ${False}
-      Check Operational Table   ${False}
-Test Is Flow 24 Deleted
-    [Documentation]    Checks if flow is not configured and operational 
-      Init Flow Variables       f24.xml
-      Check Config Flow         ${False}
-      Check Operational Table   ${False}
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f19.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
 
+Test Is Flow 24 Deleted
+    [Documentation]    Checks if flow is not configured and operational
+    Init Flow Variables    f24.xml
+    Check Config Flow    ${False}
+    Check Operational Table    ${False}
 
 *** Keywords ***
-Init Flow Variables   [Arguments]   ${file}
-      ${data}=       Get File     ${XmlsDir}/${file}
-      ${xmlroot}=    Parse Xml    ${XmlsDir}/${file}
-      ${table_id}=   Get Element Text   ${xmlroot}   table_id
-      ${flow_id}=    Get Element Text   ${xmlroot}   id
-      ${flow_priority}=    Get Element Text   ${xmlroot}   priority
-      Set Suite Variable   ${table_id}
-      Set Suite Variable   ${flow_id}
-      Set Suite Variable   ${flow_priority}
-      Set Suite Variable   ${data}
-      Set Suite Variable   ${xmlroot}
-Check Config Flow   [Arguments]   ${expected}
-         ${presence_flow}   ${msg}=      Flow Presence Config Flow
-         ${msgf}=   Get Presence Failure Message    config    ${expected}    ${presence_flow}   ${msg} 
-         Should Be Equal    ${expected}  ${presence_flow}   msg=${msgf}
+Init Flow Variables
+    [Arguments]    ${file}
+    ${data}=    Get File    ${XmlsDir}/${file}
+    ${xmlroot}=    Parse Xml    ${XmlsDir}/${file}
+    ${table_id}=    Get Element Text    ${xmlroot}    table_id
+    ${flow_id}=    Get Element Text    ${xmlroot}    id
+    ${flow_priority}=    Get Element Text    ${xmlroot}    priority
+    Set Suite Variable    ${table_id}
+    Set Suite Variable    ${flow_id}
+    Set Suite Variable    ${flow_priority}
+    Set Suite Variable    ${data}
+    Set Suite Variable    ${xmlroot}
+
+Check Config Flow
+    [Arguments]    ${expected}
+    Wait Until Keyword Succeeds    40s    2s    Check Config Flow Presence    ${expected}
+
+Check Config Flow Presence
+    [Arguments]    ${expected}
+    ${presence_flow}    ${msg}=    Flow Presence Config Flow
+    ${msgf}=    Get Presence Failure Message    config    ${expected}    ${presence_flow}    ${msg}
+    Should Be Equal    ${expected}    ${presence_flow}    msg=${msgf}
+
 Flow Presence Config Flow
-         ${headers}=     Create Dictionary   Accept   application/xml
-         ${resp}=   Get  session  /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}  headers=${headers}
-         Log  ${resp}
-         Log  ${resp.content}
-         Return From Keyword If   ${resp.status_code}!=200  ${False}   ${EMPTY}
-         ${pres}  ${msg}=  Is Flow Configured  ${data}  ${resp.content}
-         Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-         Return From Keyword   ${pres}   ${msg}
-Check Operational Table  [Arguments]  ${expected}
-         ${presence_table}  ${msg}=  Flow Presence Operational Table
-         ${msgf}=   Get Presence Failure Message    config    ${expected}    ${presence_table}   ${msg} 
-         Should Be Equal  ${expected}  ${presence_table}  msg=${msgf}
-Flow Presence Operational Table 
-         ${headers}=      Create Dictionary   Accept   application/xml
-         ${resp}=   Get   session   /restconf/operational/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}   headers=${headers}
-         Log   ${resp}
-         Log   ${resp.content}
-         Return From Keyword If    ${resp.status_code}!=200   ${False}   ${EMPTY}
-         ${pres}   ${msg}=   Is Flow Operational2   ${data}   ${resp.content}
-         Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-         Return From Keyword   ${pres}   ${msg}
+    ${headers}=    Create Dictionary    Accept    application/xml
+    ${resp}=    Get    session    /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}    headers=${headers}
+    Log    ${resp}
+    Log    ${resp.content}
+    Return From Keyword If    ${resp.status_code}!=200    ${False}    ${EMPTY}
+    ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Return From Keyword    ${pres}    ${msg}
+
+Check Operational Table
+    [Arguments]    ${expected}
+    Wait Until Keyword Succeeds    40s    2s    Check Operational Table Presence    ${expected}
+
+Check Operational Table Presence
+    [Arguments]    ${expected}
+    ${presence_table}    ${msg}=    Flow Presence Operational Table
+    ${msgf}=    Get Presence Failure Message    config    ${expected}    ${presence_table}    ${msg}
+    Should Be Equal    ${expected}    ${presence_table}    msg=${msgf}
+
+Flow Presence Operational Table
+    ${headers}=    Create Dictionary    Accept    application/xml
+    ${resp}=    Get    session    /restconf/operational/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}    headers=${headers}
+    Log    ${resp}
+    Log    ${resp.content}
+    Return From Keyword If    ${resp.status_code}!=200    ${False}    ${EMPTY}
+    ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Return From Keyword    ${pres}    ${msg}
+
 Add Flow
-      Log             ${data}
-      ${resp}=        Putxml    session   /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}   data=${data}
-      ${msg}=  Set Variable   Adding flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
-      Should Be Equal As Strings   ${resp.status_code}   200   msg=${msg}
+    Log    ${data}
+    ${resp}=    Putxml    session    /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}    data=${data}
+    ${msg}=    Set Variable    Adding flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
+
 Delete Flow
-      ${resp}=  Delete   session   /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
-      ${msg}=  Set Variable  Delete flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
-      Should Be Equal As Strings   ${resp.status_code}   200   msg=${msg}
+    ${resp}=    Delete    session    /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
+    ${msg}=    Set Variable    Delete flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
+
 Delete All Flows
-   [Documentation]    Deletes all flows
-     :FOR   ${flowfile}   IN   @{xml_files}
-     \       Log   ${flowfile}
-     \       Init Flow Variables   ${flowfile}
-     \       Delete Flow
+    [Documentation]    Deletes all flows
+    : FOR    ${flowfile}    IN    @{xml_files}
+    \    Log    ${flowfile}
+    \    Init Flow Variables    ${flowfile}
+    \    Delete Flow
+
 Initialization Phase
-  [Documentation]   Initiate tcp connection with controller
-     Create Session   session   http://${CONTROLLER}:${PORT}   auth=${AUTH}   headers=${HEADERS_XML}
+    [Documentation]    Initiate tcp connection with controller
+    Create Session    session    http://${CONTROLLER}:${PORT}    auth=${AUTH}    headers=${HEADERS_XML}
+
 Teardown Phase
-  [Documentation]   Closes tcp connection with controller and removes flows
-     Delete All Sessions
-Get Presence Failure Message   [Arguments]   ${ds}   ${expected}   ${presence}  ${diffmsg}
-         Return From Keyword If   '''${diffmsg}'''!='${EMPTY}'  Flow found in ${ds} data store but: ${diffmsg}
-         ${msgf}=   Set Variable If   ${expected}==${True}   The flow is expected in operational data store, but   The flow is not expected in operational data store, but
-         ${msgp}=   Set Variable If   ${presence}==${True}   it is present.   it is not present.
-         Return From Keyword   ${msgf} ${msgp}
+    [Documentation]    Closes tcp connection with controller and removes flows
+    Delete All Sessions
+
+Get Presence Failure Message
+    [Arguments]    ${ds}    ${expected}    ${presence}    ${diffmsg}
+    Return From Keyword If    '''${diffmsg}'''!='${EMPTY}'    Flow found in ${ds} data store but: ${diffmsg}
+    ${msgf}=    Set Variable If    ${expected}==${True}    The flow is expected in operational data store, but    The flow is not expected in operational data store, but
+    ${msgp}=    Set Variable If    ${presence}==${True}    it is present.    it is not present.
+    Return From Keyword    ${msgf} ${msgp}
index e1c2c2381f5110610029ba77a8400e919877f422..3a8e9b7fba65be17ebe363c8006f735779da0aea 100644 (file)
@@ -3,27 +3,8 @@ Documentation     Test suite for the OpenDaylight base edition with of13, aimed
 Suite Setup       Start Suite
 Suite Teardown    Stop Suite
 Library           SSHLibrary
+Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
-${start}          sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,1 --switch ovsk,protocols=OpenFlow13
 
 *** Keywords ***
-Start Suite
-    Log    Start the test on the base edition
-    Open Connection    ${MININET}    prompt=>
-    Login With Public Key    ${MININET_USER}    ${USER_HOME}/.ssh/id_rsa    any
-    Write    sudo ovs-vsctl set-manager ptcp:6644
-    Write    sudo mn -c
-    Sleep    2
-    Write    ${start}
-    Sleep    20
-    Read
-
-Stop Suite
-    Log    Stop the test on the base edition
-    Read
-    Write    exit
-    Sleep    2
-    Read
-    Close Connection
-
index e2c038aa373bedcce0f6f5a1465ed50dab59e181..fd1aba32d94d8a09b612ba688d1a27f87b02c16f 100644 (file)
@@ -1,6 +1,6 @@
 *** Settings ***
 Documentation     Test suite for RESTCONF inventory
-Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTCONFPORT}   auth=${AUTH}   headers=${HEADERS_XML}
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
 Suite Teardown    Delete All Sessions
 Library           Collections
 Library           ../../../libraries/RequestsLibrary.py
@@ -10,48 +10,59 @@ Variables         ../../../variables/Variables.py
 *** Variables ***
 ${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
 
-
-*** Test Cases *** 
+*** Test Cases ***
 Get list of nodes
     [Documentation]    Get the inventory
-       ${resp}    Get    session    ${REST_CONTEXT}
+    ${resp}    Get    session    ${REST_CONTEXT}
+    Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
-       ${TOPO_TREE_DEPTH}    Convert To Integer  ${TOPO_TREE_DEPTH}
-       ${TOPO_TREE_FANOUT}   Convert To Integer  ${TOPO_TREE_FANOUT}
-       ${numnodes}             Num Of Nodes    ${TOPO_TREE_DEPTH}      ${TOPO_TREE_FANOUT}
-       :FOR    ${IND}  IN RANGE        1       ${numnodes+1}   
-    \   Should Contain     ${resp.content}  openflow:${IND}
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    : FOR    ${IND}    IN RANGE    1    ${numnodes+1}
+    \    Wait Until Keyword Succeeds    30s    2s    Should Contain    ${resp.content}    openflow:${IND}
 
-Get nodeconnector for the root node 
+Get nodeconnector for the root node
     [Documentation]    Get the inventory for the root node
-    ${TOPO_TREE_FANOUT}   Convert To Integer  ${TOPO_TREE_FANOUT}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
     ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:1
-    Should Be Equal As Strings   ${resp.status_code}    200
-    Check conn loop   ${TOPO_TREE_FANOUT}   1  ${resp.content}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Wait Until Keyword Succeeds    30s    2s    Check conn loop    ${TOPO_TREE_FANOUT}    1    ${resp.content}
 
-Get nodeconnector for a node 
+Get nodeconnector for a node
     [Documentation]    Get the inventory for a node
-    ${TOPO_TREE_DEPTH}    Convert To Integer  ${TOPO_TREE_DEPTH}
-    ${TOPO_TREE_FANOUT}   Convert To Integer  ${TOPO_TREE_FANOUT}
-    ${numnodes}     Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
-    :FOR    ${IND}  IN RANGE    2   ${numnodes+1}
-    \   ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:${IND}
-    \   Should Be Equal As Strings   ${resp.status_code}    200
-    \   Check conn loop   ${TOPO_TREE_FANOUT+1}   ${IND}  ${resp.content}
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    Wait Until Keyword Succeeds    30s    2s    Check Every Nodes Nodeconnector    ${numnodes}
 
 Get Stats for a node
     [Documentation]    Get the stats for a node
-    ${TOPO_TREE_DEPTH}    Convert To Integer  ${TOPO_TREE_DEPTH}
-    ${TOPO_TREE_FANOUT}   Convert To Integer  ${TOPO_TREE_FANOUT}
-    ${numnodes}     Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
-    :FOR    ${IND}  IN RANGE    1   ${numnodes+1}
-    \   ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:${IND}
-    \   Should Be Equal As Strings   ${resp.status_code}    200
-    \   Should Contain     ${resp.content}      flow-capable-node-connector-statistics 
-    \   Should Contain     ${resp.content}      flow-table-statistics
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    Wait Until Keyword Succeeds    60s    2s    Check Every Nodes Stats    ${numnodes}
 
 *** Keywords ***
+Check Every Nodes Stats
+    [Arguments]    ${numnodes}
+    : FOR    ${IND}    IN RANGE    1    ${numnodes+1}
+    \    ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:${IND}
+    \    Log    ${resp.content}
+    \    Should Be Equal As Strings    ${resp.status_code}    200
+    \    Should Contain    ${resp.content}    flow-capable-node-connector-statistics
+    \    Should Contain    ${resp.content}    flow-table-statistics
+
+Check Every Nodes Nodeconnector
+    [Arguments]    ${numnodes}
+    : FOR    ${IND}    IN RANGE    2    ${numnodes+1}
+    \    ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:${IND}
+    \    Log    ${resp.content}
+    \    Should Be Equal As Strings    ${resp.status_code}    200
+    \    Check conn loop    ${TOPO_TREE_FANOUT+1}    ${IND}    ${resp.content}
+
 Check conn loop
-    [Arguments]     ${arg}  ${outerind}     ${content}
-    :FOR    ${var}  IN RANGE    1   ${arg+1}
-    \   Should Contain     ${content}      openflow:${outerind}:${var}
+    [Arguments]    ${arg}    ${outerind}    ${content}
+    : FOR    ${var}    IN RANGE    1    ${arg+1}
+    \    Should Contain    ${content}    openflow:${outerind}:${var}
index ef1d359d95e365a0d7abc5a0c6ce6e99c4398aa9..b6b52bb26a36c9145f513780620c72a2ef721080 100644 (file)
@@ -1,6 +1,6 @@
 *** Settings ***
 Documentation     Test suite for RESTCONF topology
-Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTCONFPORT}   auth=${AUTH}   headers=${HEADERS_XML}
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
 Suite Teardown    Delete All Sessions
 Library           Collections
 Library           XML
@@ -11,24 +11,27 @@ Variables         ../../../variables/Variables.py
 *** Variables ***
 ${REST_CONTEXT}    /restconf/operational/network-topology:network-topology/topology/flow:1
 
-
-*** Test Cases *** 
+*** Test Cases ***
 Get Nodes Count
     [Documentation]    Checks the number of switches
-       ${resp}    Get    session    ${REST_CONTEXT}   headers=${ACCEPT_XML}
-        Should Be Equal As Strings    ${resp.status_code}    200
-       ${TOPO_TREE_DEPTH}    Convert To Integer  ${TOPO_TREE_DEPTH}
-       ${TOPO_TREE_FANOUT}   Convert To Integer  ${TOPO_TREE_FANOUT}
-       ${numnodes}             Num Of Nodes    ${TOPO_TREE_DEPTH}      ${TOPO_TREE_FANOUT}
-        ${count}=    Get Element Count    ${resp.content}    xpath=node
-        Should Be Equal As Numbers     ${count}     ${numnodes}
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    Wait Until Keyword Succeeds    60s    2s    Verify Element Count    ${REST_CONTEXT}    node    ${numnodes}
+
 Get Links Count
     [Documentation]    Checks the number of links
-        ${resp}    Get    session    ${REST_CONTEXT}   headers=${ACCEPT_XML}
-        Should Be Equal As Strings    ${resp.status_code}    200
-        ${TOPO_TREE_DEPTH}    Convert To Integer  ${TOPO_TREE_DEPTH}
-        ${TOPO_TREE_FANOUT}   Convert To Integer  ${TOPO_TREE_FANOUT}
-        ${numnodes}           Num Of Nodes    ${TOPO_TREE_DEPTH}      ${TOPO_TREE_FANOUT}
-        ${numlinks}           Evaluate        (${numnodes}-1)*2
-        ${count}=    Get Element Count    ${resp.content}    xpath=link
-        Should Be Equal As Numbers     ${count}     ${numlinks}
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    ${numlinks}    Evaluate    (${numnodes}-1)*2
+    Wait Until Keyword Succeeds    60s    2s    Verify Element Count    ${REST_CONTEXT}    link    ${numlinks}
+
+*** Keywords ***
+Verify Element Count
+    [Arguments]    ${URI}    ${xpath_location}    ${expected_count}
+    ${resp}    Get    session    ${REST_CONTEXT}    headers=${ACCEPT_XML}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${count}=    Get Element Count    ${resp.content}    xpath=${xpath_location}
+    Should Be Equal As Numbers    ${count}    ${expected_count}
index 841a85de26cb0a4029c0c4337e549e922fcf28b6..cb5f481f787670a5c412bb2668e091ee3b3357d3 100644 (file)
@@ -13,39 +13,44 @@ Library           ../../../libraries/Topologynew.py
 ${REST_CONTEXT}    /controller/nb/v2/switchmanager
 
 *** Test Cases ***
-
 List all nodes
     [Documentation]    List all nodes and their properties in the network.
     [Tags]    list_info
     Log    ${TOPO_TREE_LEVEL}
     ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})
     ${resp}    Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/nodes
-    Should Be Equal As Strings    ${resp.status_code}    200    Response   status code error
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
     ${jsondata}=    To JSON    ${resp.content}
     ${nodes}    Extract All Nodes    ${jsondata}
-    List Should Contain Sublist   ${nodes}    ${topo_nodes}
+    List Should Contain Sublist    ${nodes}    ${topo_nodes}
 
-Check root node connectors 
+Check root node connectors
     [Documentation]    List node connectors and verify all connectors are there
     [Tags]    list_info
     ${resp}    Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/node/OF/00:00:00:00:00:00:00:01
-    Should Be Equal As Strings    ${resp.status_code}    200    Response   status code error
-    ${TOPO_TREE_FANOUT}   Convert To Integer  ${TOPO_TREE_FANOUT}
-    Check conn loop     ${TOPO_TREE_FANOUT}   1   ${resp.content}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    Check conn loop    ${TOPO_TREE_FANOUT}    1    ${resp.content}
 
-Check node i connectors              
-    [Documentation]    List node connectors and verify all connectors are there                      
+Check node i connectors
+    [Documentation]    List node connectors and verify all connectors are there
     [Tags]    list_info
-    ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})   1
-    :FOR    ${ITEM}  IN     @{topo_nodes}
-    \   ${IND}  Get From Dictionary    ${ITEM}    id
-    \   ${resp}    Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/node/OF/${IND}
-    \   Should Be Equal As Strings   ${resp.status_code}    200
-    \   Check conn loop   ${TOPO_TREE_FANOUT+1}   ${IND}  ${resp.content}
+    ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})    1
+    Wait Until Keyword Succeeds    30s    2s    Check Every Nodes Connectors    ${topo_nodes}
 
 *** Keywords ***
-Check conn loop
-    [Arguments]     ${arg}  ${outerind}     ${content}
-    :FOR    ${var}  IN RANGE    0   ${arg+1}
-    \   Should Contain     ${content}      "id":"${var}"
+Check Every Nodes Connectors
+    [Arguments]    ${topo_nodes}
+    : FOR    ${ITEM}    IN    @{topo_nodes}
+    \    ${IND}    Get From Dictionary    ${ITEM}    id
+    \    ${resp}    Get    ${ODL_CONTROLLER_SESSION}    ${REST_CONTEXT}/default/node/OF/${IND}
+    \    Log    ${resp.content}
+    \    Should Be Equal As Strings    ${resp.status_code}    200
+    \    Check conn loop    ${TOPO_TREE_FANOUT+1}    ${IND}    ${resp.content}
 
+Check conn loop
+    [Arguments]    ${arg}    ${outerind}    ${content}
+    : FOR    ${var}    IN RANGE    0    ${arg+1}
+    \    Should Contain    ${content}    "id":"${var}"
index 790e59a7a6c19744366009b01fa5a3466b23bc73..c39df772150a556ee762eb7dccfc3bdf3a6b35a5 100644 (file)
@@ -1,48 +1,66 @@
 *** Settings ***
 Documentation     Test suite for Statistics Manager
-Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTPORT}   auth=${AUTH}   headers=${HEADERS}
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
 Suite Teardown    Delete All Sessions
 Library           Collections
 Library           ../../../libraries/RequestsLibrary.py
 Library           ../../../libraries/Common.py
 Library           ../../../libraries/Topologynew.py
 Variables         ../../../variables/Variables.py
+Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
-${nodeprefix}   openflow:
-${key}             portStatistics
+${nodeprefix}     openflow:
+${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 Be Equal As Strings    ${resp.status_code}    200 
-       ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})   1
-    Should Contain X Times   ${resp.content}    "00:00:00:00:00:00:00:01"      ${TOPO_TREE_FANOUT+2}    
-    :FOR    ${ITEM}  IN        @{topo_nodes}
-    \   ${IND}  Get From Dictionary    ${ITEM}    id
-    \   Should Contain X Times   ${resp.content}    "${IND}"    ${TOPO_TREE_FANOUT+3}
+    ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})    1
+    @{node_list}    Create Nodes List    ${topo_nodes}
+    Wait Until Keyword Succeeds    70s    2s    Check For Elements At URI    ${REST_CONTEXT}/${CONTAINER}/port    ${node_list}
 
 get flow stats
     [Documentation]    Show flow stats and validate result
     [Tags]    get
-    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/flow
-    Should Be Equal As Strings    ${resp.status_code}    200 
-       ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})
-    :FOR    ${ITEM}  IN     @{topo_nodes}
-    \   ${IND}  Get From Dictionary    ${ITEM}    id
-    \   Should Contain    ${resp.content}    "${IND}"
+    ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})
+    @{node_list}    Create Nodes List    ${topo_nodes}
+    Wait Until Keyword Succeeds    70s    2s    Check For Elements At URI    ${REST_CONTEXT}/${CONTAINER}/flow    ${node_list}
 
 get table stats
     [Documentation]    Show flow stats and validate result
     [Tags]    get
-    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/table
-    Should Be Equal As Strings    ${resp.status_code}    200 
     ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})
-    :FOR    ${ITEM}  IN     @{topo_nodes}
-    \   ${IND}  Get From Dictionary    ${ITEM}    id
-    \   Should Contain    ${resp.content}    "${IND}"
+    @{node_list}    Create Nodes List    ${topo_nodes}
+    Wait Until Keyword Succeeds    70s    2s    Check For Elements At URI    ${REST_CONTEXT}/${CONTAINER}/table    ${node_list}
+
+*** Keywords ***
+Check For Correct Number Of Nodes At URI
+    [Arguments]    ${uri}    ${topo_nodes}
+    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/${uri}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain X Times    ${resp.content}    "00:00:00:00:00:00:00:01"    ${TOPO_TREE_FANOUT+2}
+    : FOR    ${ITEM}    IN    @{topo_nodes}
+    \    ${IND}    Get From Dictionary    ${ITEM}    id
+    \    Should Contain X Times    ${resp.content}    "${IND}"    ${TOPO_TREE_FANOUT+3}
+
+Check For All Nodes At URI
+    [Arguments]    ${uri}    ${topo_nodes}
+    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/${uri}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    : FOR    ${ITEM}    IN    @{topo_nodes}
+    \    ${IND}    Get From Dictionary    ${ITEM}    id
+    \    Should Contain    ${resp.content}    "${IND}"
 
+Create Nodes List
+    [Arguments]    ${topo_dict}
+    ##init list
+    @{node_list}=    Create List
+    : FOR    ${ITEM}    IN    @{topo_dict}
+    \    ${IND}    Get From Dictionary    ${ITEM}    id
+    \    Append To List    ${node_list}    ${IND}
+    [Return]    @{node_list}
index d510c46025ad2e28dcfe065e4f39d01fc8915be5..de58db5764b1d706e1504fbe9b70c4de5103104f 100644 (file)
@@ -1,6 +1,6 @@
 *** Settings ***
 Documentation     Test suite for Topology Manager
-Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTPORT}   auth=${AUTH}   headers=${HEADERS}
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTPORT}    auth=${AUTH}    headers=${HEADERS}
 Suite Teardown    Delete All Sessions
 Library           Collections
 Library           ../../../libraries/RequestsLibrary.py
@@ -9,24 +9,27 @@ Library           ../../../libraries/Topologynew.py
 Variables         ../../../variables/Variables.py
 
 *** Variables ***
-${nodeprefix}   openflow:
+${nodeprefix}     openflow:
 ${REST_CONTEXT}    /controller/nb/v2/topology
 
 *** Test Cases ***
 Get Topology
     [Documentation]    Get Topology and validate the result.
     [Tags]    get
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${leaflist}    Get Ids Of Leaf Nodes    ${TOPO_TREE_FANOUT}    ${TOPO_TREE_DEPTH}
+    ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})    1
+    Wait Until Keyword Succeeds    30s    2s    Check Link Counts For Each Node    ${topo_nodes}    ${leaflist}
+
+*** Keywords ***
+Check Link Counts For Each Node
+    [Arguments]    ${topo_nodes}    ${leaflist}
     ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}
-    Should Be Equal As Strings    ${resp.status_code}    200 
     Log    ${resp.content}
-    ${TOPO_TREE_DEPTH}    Convert To Integer  ${TOPO_TREE_DEPTH}
-    ${TOPO_TREE_FANOUT}   Convert To Integer  ${TOPO_TREE_FANOUT}
-    Should Contain X Times  ${resp.content}   "00:00:00:00:00:00:00:01"   ${TOPO_TREE_FANOUT*2}
-    ${leaflist}    Get Ids Of Leaf Nodes    ${TOPO_TREE_FANOUT}   ${TOPO_TREE_DEPTH} 
-    ${topo_nodes}    Get Nodes From Tree Topo    (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})   1
-    :FOR    ${ITEM}  IN     @{topo_nodes}
-    \   ${IND}  Get From Dictionary    ${ITEM}    id
-    \   ${linkcnt}      Num Of Links For Node       ${IND}      ${leaflist}     ${TOPO_TREE_FANOUT}
-    \   Should Contain X Times  ${resp.content}     "${IND}"    ${linkcnt*2}   
-
-
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain X Times    ${resp.content}    "00:00:00:00:00:00:00:01"    ${TOPO_TREE_FANOUT*2}
+    : FOR    ${ITEM}    IN    @{topo_nodes}
+    \    ${IND}    Get From Dictionary    ${ITEM}    id
+    \    ${linkcnt}    Num Of Links For Node    ${IND}    ${leaflist}    ${TOPO_TREE_FANOUT}
+    \    Should Contain X Times    ${resp.content}    "${IND}"    ${linkcnt*2}
index 204634104af432c875f06248ad57105ed1a2339b..348ff96c744331857924d7c7224e2f5aa19c0f10 100644 (file)
@@ -11,12 +11,11 @@ Variables         ../../../variables/Variables.py
 *** Test Cases ***
 Ping all
     [Documentation]    Do ping all test, verify no packet loss
-    [Tags]   pingall
-       ${TOPO_TREE_DEPTH}    Convert To Integer  ${TOPO_TREE_DEPTH}
-    ${TOPO_TREE_FANOUT}   Convert To Integer  ${TOPO_TREE_FANOUT}
-       ${numnodes}             Num Of Nodes            ${TOPO_TREE_DEPTH}      ${TOPO_TREE_FANOUT}
-       Write   pingall
-    Sleep   ${numnodes}
+    [Tags]    pingall
+    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
+    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    Write    pingall
+    Sleep    ${numnodes}
     ${result}    Read
-    Should Not Contain   ${result}     X  
-
+    Should Not Contain    ${result}    X
index b295c01cb9d5f6b3856162d656e0d73e2e8d79d9..47d0a79084fba49c30f66040c2e10548e3924775 100644 (file)
@@ -2,35 +2,30 @@
 Documentation     Test suite for MD-SAL NSF
 Suite Setup       Start Suite
 Suite Teardown    Stop Suite
-Library     SSHLibrary
-Library       ../../../libraries/Common.py
-Variables     ../../../variables/Variables.py
+Library           SSHLibrary
+Library           ../../../libraries/Common.py
+Variables         ../../../variables/Variables.py
 
 *** Variables ***
+${start}          sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT}
 
-${start}=  sudo mn --controller=remote,ip=${CONTROLLER} --topo tree,${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT}
-
-** Keywords ***
-Start Suite  
+*** Keywords ***
+Start Suite
     Log    Start mininet
     ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
     ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
-    ${numnodes}     Num Of Nodes    ${TOPO_TREE_DEPTH}  ${TOPO_TREE_FANOUT}
-    Open Connection    ${MININET}     prompt=>
-    Login With Public Key    ${MININET_USER}    ${USER_HOME}/.ssh/id_rsa   any 
+    ${numnodes}    Num Of Nodes    ${TOPO_TREE_DEPTH}    ${TOPO_TREE_FANOUT}
+    Open Connection    ${MININET}    prompt=>    timeout=${numnodes*2+30}
+    Login With Public Key    ${MININET_USER}    ${USER_HOME}/.ssh/id_rsa    any
     Write    sudo ovs-vsctl set-manager ptcp:6644
     Write    sudo mn -c
-    Sleep    2
+    Read Until    >
     Write    ${start}
-    Sleep    ${numnodes*2+30}
-    Read
+    Read Until    mininet>
+
 Stop Suite
     Log    Stop mininet
-    ${TOPO_TREE_DEPTH}    Convert To Integer    ${TOPO_TREE_DEPTH}
-    ${TOPO_TREE_FANOUT}    Convert To Integer    ${TOPO_TREE_FANOUT}
-    ${numnodes}     Num Of Nodes    ${TOPO_TREE_DEPTH}  ${TOPO_TREE_FANOUT}
     Read
-    Write    exit 
-    Sleep    ${numnodes*2}
-    Read 
-    Close Connection 
+    Write    exit
+    Read Until    >
+    Close Connection
index 278306451f4180fa2801efe47ec37af0b88e6788..4feeb8805f92e1db9de5130b649f99b623df473b 100644 (file)
@@ -3,25 +3,10 @@ Documentation     Test suite for OVSDB
 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 
 
 ** Keywords ***
-Start Suite  
-    Log    Start mininet
-    Open Connection   ${MININET}     prompt=>
-    Login With Public Key    ${MININET_USER}   ${USER_HOME}/.ssh/id_rsa   any 
-    Write    sudo ovs-vsctl set-manager ptcp:6644
-    Write    sudo mn -c
-    Sleep    2
-    Write    ${start}
-    Sleep    20
-    Read
-Stop Suite
-    Log    Stop mininet
-    Read
-    Write    exit 
-    Sleep    6
-    Read 
-    Close Connection 
index a6e6479ca3851b7b06b5e9e5d7889e87b82ec721..f04089e657978bb00be6c1e681ace15fac65a972 100644 (file)
@@ -3,25 +3,9 @@ Documentation     Test suite for OVSDB mininet 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 
 
 ** Keywords ***
-Start Suite  
-    Log    Start mininet
-    Open Connection   ${MININET}     prompt=>
-    Login With Public Key    ${MININET_USER}   ${USER_HOME}/.ssh/id_rsa   any 
-    Write    sudo ovs-vsctl set-manager ptcp:6644
-    Write    sudo mn -c
-    Sleep    2
-    Write    ${start}
-    Sleep    20
-    Read
-Stop Suite
-    Log    Stop mininet
-    Read
-    Write    exit 
-    Sleep    6
-    Read 
-    Close Connection