Add remove session and update remove channel 40/40740/3
authorvictorxu <s.xu@huawei.com>
Wed, 22 Jun 2016 22:53:38 +0000 (15:53 -0700)
committerJamo Luhrsen <jluhrsen@redhat.com>
Fri, 5 Aug 2016 22:30:14 +0000 (22:30 +0000)
Change-Id: Ic042abe8fa3604106fdcf1fe689ea73b107faf2c
Signed-off-by: victorxu <s.xu@huawei.com>
csit/libraries/UscUtils.robot
csit/suites/usc/tcp/110_TCP/Test.robot
csit/suites/usc/tcp/200_Multiple_Sessions_TCP/Test.robot
csit/suites/usc/tcp/300_Callhome_TCP/test.robot
csit/suites/usc/udp/110_UDP/Test.robot
csit/suites/usc/udp/200_Multiple_Sessions_UDP/Test.robot
csit/suites/usc/udp/300_Callhome_UDP/Test.robot
csit/testplans/usc-udp.txt [new file with mode: 0644]

index fb8831b2d1d0125c2ed1ba61c606cf2b0da426c3..70a44c9b6f4f8a6fc9d72878d8863a8b2a22feb4 100644 (file)
@@ -8,6 +8,7 @@ Resource          Utils.robot
 ${REST_VIEW_CHANNEL}    /restconf/operations/usc-channel:view-channel
 ${REST_ADD_CHANNEL}    /restconf/operations/usc-channel:add-channel
 ${REST_REMOVE_CHANNEL}    /restconf/operations/usc-channel:remove-channel
+${REST_REMOVE_SESSION}    /restconf/operations/usc-channel:remove-session
 ${REST_SEND_MESSAGE}    /restconf/operations/usc-channel:send-message
 ${NAV_USC_TOOLS}    cd ~/usc-tools
 ${CLONE_USC_TOOLS}    [ -f ~/usc-tools/UscAgent.jar ] && echo "The usc-tools does exist, done." || git clone https://github.com/victorxu99/usc-tools.git ~/usc-tools
@@ -27,7 +28,7 @@ Download Tools
     [Documentation]    Download UscAgent and EchoServer before any system
     ...    is run.
     Log    Download tools begin ...
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    ${CLONE_USC_TOOLS}    user=${TOOLS_SYSTEM_USER}    password=${TOOLS_SYSTEM_PASSWORD}    prompt_timeout=30s
+    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    ${CLONE_USC_TOOLS}    prompt_timeout=30s
     Log    Download tools ended.
 
 Start TCP
index 1f1d28ae8bbd4661ed06e41bad0d4d8562d4d9c7..d830e6ba051f921d44606523e8fa037e16afa735 100644 (file)
@@ -62,7 +62,7 @@ View Bytes In and Bytes Out
 
 Remove Channel
     [Documentation]    Remove the channel
-    ${content}    Create Dictionary    hostname=${TOOLS_SYSTEM_IP}    port=${ECHO_SERVER_PORT}    tcp=true
+    ${content}    Create Dictionary    hostname=${TOOLS_SYSTEM_IP}    tcp=true
     ${channel}    Create Dictionary    channel=${content}
     ${input}    Create Dictionary    input=${channel}
     ${data}    json.dumps    ${input}
index a7f2e4d7474b858b8a81dc238962a97559932dca..ecb12cbe079f620f71daac010d4dd9c96dc7e2ae 100644 (file)
@@ -62,18 +62,39 @@ View Bytes In and Bytes Out
     Should Contain    ${resp.content}    "bytes-out":${totalLen}
     Should Contain    ${resp.content}    "bytes-in":${totalLen}
 
-Remove Channel
+Remove Sessions
     [Documentation]    Remove the channels
     : FOR    ${port_index}    IN    @{LIST_ECHO_SERVER_PORT}
     \    ${content}    Create Dictionary    hostname=${TOOLS_SYSTEM_IP}    port=${port_index}    tcp=true
     \    ${channel}    Create Dictionary    channel=${content}
     \    ${input}    Create Dictionary    input=${channel}
     \    ${data}    json.dumps    ${input}
-    \    ${resp}    Post Request    session    ${REST_REMOVE_CHANNEL}    data=${data}
+    \    ${resp}    Post Request    session    ${REST_REMOVE_SESSION}    data=${data}
     \    Log    ${resp.content}
     \    Should Be Equal As Strings    ${resp.status_code}    200
     \    Should Contain    ${resp.content}    Succeed to remove
 
+Remove Channel
+    [Documentation]    Remove the channels
+    ${content}    Create Dictionary    hostname=${TOOLS_SYSTEM_IP}    tcp=true
+    ${channel}    Create Dictionary    channel=${content}
+    ${input}    Create Dictionary    input=${channel}
+    ${data}    json.dumps    ${input}
+    ${resp}    Post Request    session    ${REST_REMOVE_CHANNEL}    data=${data}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    Succeed to remove
+
+Check Channel
+    [Documentation]    Check if the channels are correct
+    ${topo}    Create Dictionary    topology-id=usc
+    ${input}    Create Dictionary    input=${topo}
+    ${data}    json.dumps    ${input}
+    ${resp}    Post Request    session    ${REST_VIEW_CHANNEL}    data=${data}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    "topology"
+
 *** Keywords ***
 Send Now
     [Arguments]    ${body}
