Move new Clustering Keywords
[integration/test.git] / test / csit / libraries / Utils.txt
index 6a95514b5f64fd048ddb1c546251717cb22fcd63..2d14bc64acff572cff63b337150c20512ea6d362 100644 (file)
@@ -117,7 +117,7 @@ Clean Mininet System
     Run Command On Remote System    ${mininet_system}    sudo ps -elf | egrep 'usr/local/bin/mn' | egrep python | awk '{print "sudo kill -9",$4}' | sh
 
 Clean Up Ovs
-    [Arguments]     ${mininet_system}=${MININET}
+    [Arguments]    ${mininet_system}=${MININET}
     [Documentation]    Cleans up the OVS instance and remove any existing common known bridges.
     ${output}=    Run Command On Remote System    ${mininet_system}    sudo ovs-vsctl list-br
     Log    ${output}
@@ -160,9 +160,9 @@ Strip Quotes
 
 Run Command On Remote System
     [Arguments]    ${remote_system}    ${cmd}    ${user}=${MININET_USER}    ${prompt}=${LINUX_PROMPT}    ${prompt_timeout}=30s
-    [Documentation]    Reduces the common work of running a command on a remote system to a single higher level robot keyword,
-    ...    taking care to log in with a public key and. The command given is written and the output returned. No test conditions
-    ...    are checked.
+    [Documentation]    Reduces the common work of running a command on a remote system to a single higher level
+    ...    robot keyword, taking care to log in with a public key and. The command given is written
+    ...    and the output returned. No test conditions are checked.
     Log    Attempting to execute ${cmd} on ${remote_system} by ${user} with ${keyfile_pass} and ${prompt}
     ${conn_id}=    SSHLibrary.Open Connection    ${remote_system}    prompt=${prompt}    timeout=${prompt_timeout}
     Login With Public Key    ${user}    ${USER_HOME}/.ssh/${SSH_KEY}    ${KEYFILE_PASS}
@@ -174,7 +174,8 @@ Run Command On Remote System
 
 Verify File Exists On Remote System
     [Arguments]    ${remote_system}    ${file}    ${user}=${MININET_USER}    ${prompt}=${LINUX_PROMPT}    ${prompt_timeout}=5s
-    [Documentation]    Will create connection with public key and will PASS if the given ${file} exists, otherwise will FAIL
+    [Documentation]    Will create connection with public key and will PASS if the given ${file} exists,
+    ...    otherwise will FAIL
     ${conn_id}=    Open Connection    ${remote_system}    prompt=${prompt}    timeout=${prompt_timeout}
     Login With Public Key    ${user}    ${USER_HOME}/.ssh/${SSH_KEY}    any
     SSHLibrary.File Should Exist    ${file}
@@ -236,72 +237,3 @@ Post Elements To URI From File
     ${body}    OperatingSystem.Get File    ${data_file}
     ${resp}    RequestsLibrary.Post    session    ${dest_uri}    data=${body}    headers=${headers}
     Should Be Equal As Strings    ${resp.status_code}    200
-
-Stop One Or More Controllers
-    [Arguments]    @{controllers}
-    [Documentation]    Give this keyword a scalar or list of controllers to be stopped.
-    ${cmd} =    Set Variable    ${KARAF_HOME}/bin/stop
-    : FOR    ${ip}    IN    @{controllers}
-    \    Run Command On Remote System    ${ip}    ${cmd}
-    : FOR    ${ip}    IN    @{controllers}
-    \    Wait Until Keyword Succeeds    60 s    3 s    Controller Down Check    ${ip}
-
-Start One Or More Controllers
-    [Arguments]    @{controllers}
-    [Documentation]    Give this keyword a scalar or list of controllers to be started.
-    ${cmd} =    Set Variable    ${KARAF_HOME}/bin/start
-    : FOR    ${ip}    IN    @{controllers}
-    \    Run Command On Remote System    ${ip}    ${cmd}
-    # TODO: This should throw an error if controller never comes up.
-    : FOR    ${ip}    IN    @{controllers}
-    \    UtilLibrary.Wait For Controller Up    ${ip}    ${RESTCONFPORT}
-
-Kill One Or More Controllers
-    [Arguments]    @{controllers}
-    [Documentation]    Give this keyword a scalar or list of controllers to be stopped.
-    ${cmd} =    Set Variable    ps axf | grep karaf | grep -v grep | awk '{print \"kill -9 \" $1}' | sh
-    log     ${cmd}
-    ${controller_pid}=    Get Process ID Based On Regex On Remote System    ${CONTROLLER}    karaf
-    : FOR    ${ip}    IN    @{controllers}
-    \    Run Command On Remote System    ${ip}    ${cmd}
-    : FOR    ${ip}    IN    @{controllers}
-    \    Wait Until Keyword Succeeds    60 s    3 s    Controller Down Check    ${ip}
-
-Controller Down Check
-    [Arguments]    ${ip}
-    [Documentation]    Checks to see if a controller is down by verifying that the karaf process isn't present.
-    ${cmd} =    Set Variable    ps axf | grep karaf | grep -v grep | wc -l
-    ${response}    Run Command On Remote System    ${ip}    ${cmd}
-    Log    Number of controller instances running: ${response}
-    Should Start With    ${response}    0    Controller process found or there may be extra instances of
-    ...    karaf running on the host machine.
-
-Clean One Or More Journals
-    [Arguments]    @{controllers}
-    [Documentation]    Give this keyword a scalar or list of controllers on which to clean journals.
-    ${del_cmd} =    Set Variable    rm -rf ${KARAF_HOME}/journal
-    : FOR    ${ip}    IN    @{controllers}
-    \    Run Command On Remote System    ${ip}    ${del_cmd}
-
-Show Cluster Configuation Files
-    [Arguments]    @{controllers}
-    [Documentation]    Prints out the cluster configuration files for one or more controllers.
-    Log    controllers: @{controllers}
-    ${cmd} =    Set Variable    cat ${KARAF_HOME}/configuration/initial/akka.conf
-    : FOR    ${ip}    IN    @{controllers}
-    \    Run Command On Remote System    ${ip}    ${cmd}
-    ${cmd} =    Set Variable    cat ${KARAF_HOME}/configuration/initial/modules.conf
-    : FOR    ${ip}    IN    @{controllers}
-    \    Run Command On Remote System    ${ip}    ${cmd}
-    ${cmd} =    Set Variable    cat ${KARAF_HOME}/configuration/initial/module-shards.conf
-    : FOR    ${ip}    IN    @{controllers}
-    \    Run Command On Remote System    ${ip}    ${cmd}
-    ${cmd} =    Set Variable    cat ${KARAF_HOME}/configuration/initial/jolokia.xml
-    : FOR    ${ip}    IN    @{controllers}
-    \    Run Command On Remote System    ${ip}    ${cmd}
-    ${cmd} =    Set Variable    cat ${KARAF_HOME}/etc/initial/org.apache.karaf.management.cfg
-    : FOR    ${ip}    IN    @{controllers}
-    \    Run Command On Remote System    ${ip}    ${cmd}
-    ${cmd} =    Set Variable    cat ${KARAF_HOME}/etc/org.apache.karaf.features.cfg
-    : FOR    ${ip}    IN    @{controllers}
-    \    Run Command On Remote System    ${ip}    ${cmd}