Let test cases support controller argument, inclduding forwarding rule manager, host...
authorBaohua Yang <baohyang@cn.ibm.com>
Wed, 20 Nov 2013 13:13:38 +0000 (21:13 +0800)
committerBaohua Yang <baohyang@cn.ibm.com>
Wed, 20 Nov 2013 13:13:38 +0000 (21:13 +0800)
Change-Id: Ib17dd0d1703ac0836ed62da43408c5e65b26e71b
Signed-off-by: Baohua Yang <baohyang@cn.ibm.com>
test/tools/Robot_Tool/suites/base/arp_handler.txt
test/tools/Robot_Tool/suites/base/container_manager.txt
test/tools/Robot_Tool/suites/base/forwarding_manager.txt
test/tools/Robot_Tool/suites/base/forwarding_rule_manager.txt
test/tools/Robot_Tool/suites/base/host_tracker.txt
test/tools/Robot_Tool/suites/base/statistics_manager.txt
test/tools/Robot_Tool/suites/base/topology_manager.txt

index b1d7dd0c72f445819da83972493e1c6fe345e9bf..3b01649c961c106a992bcd2e4a403a15f2a08ba4 100644 (file)
@@ -1,5 +1,5 @@
 *** Settings ***
-Documentation     Test suite for the arp handler bundle.
+Documentation     Test suite for the arp handler module.
 Suite Teardown    Delete All Sessions
 Library           Collections
 Library           ../../libraries/RequestsLibrary.py
index af738a1d27c338458b6aed77fcb56d3c84885d0c..e84034595f8cdcaa3e4154c0f895a8d8f083645c 100644 (file)
@@ -1,5 +1,5 @@
 *** Settings ***
-Documentation     Test suite for the container manager bundle.
+Documentation     Test suite for the container manager module.
 Suite Teardown    Delete All Sessions
 Library           Collections
 Library           ../../libraries/RequestsLibrary.py
index 00ccf5462463c072d108ed4df46cef136167766f..6fa9283e4c284c23c60af514c19e82a14b0a1c96 100644 (file)
@@ -1,5 +1,5 @@
 *** Settings ***
-Documentation     Test suite for the forwarding manager bundle.
+Documentation     Test suite for the forwarding manager module.
 Suite Teardown    Delete All Sessions
 Library           Collections
 Library           ../../libraries/RequestsLibrary.py
index 116b39c50d9afe853a3029f81693a9d63622bcd8..88c2fa5eb7d2e967aae51517696e428b2c447b4d 100644 (file)
@@ -1,33 +1,50 @@
 *** Settings ***
-Documentation     Test suite for the arp handler bundle.
+Documentation     Test suite for the forwarding rule manager module.
+Suite Teardown    Delete All Sessions
 Library           Collections
-Library           RequestsLibrary
+Library           ../../libraries/RequestsLibrary.py
 Library           ../../libraries/Common.py
-Library           ../../libraries/ForwardingRuleManager.py
 Variables         ../../variables/Variables.py
 
 *** Variables ***
 ${name}           flow1
 ${key}            flowConfig
 ${node_id}        00:00:00:00:00:00:00:02
+${REST_CONTEXT}    /controller/nb/v2/flowprogrammer
 
 *** Test Cases ***
-Add and remove a flow
-    [Documentation]    Add and remove a flow. After each operation, list to validate the result.
-    [Tags]    add_remove_info
-    ${node }    Create Dictionary    type    OF    id    ${node_id}
+Add a flow
+    [Documentation]    Add a flow, list to validate the result.
+    [Tags]    add
+    ${node}    Create Dictionary    type    OF    id    ${node_id}
     ${actions}    Create List    OUTPUT=1
     ${body}    Create Dictionary    name    ${name}    installInHw    true    node
     ...    ${node}    priority    1    etherType    0x800    nwDst
     ...    10.0.0.1/32    actions    ${actions}
-    Add Flow To Node    OF    ${node_id}    ${name}    ${body}
-    Log Variables
-    ${result}    Get Flows
-    Dictionary Should Contain Key    ${result}    ${key}
+    ${headers}    Create Dictionary    Content-Type    application/json
+    Create Session    session    http://${CONTROLLER}:8080    headers=${headers}    auth=${auth}
+    ${resp}    Put    session    ${REST_CONTEXT}/${CONTAINER}/node/OF/${node_id}/staticFlow/${name}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    201    Response status code error
+    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}
+    Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
+    ${result}    To JSON    ${resp.content}
     ${content}    Get From Dictionary    ${result}    ${key}
     List Should Contain Value    ${content}    ${body}