index 7c54734d89ef8c4ddb20f26139ea054855bdaab6..a61b0a2b48dec8aac61d59e992003d256ba3e957 100644 (file)
@@ -63,7 +63,7 @@ View Bytes In and Bytes Out
 
 Remove Channel
     [Documentation]    Remove the channel
-    ${content}    Create Dictionary    hostname=${TOOLS_SYSTEM_IP}    port=${ECHO_SERVER_PORT}    tcp=true
+    ${content}    Create Dictionary    hostname=${TOOLS_SYSTEM_IP}    tcp=true
     ${channel}    Create Dictionary    channel=${content}
     ${input}    Create Dictionary    input=${channel}
     ${data}    json.dumps    ${input}
index eeb3bd29e9d762b3537cffe45dcc253425e3f5e1..f15a07a13aaecc31582f76ae734646dd34a37e0a 100644 (file)
@@ -62,7 +62,7 @@ View Bytes In and Bytes Out
 
 Remove Channel
     [Documentation]    Remove the channel
-    ${content}    Create Dictionary    hostname=${TOOLS_SYSTEM_IP}    port=${ECHO_SERVER_PORT}    tcp=false
+    ${content}    Create Dictionary    hostname=${TOOLS_SYSTEM_IP}    tcp=false
     ${channel}    Create Dictionary    channel=${content}
     ${input}    Create Dictionary    input=${channel}
     ${data}    json.dumps    ${input}
index aa7e4a06e6dad6f90b9544a9a7268eab796d6ca6..47fe293d2556aeee5376c474a4cb54e67ac1a9a4 100644 (file)
@@ -64,18 +64,39 @@ View Bytes In and Bytes Out
     Should Contain    ${resp.content}    "bytes-out":${totalLen}
     Should Contain    ${resp.content}    "bytes-in":${totalLen}
 
-Remove Channel
+Remove Sessions
     [Documentation]    Remove the channels
     : FOR    ${port_index}    IN    @{LIST_ECHO_SERVER_PORT}
     \    ${content}    Create Dictionary    hostname=${TOOLS_SYSTEM_IP}    port=${port_index}    tcp=false
     \    ${channel}    Create Dictionary    channel=${content}
     \    ${input}    Create Dictionary    input=${channel}
     \    ${data}    json.dumps    ${input}
-    \    ${resp}    Post Request    session    ${REST_REMOVE_CHANNEL}    data=${data}
+    \    ${resp}    Post Request    session    ${REST_REMOVE_SESSION}    data=${data}
     \    Log    ${resp.content}
     \    Should Be Equal As Strings    ${resp.status_code}    200
     \    Should Contain    ${resp.content}    Succeed to remove
 
+Remove Channel
+    [Documentation]    Remove the channels
+    ${content}    Create Dictionary    hostname=${TOOLS_SYSTEM_IP}    tcp=false
+    ${channel}    Create Dictionary    channel=${content}
+    ${input}    Create Dictionary    input=${channel}
+    ${data}    json.dumps    ${input}
+    ${resp}    Post Request    session    ${REST_REMOVE_CHANNEL}    data=${data}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    Succeed to remove
+
+Check Channel
+    [Documentation]    Check if the channels are correct
+    ${topo}    Create Dictionary    topology-id=usc
+    ${input}    Create Dictionary    input=${topo}
+    ${data}    json.dumps    ${input}
+    ${resp}    Post Request    session    ${REST_VIEW_CHANNEL}    data=${data}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    "topology"
+
 *** Keywords ***
 Send Now
     [Arguments]    ${body}
index 6f948d3933e5c9201d7734ecda41c1b816cd4597..18731418b288c3bb7d52840310da9fce486e323a 100644 (file)
@@ -64,7 +64,7 @@ View Bytes In and Bytes Out
 
 Remove Channel
     [Documentation]    Remove the channel
-    ${content}    Create Dictionary    hostname=${TOOLS_SYSTEM_IP}    port=${ECHO_SERVER_PORT}    tcp=false
+    ${content}    Create Dictionary    hostname=${TOOLS_SYSTEM_IP}    tcp=false
     ${channel}    Create Dictionary    channel=${content}
     ${input}    Create Dictionary    input=${channel}
     ${data}    json.dumps    ${input}
diff --git a/csit/testplans/usc-udp.txt b/csit/testplans/usc-udp.txt
new file mode 100644 (file)
index 0000000..04621bd
--- /dev/null
@@ -0,0 +1,2 @@
+# Place the suites in run order:
+integration/test/csit/suites/usc/udp