Use RFC8040 URL for JSON-RPC tests
[integration/test.git] / csit / libraries / UscUtils.robot
index fb8831b2d1d0125c2ed1ba61c606cf2b0da426c3..05161a5f5ca3682f843aaf258b2c278a97dfbb39 100644 (file)
@@ -2,12 +2,14 @@
 Library           Collections
 Library           SSHLibrary
 Library           UtilLibrary.py
-Resource          Utils.robot
+Resource          RemoteBash.robot
+Resource          SSHKeywords.robot
 
 *** Variables ***
 ${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 +29,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
@@ -133,14 +135,15 @@ Start Multiple_Sessions_TCP
     Write    ${AgentTcp}
     Read
     ${L1}    Create List
-    : FOR    ${port_index}    IN    @{LIST_ECHO_SERVER_PORT}
-    \    Log    ${port_index}
-    \    ${echo_conn_id}=    Open Connection    ${TOOLS_SYSTEM_IP}    timeout=30s
-    \    Append To List    ${L1}    ${echo_conn_id}
-    \    Flexible Mininet Login
-    \    Write    ${NAV_USC_TOOLS}
-    \    Write    java -jar EchoServer.jar -t true -p ${port_index}
-    \    Read Until    initialized
+    FOR    ${port_index}    IN    @{LIST_ECHO_SERVER_PORT}
+        Log    ${port_index}
+        ${echo_conn_id}=    Open Connection    ${TOOLS_SYSTEM_IP}    timeout=30s
+        Append To List    ${L1}    ${echo_conn_id}
+        Flexible Mininet Login
+        Write    ${NAV_USC_TOOLS}
+        Write    java -jar EchoServer.jar -t true -p ${port_index}
+        Read Until    initialized
+    END
     Set Suite Variable    ${L1}
 
 Start Multiple_Sessions_UDP
@@ -154,14 +157,15 @@ Start Multiple_Sessions_UDP
     Write    ${AgentUdp}
     Read
     ${L1}    Create List
-    : FOR    ${port_index}    IN    @{LIST_ECHO_SERVER_PORT}
-    \    Log    ${port_index}
-    \    ${echo_conn_id}=    Open Connection    ${TOOLS_SYSTEM_IP}    timeout=30s
-    \    Append To List    ${L1}    ${echo_conn_id}
-    \    Flexible Mininet Login
-    \    Write    ${NAV_USC_TOOLS}
-    \    Write    java -jar EchoServer.jar -t false -p ${port_index}
-    \    Read Until    initialized
+    FOR    ${port_index}    IN    @{LIST_ECHO_SERVER_PORT}
+        Log    ${port_index}
+        ${echo_conn_id}=    Open Connection    ${TOOLS_SYSTEM_IP}    timeout=30s
+        Append To List    ${L1}    ${echo_conn_id}
+        Flexible Mininet Login
+        Write    ${NAV_USC_TOOLS}
+        Write    java -jar EchoServer.jar -t false -p ${port_index}
+        Read Until    initialized
+    END
     Set Suite Variable    ${L1}
 
 Stop Agent_Echo
@@ -198,9 +202,10 @@ Stop One_Agent_Multiple_Echo
     Write_Bare_Ctrl_C
     Write    exit
     Close Connection
-    : FOR    ${echo_conn_id}    IN    @{L1}
-    \    Switch Connection    ${echo_conn_id}
-    \    Read
-    \    Write_Bare_Ctrl_C
-    \    Write    exit
-    \    Close Connection
+    FOR    ${echo_conn_id}    IN    @{L1}
+        Switch Connection    ${echo_conn_id}
+        Read
+        Write_Bare_Ctrl_C
+        Write    exit
+        Close Connection
+    END