-    Remove Flow From Node    OF    ${node_id}    ${name}
-    ${result}    Get Flows
-    Dictionary Should Contain Key    ${result}    ${key}
+
+Remove a flow
+    [Documentation]    Remove a flow, list to validate the result.
+    [Tags]    remove
+    ${node}    Create Dictionary    type    OF    id    ${node_id}
+    ${actions}    Create List    OUTPUT=1
+    ${body}    Create Dictionary    name    ${name}    installInHw    true    node
+    ...    ${node}    priority    1    etherType    0x800    nwDst
+    ...    10.0.0.1/32    actions    ${actions}
+    ${headers}    Create Dictionary    Content-Type    application/json
+    Create Session    session    http://${CONTROLLER}:8080    headers=${headers}    auth=${auth}
+    ${resp}    Delete    session    ${REST_CONTEXT}/${CONTAINER}/node/OF/${node_id}/staticFlow/${name}
+    Should Be Equal As Strings    ${resp.status_code}    204    Response status code error
+    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}
+    Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
+    ${result}    To JSON    ${resp.content}
     ${content}    Get From Dictionary    ${result}    ${key}
     List Should Not Contain Value    ${content}    ${body}
index ee848da440c65cb46b8f2c4403bbf4c44351c600..a01f73b409f31dda50c832a3666ae2813d032295 100644 (file)
@@ -1,29 +1,45 @@
 *** Settings ***
-Documentation     Test suite for the arp handler bundle.
+Documentation     Test suite for the host tracker module.
+Suite Teardown    Delete All Sessions
 Library           Collections
-Library           RequestsLibrary
+Library           ../../libraries/RequestsLibrary.py
 Library           ../../libraries/Common.py
-Library           ../../libraries/HostTracker.py
 Variables         ../../variables/Variables.py
 
 *** Variables ***
 ${name}           10.0.1.4
 ${key}            hostConfig
+${REST_CONTEXT}    /controller/nb/v2/hosttracker
 
 *** Test Cases ***
-Add and remove a host
-    [Documentation]    Add and remove a host. After each operation, list to validate the result.
-    [Tags]    add_remove_info
+Add a host
+    [Documentation]    Add a host, list to validate the result.
+    [Tags]    add
     ${body}    Create Dictionary    nodeType    OF    dataLayerAddress    5e:bf:79:84:10:a6    vlan
     ...    1    nodeId    00:00:00:00:00:00:00:03    nodeConnectorId    9    networkAddress
     ...    10.0.1.4    staticHost    ${True}    nodeConnectorType    OF
-    Add Host    ${name}    ${body}
-    ${result}    Get Hosts
-    Dictionary Should Contain Key    ${result}    ${key}
+    ${headers}    Create Dictionary    Content-Type    application/json
+    Create Session    session    http://${CONTROLLER}:8080    headers=${headers}    auth=${auth}
+    ${resp}    Put    session    ${REST_CONTEXT}/${CONTAINER}/address/${name}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    201    Response status code error
+    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/hosts/inactive
+    Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
+    ${result}    To JSON    ${resp.content}
     ${content}    Get From Dictionary    ${result}    ${key}
     List Should Contain Value    ${content}    ${body}
-    Remove Host    ${name}
-    ${result}    Get Hosts
-    Dictionary Should Contain Key    ${result}    ${key}
+
+Remove a host
+    [Documentation]    Remove a host, list to validate the result.
+    [Tags]    remove
+    ${body}    Create Dictionary    nodeType    OF    dataLayerAddress    5e:bf:79:84:10:a6    vlan
+    ...    1    nodeId    00:00:00:00:00:00:00:03    nodeConnectorId    9    networkAddress
+    ...    10.0.1.4    staticHost    ${True}    nodeConnectorType    OF
+    ${headers}    Create Dictionary    Content-Type    application/json
+    Create Session    session    http://${CONTROLLER}:8080    headers=${headers}    auth=${auth}
+    ${resp}    Delete    session    ${REST_CONTEXT}/${CONTAINER}/address/${name}
+    Should Be Equal As Strings    ${resp.status_code}    204    Response status code error
+    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/hosts/inactive
+    Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
+    ${result}    To JSON    ${resp.content}
     ${content}    Get From Dictionary    ${result}    ${key}
     List Should Not Contain Value    ${content}    ${body}
