From 344cbb5400084ae443b8eb10d4c2e27b6d014dc4 Mon Sep 17 00:00:00 2001 From: Deepak Date: Thu, 4 Feb 2016 18:01:56 +0530 Subject: [PATCH] Replace deprecated variables in csit/libraries (2). + MININET -> TOOLS_SYSTEM_IP + MININET_USER -> TOOLS_SYSTEM_USER + MININET_PASSWORD -> TOOLS_SYSTEM_PASSWORD + MININET_PROMPT -> TOOLS_SYSTEM_PROMPT + CONTROLLER_USER -> ODL_SYSTEM_USER Change-Id: I7ecab0307245c29823ce2baa0d7f0402894ec480 Signed-off-by: Deepak --- csit/libraries/AAAKeywords.robot | 5 ++--- csit/libraries/ClusterOvsdb.robot | 2 +- csit/libraries/KarafKeywords.robot | 2 +- csit/libraries/Scalability.robot | 12 ++++++------ csit/libraries/SwitchUtils.robot | 2 +- csit/libraries/Utils.robot | 12 ++++++------ csit/libraries/VtnCoKeywords.robot | 10 +++++----- csit/libraries/VtnMaKeywords.robot | 8 ++++---- csit/libraries/VtnMaKeywordsLi.robot | 8 ++++---- 9 files changed, 30 insertions(+), 31 deletions(-) diff --git a/csit/libraries/AAAKeywords.robot b/csit/libraries/AAAKeywords.robot index a77d5157c0..118b934524 100644 --- a/csit/libraries/AAAKeywords.robot +++ b/csit/libraries/AAAKeywords.robot @@ -6,7 +6,6 @@ Variables ../variables/Variables.py ${WORKSPACE} /tmp ${BUNDLEFOLDER} distribution-karaf-0.3.0-SNAPSHOT ${AUTHN_CFG_FILE} ${WORKSPACE}/${BUNDLEFOLDER}/etc/org.opendaylight.aaa.authn.cfg -${CONTROLLER_USER} ${MININET_USER} *** Keywords *** AAA Login @@ -33,7 +32,7 @@ Disable Authentication On Controller [Arguments] ${controller_ip} [Documentation] Will disable token based authentication. Currently, that is done with a config file change SSHLibrary.Open Connection ${controller_ip} - Login With Public Key ${CONTROLLER_USER} ${USER_HOME}/.ssh/${SSH_KEY} any + Login With Public Key ${ODL_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any ${cmd}= Set Variable sed -i 's/^authEnabled=.*$/authEnabled=false/g' ${AUTHN_CFG_FILE} SSHLibrary.Execute Command ${cmd} SSHLibrary.Close Connection @@ -42,7 +41,7 @@ Enable Authentication On Controller [Arguments] ${controller_ip} [Documentation] Will enable token based authentication. Currently, that is done with a config file change SSHLibrary.Open Connection ${controller_ip} - Login With Public Key ${CONTROLLER_USER} ${USER_HOME}/.ssh/${SSH_KEY} any + Login With Public Key ${ODL_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any ${cmd}= Set Variable sed -i 's/^authEnabled=.*$/authEnabled=true/g' ${AUTHN_CFG_FILE} SSHLibrary.Execute Command ${cmd} SSHLibrary.Close Connection diff --git a/csit/libraries/ClusterOvsdb.robot b/csit/libraries/ClusterOvsdb.robot index cce3ff2bcb..4e6e8e102e 100644 --- a/csit/libraries/ClusterOvsdb.robot +++ b/csit/libraries/ClusterOvsdb.robot @@ -75,7 +75,7 @@ Create Bridge And Verify ${body} Replace String ${body} tcp:controller1:6633 tcp:${ODL_SYSTEM_1_IP}:6640 ${body} Replace String ${body} tcp:controller2:6633 tcp:${ODL_SYSTEM_2_IP}:6640 ${body} Replace String ${body} tcp:controller3:6633 tcp:${ODL_SYSTEM_3_IP}:6640 - ${body} Replace String ${body} 127.0.0.1 ${MININET} + ${body} Replace String ${body} 127.0.0.1 ${TOOLS_SYSTEM_IP} ${BRIDGE}= Set Variable If "${status}"=="AfterFail" br02 br01 Log ${BRIDGE} ${body} Replace String ${body} br01 ${BRIDGE} diff --git a/csit/libraries/KarafKeywords.robot b/csit/libraries/KarafKeywords.robot index 3a72696ea2..f61e650d77 100644 --- a/csit/libraries/KarafKeywords.robot +++ b/csit/libraries/KarafKeywords.robot @@ -52,7 +52,7 @@ Check Karaf Log Has Messages [Return] ${output} Check Karaf Log File Does Not Have Messages - [Arguments] ${ip} ${message} ${user}=${CONTROLLER_USER} ${password}=${CONTROLLER_PASSWORD} ${prompt}=${DEFAULT_LINUX_PROMPT} ${log_file}=${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log + [Arguments] ${ip} ${message} ${user}=${ODL_SYSTEM_USER} ${password}=${CONTROLLER_PASSWORD} ${prompt}=${DEFAULT_LINUX_PROMPT} ${log_file}=${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log [Documentation] Fails if the provided ${message} is found in the karaf.log file. Uses grep to search. The ... karaf.log file can be overridden with ${log_file} to be any file on the given system @ ${ip} ${output}= Run Command On Controller ${ip} grep -c '${message}' ${log_file} user=${user} password=${password} prompt=${prompt} diff --git a/csit/libraries/Scalability.robot b/csit/libraries/Scalability.robot index 71c9d24212..7e940e5e9f 100644 --- a/csit/libraries/Scalability.robot +++ b/csit/libraries/Scalability.robot @@ -124,9 +124,9 @@ Start Mininet With One Switch And ${hosts} hosts [Documentation] Start mininet with one switch and ${hosts} hosts Log Starting mininet with one switch and ${hosts} hosts Log To Console Starting mininet with one switch and ${hosts} hosts - ${mininet_conn_id}= Open Connection ${MININET} prompt=${DEFAULT_LINUX_PROMPT} timeout=${hosts*3} + ${mininet_conn_id}= Open Connection ${TOOLS_SYSTEM_IP} prompt=${DEFAULT_LINUX_PROMPT} timeout=${hosts*3} Set Suite Variable ${mininet_conn_id} - Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/${SSH_KEY} any + Login With Public Key ${TOOLS_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any Write sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --topo linear,1,${hosts} --switch ovsk,protocols=OpenFlow13 Read Until mininet> @@ -173,9 +173,9 @@ Start Mininet Linear [Arguments] ${switches} [Documentation] Start mininet linear topology with ${switches} nodes Log To Console Starting mininet linear ${switches} - ${mininet_conn_id}= Open Connection ${MININET} prompt=${DEFAULT_LINUX_PROMPT} timeout=${switches*3} + ${mininet_conn_id}= Open Connection ${TOOLS_SYSTEM_IP} prompt=${DEFAULT_LINUX_PROMPT} timeout=${switches*3} Set Suite Variable ${mininet_conn_id} - Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/${SSH_KEY} any + Login With Public Key ${TOOLS_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any Write sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --topo linear,${switches} --switch ovsk,protocols=OpenFlow13 Read Until mininet> Sleep 6 @@ -184,9 +184,9 @@ Start Mininet With Custom Topology [Arguments] ${topology_file} ${switches} ${base_mac}=00:00:00:00:00:00 ${base_ip}=1.1.1.1 ${hosts}=0 ${mininet_start_time}=100 [Documentation] Start a custom mininet topology. Log To Console Start a custom mininet topology with ${switches} nodes - ${mininet_conn_id}= Open Connection ${MININET} prompt=${DEFAULT_LINUX_PROMPT} timeout=${mininet_start_time} + ${mininet_conn_id}= Open Connection ${TOOLS_SYSTEM_IP} prompt=${DEFAULT_LINUX_PROMPT} timeout=${mininet_start_time} Set Suite Variable ${mininet_conn_id} - Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/${SSH_KEY} any + Login With Public Key ${TOOLS_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any Write python ${topology_file} ${switches} ${hosts} ${base_mac} ${base_ip} Read Until ${DEFAULT_LINUX_PROMPT} Write sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --custom switch.py --topo demotopo --switch ovsk,protocols=OpenFlow13 diff --git a/csit/libraries/SwitchUtils.robot b/csit/libraries/SwitchUtils.robot index 349964e692..902c07bd53 100644 --- a/csit/libraries/SwitchUtils.robot +++ b/csit/libraries/SwitchUtils.robot @@ -89,7 +89,7 @@ Open Connection Wrapper ... switch.mgmt_protocol, the connection open will be handled by the right robot ... library (Telnet or SSHLibrary). \ The connection_index is returned. Run Keyword If "${switch.mgmt_protocol}" == "ssh" Call Method ${switch} set_ssh_key ${USER_HOME}/.ssh/${SSH_KEY} - Run Keyword If "${switch.mgmt_protocol}" == "ssh" Call Method ${switch} set_mgmt_user ${MININET_USER} + Run Keyword If "${switch.mgmt_protocol}" == "ssh" Call Method ${switch} set_mgmt_user ${TOOLS_SYSTEM_USER} ${connection_index}= Run Keyword If "${switch.mgmt_protocol}" == "ssh" SSHLibrary.Open Connection ${switch.mgmt_ip} prompt=${switch.mgmt_prompt} timeout=30s Run Keyword If "${switch.mgmt_protocol}" == "ssh" Login With Public Key ${switch.mgmt_user} ${switch.ssh_key} any ${connection_index}= Run Keyword If "${switch.mgmt_protocol}" == "telnet" Telnet.Open Connection ${switch.mgmt_ip} diff --git a/csit/libraries/Utils.robot b/csit/libraries/Utils.robot index c182b2b311..ee16ad0f7d 100644 --- a/csit/libraries/Utils.robot +++ b/csit/libraries/Utils.robot @@ -14,7 +14,7 @@ ${start} sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --topo tree,1 *** Keywords *** Start Suite - [Arguments] ${system}=${MININET} ${user}=${MININET_USER} ${password}=${MININET_PASSWORD} ${prompt}=${DEFAULT_LINUX_PROMPT} ${timeout}=30s + [Arguments] ${system}=${TOOLS_SYSTEM_IP} ${user}=${TOOLS_SYSTEM_USER} ${password}=${TOOLS_SYSTEM_PASSWORD} ${prompt}=${DEFAULT_LINUX_PROMPT} ${timeout}=30s [Documentation] Basic setup/cleanup work that can be done safely before any system ... is run. Log Start the test on the base edition @@ -27,7 +27,7 @@ Start Suite Read Until mininet> Start Mininet - [Arguments] ${system}=${MININET} ${cmd}=${start} ${custom}= ${user}=${MININET_USER} ${password}=${MININET_PASSWORD} ${prompt}=${DEFAULT_LINUX_PROMPT} + [Arguments] ${system}=${TOOLS_SYSTEM_IP} ${cmd}=${start} ${custom}= ${user}=${TOOLS_SYSTEM_USER} ${password}=${TOOLS_SYSTEM_PASSWORD} ${prompt}=${DEFAULT_LINUX_PROMPT} ... ${prompt_timeout}=30s [Documentation] Basic setup to start mininet with custom topology Log Start the test on the base edition @@ -137,7 +137,7 @@ Clean Mininet System Run Command On Mininet ${system} sudo ps -elf | egrep 'usr/local/bin/mn' | egrep python | awk '{print "sudo kill -9",$4}' | sh Clean Up Ovs - [Arguments] ${system}=${MININET} + [Arguments] ${system}=${TOOLS_SYSTEM_IP} [Documentation] Cleans up the OVS instance and remove any existing common known bridges. ${output}= Run Command On Mininet ${system} sudo ovs-vsctl list-br Log ${output} @@ -154,7 +154,7 @@ Extract Value From Content [Return] ${value} Get Process ID Based On Regex On Remote System - [Arguments] ${system} ${regex_string_to_match_on} ${user}=${MININET_USER} ${password}=${EMPTY} ${prompt}=${DEFAULT_LINUX_PROMPT} ${prompt_timeout}=30s + [Arguments] ${system} ${regex_string_to_match_on} ${user}=${TOOLS_SYSTEM_USER} ${password}=${EMPTY} ${prompt}=${DEFAULT_LINUX_PROMPT} ${prompt_timeout}=30s [Documentation] Uses ps to find a process that matches the supplied regex. Returns the PID of that process ... The ${regex_string_to_match_on} should produce a unique process otherwise the PID returned may not be ... the expected PID @@ -169,7 +169,7 @@ Get Process ID Based On Regex On Remote System [Return] ${pid} Get Process Thread Count On Remote System - [Arguments] ${system} ${pid} ${user}=${MININET_USER} ${password}=${EMPTY} ${prompt}=${DEFAULT_LINUX_PROMPT} ${prompt_timeout}=30s + [Arguments] ${system} ${pid} ${user}=${TOOLS_SYSTEM_USER} ${password}=${EMPTY} ${prompt}=${DEFAULT_LINUX_PROMPT} ${prompt_timeout}=30s [Documentation] Executes the ps command to retrieve the lightweight process (aka thread) count. ${cmd}= Set Variable ps --no-headers -o nlwp ${pid} ${output}= Run Command On Remote System ${system} ${cmd} user=${user} password=${password} prompt=${prompt} @@ -238,7 +238,7 @@ Run Command On Controller BuiltIn.Run Keyword And Return Run Command On Remote System ${system} ${cmd} ${user} ${password} prompt=${prompt} Verify File Exists On Remote System - [Arguments] ${system} ${file} ${user}=${MININET_USER} ${password}=${MININET_PASSWORD} ${prompt}=${DEFAULT_LINUX_PROMPT} ${prompt_timeout}=5s + [Arguments] ${system} ${file} ${user}=${TOOLS_SYSTEM_USER} ${password}=${TOOLS_SYSTEM_PASSWORD} ${prompt}=${DEFAULT_LINUX_PROMPT} ${prompt_timeout}=5s [Documentation] Will create connection with public key and will PASS if the given ${file} exists, ... otherwise will FAIL ${conn_id}= Open Connection ${system} prompt=${prompt} timeout=${prompt_timeout} diff --git a/csit/libraries/VtnCoKeywords.robot b/csit/libraries/VtnCoKeywords.robot index aa986fc706..6d4c01dcb4 100644 --- a/csit/libraries/VtnCoKeywords.robot +++ b/csit/libraries/VtnCoKeywords.robot @@ -18,12 +18,12 @@ Get VtnCo [Documentation] Download the VTN Coordinator from Controller VM Log Download the VTN Coordinator bz2 file SSHLibrary.Open_Connection ${ODL_SYSTEM_IP} - SSHLibrary.Login_With_Public_Key ${CONTROLLER_USER} ${USER_HOME}/.ssh/${SSH_KEY} any + SSHLibrary.Login_With_Public_Key ${ODL_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any ${VTNC_FILENAME}= Catenate SEPARATOR=/ ${WORKSPACE} vtn_coordinator.tar.bz2 SSHLibrary.Get_File ${WORKSPACE}/${BUNDLEFOLDER}/externalapps/*vtn-coordinator*-bin.tar.bz2 ${VTNC_FILENAME} SSHLibrary.Close_Connection - SSHLibrary.Open_Connection ${MININET} - SSHLibrary.Login_With_Public_Key ${MININET_USER} ${USER_HOME}/.ssh/${SSH_KEY} any + SSHLibrary.Open_Connection ${TOOLS_SYSTEM_IP} + SSHLibrary.Login_With_Public_Key ${TOOLS_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any SSHLibrary.Put_File ${VTNC_FILENAME} /tmp SSHLibrary.Close_Connection @@ -33,7 +33,7 @@ Start SuiteVtnCo #Get VtnCo ${vtnc_conn_id}= SSHLibrary.Open Connection ${ODL_SYSTEM_IP} prompt=${DEFAULT_LINUX_PROMPT} timeout=30s Set Suite Variable ${vtnc_conn_id} - SSHLibrary.Login_With_Public_Key ${CONTROLLER_USER} ${USER_HOME}/.ssh/${SSH_KEY} any + SSHLibrary.Login_With_Public_Key ${ODL_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any SSHLibrary.Execute Command sudo mkdir -p /usr/local/vtn SSHLibrary.Execute Command sudo chown jenkins /usr/local/vtn SSHLibrary.Execute Command sudo yum install -q -y http://yum.postgresql.org/9.3/redhat/rhel-7-x86_64/pgdg-centos93-9.3-1.noarch.rpm @@ -256,7 +256,7 @@ Create VLANMAP in VBRIDGE Start vlan_topo [Documentation] This will start mininet with custom topology on both the Virtual Machines - Start Mininet ${MININET} ${vlan_topo} ${CURDIR}/${CREATE_VLAN_TOPOLOGY_FILE_PATH} + Start Mininet ${TOOLS_SYSTEM_IP} ${vlan_topo} ${CURDIR}/${CREATE_VLAN_TOPOLOGY_FILE_PATH} Delete a FLOWLIST [Arguments] ${flowlistname} diff --git a/csit/libraries/VtnMaKeywords.robot b/csit/libraries/VtnMaKeywords.robot index 0291a71c67..20183afa5a 100644 --- a/csit/libraries/VtnMaKeywords.robot +++ b/csit/libraries/VtnMaKeywords.robot @@ -112,12 +112,12 @@ Verify Data Flows Start PathSuiteVtnMaTest [Documentation] Start VTN Manager Test Suite and Mininet Start SuiteVtnMaTest - Start Mininet ${MININET} ${pathpolicy_topo_13} ${custom} + Start Mininet ${TOOLS_SYSTEM_IP} ${pathpolicy_topo_13} ${custom} Start PathSuiteVtnMaTestOF10 [Documentation] Start VTN Manager Test Suite and Mininet in Open Flow 10 Specification Start SuiteVtnMaTest - Start Mininet ${MININET} ${pathpolicy_topo_10} ${custom} + Start Mininet ${TOOLS_SYSTEM_IP} ${pathpolicy_topo_10} ${custom} Stop PathSuiteVtnMaTest [Documentation] Cleanup/Shutdown work at the completion of all tests. @@ -209,9 +209,9 @@ Start vlan_topo [Arguments] ${OF} [Documentation] Create custom topology for vlan functionality Clean Mininet System - ${mininet_conn_id1}= Open Connection ${MININET} prompt=${DEFAULT_LINUX_PROMPT} timeout=30s + ${mininet_conn_id1}= Open Connection ${TOOLS_SYSTEM_IP} prompt=${DEFAULT_LINUX_PROMPT} timeout=30s Set Suite Variable ${mininet_conn_id1} - Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/${SSH_KEY} any + Login With Public Key ${TOOLS_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any Execute Command sudo ovs-vsctl set-manager ptcp:6644 Put File ${CURDIR}/${CREATE_VLAN_TOPOLOGY_FILE_PATH} Run Keyword If '${OF}' == 'OF13' Write ${vlan_topo_13} diff --git a/csit/libraries/VtnMaKeywordsLi.robot b/csit/libraries/VtnMaKeywordsLi.robot index 07e26baae9..4a4094cfb9 100644 --- a/csit/libraries/VtnMaKeywordsLi.robot +++ b/csit/libraries/VtnMaKeywordsLi.robot @@ -149,12 +149,12 @@ Verify flowEntryPathPolicy Start PathSuiteVtnMaTest [Documentation] Start VTN Manager Test Suite and Mininet Start SuiteVtnMaTest - Start Mininet ${MININET} ${pathpolicy_topo_13} ${custom} + Start Mininet ${TOOLS_SYSTEM_IP} ${pathpolicy_topo_13} ${custom} Start PathSuiteVtnMaTestOF10 [Documentation] Start VTN Manager Test Suite and Mininet in Open Flow 10 Specification Start SuiteVtnMaTest - Start Mininet ${MININET} ${pathpolicy_topo_10} ${custom} + Start Mininet ${TOOLS_SYSTEM_IP} ${pathpolicy_topo_10} ${custom} Stop PathSuiteVtnMaTest [Documentation] Cleanup/Shutdown work at the completion of all tests. @@ -230,9 +230,9 @@ Delete a interface Start vlan_topo [Arguments] ${OF} Clean Mininet System - ${mininet_conn_id1}= Open Connection ${MININET} prompt=${DEFAULT_LINUX_PROMPT} timeout=30s + ${mininet_conn_id1}= Open Connection ${TOOLS_SYSTEM_IP} prompt=${DEFAULT_LINUX_PROMPT} timeout=30s Set Suite Variable ${mininet_conn_id1} - Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/${SSH_KEY} any + Login With Public Key ${TOOLS_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any Execute Command sudo ovs-vsctl set-manager ptcp:6644 Put File ${CURDIR}/${CREATE_VLAN_TOPOLOGY_FILE_PATH} Run Keyword If '${OF}' == 'OF13' Write ${vlan_topo_13} -- 2.36.6