index 374814f2bdecae3e8ca2673c3fe9ca5b7fda0374..84458ea280dce338e9c8b30d2c20f4cc6d13e6bc 100644 (file)
@@ -1,11 +1,12 @@
 *** Settings ***
-Documentation     Test suite for the statistics manager bundle.
+Documentation     Test suite for the statistics manager module.
+Suite Teardown    Delete All Sessions
 Library           Collections
-Library           RequestsLibrary
+Library           ../../libraries/RequestsLibrary.py
 Library           ../../libraries/Common.py
 Variables         ../../variables/Variables.py
 
 *** Variables ***
-${REST_CONTEXT}        /controller/nb/v2/statistics
+${REST_CONTEXT}    /controller/nb/v2/statistics
 
-*** Test Cases ***
\ No newline at end of file
+*** Test Cases ***
index d373d1ead1cc86edf86014d379061a481d28eda7..3d41bf255b0561bac30833bc8e71b4078d695756 100644 (file)
@@ -1,28 +1,43 @@
 *** Settings ***
 Documentation     Test suite for the arp handler bundle.
+Suite Teardown    Delete All Sessions
 Library           Collections
-Library           RequestsLibrary
+Library           ../../libraries/RequestsLibrary.py
 Library           ../../libraries/Common.py
-Library           ../../libraries/TopologyManager.py
 Variables         ../../variables/Variables.py
 
 *** Variables ***
 ${name}           test_userlink1
 ${key}            userLinks
+${REST_CONTEXT}    /controller/nb/v2/topology
 
 *** Test Cases ***
-Add and remove a userlink
-    [Documentation]    Add and remove a userlink. After each operation, list to validate the result.
-    [Tags]    add_remove_info
+Add a userlink
+    [Documentation]    Add a userlink, list to validate the result.
+    [Tags]    add
     ${body}    Create Dictionary    name    ${name}    status    Success    srcNodeConnector
     ...    OF|1@OF|00:00:00:00:00:00:00:02    dstNodeConnector    OF|1@OF|00:00:00:00:00:00:00:03
-    Add Userlink    ${name}    ${body}
-    ${result}    Get Userlinks
-    Dictionary Should Contain Key    ${result}    ${key}
+    ${headers}    Create Dictionary    Content-Type    application/json
+    Create Session    session    http://${CONTROLLER}:8080    headers=${headers}    auth=${auth}
+    ${resp}    Put    session    ${REST_CONTEXT}/${CONTAINER}/userLink/${name}    data=${body}
+    Should Be Equal As Strings    ${resp.status_code}    201    Response status code error
+    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/userLinks
+    Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
+    ${result}    To JSON    ${resp.content}
     ${content}    Get From Dictionary    ${result}    ${key}
     List Should Contain Value    ${content}    ${body}
-    Remove Userlink    ${name}
-    ${result}    Get Userlinks
-    Dictionary Should Contain Key    ${result}    ${key}
+
+Remove a userlink
+    [Documentation]    Remove a userlink, list to validate the result.
+    [Tags]    remove
+    ${body}    Create Dictionary    name    ${name}    status    Success    srcNodeConnector
+    ...    OF|1@OF|00:00:00:00:00:00:00:02    dstNodeConnector    OF|1@OF|00:00:00:00:00:00:00:03
+    ${headers}    Create Dictionary    Content-Type    application/json
+    Create Session    session    http://${CONTROLLER}:8080    headers=${headers}    auth=${auth}
+    ${resp}    Delete    session    ${REST_CONTEXT}/${CONTAINER}/userLink/${name}
+    Should Be Equal As Strings    ${resp.status_code}    204    Response status code error
+    ${resp}    Get    session    ${REST_CONTEXT}/${CONTAINER}/userLinks
+    Should Be Equal As Strings    ${resp.status_code}    200    Response status code error
+    ${result}    To JSON    ${resp.content}
     ${content}    Get From Dictionary    ${result}    ${key}
     List Should Not Contain Value    ${content}    ${body}