X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FSwitchUtils.robot;h=34b4c46eacbc3756b4351eea6b910f0122b38a2a;hb=aaf8b052f2a484a6aef23de854ede10ebcec6f19;hp=349964e6920f72b7d7128f1f4161794eb4b09015;hpb=af10a8780c93a7ac8b8fde288b776cf98e04582a;p=integration%2Ftest.git diff --git a/csit/libraries/SwitchUtils.robot b/csit/libraries/SwitchUtils.robot index 349964e692..34b4c46eac 100644 --- a/csit/libraries/SwitchUtils.robot +++ b/csit/libraries/SwitchUtils.robot @@ -23,24 +23,25 @@ Verify Switch In Operational Data Store [Arguments] ${switch} [Documentation] Verifies the existence of the switch.datapath_id in the operational datastore. ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT} - Log ${resp.content} - Should Match Regexp ${resp.content} openflow:${switch.datapath_id} + Log ${resp.text} + Should Match Regexp ${resp.text} openflow:${switch.datapath_id} Verify Switch Not In Operational Data Store [Arguments] ${switch} [Documentation] Verifies that the given switch.datapath_id is not in the operational datastore. ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT} - Log ${resp.content} - Should Not Match Regexp ${resp.content} openflow:${switch.datapath_id} + Log ${resp.text} + Should Not Match Regexp ${resp.text} openflow:${switch.datapath_id} Iterate Switch Commands From List [Arguments] ${switch} ${cmd_list} [Documentation] Each string in the @{cmd_list} argument is executed on the switch.connection_index. Configure Connection Index And Prompt Wrapper ${switch} - : FOR ${cmd} IN @{cmd_list} - \ Log ${cmd} - \ Read Wrapper ${switch} - \ Execute Command Wrapper ${switch} ${cmd} + FOR ${cmd} IN @{cmd_list} + Log ${cmd} + Read Wrapper ${switch} + Execute Command Wrapper ${switch} ${cmd} + END Configure OpenFlow [Arguments] ${switch} @@ -63,9 +64,10 @@ Validate Switch Output Log ${tmp} ${output}= Execute Command Wrapper ${switch} ${cmd} Log ${output} - : FOR ${str} IN @{validations} - \ Run Keyword If "${should_exist}" == "true" Should Match Regexp ${output} ${str} - \ Run Keyword If "${should_exist}" == "false" Should Not Match Regexp ${output} ${str} + FOR ${str} IN @{validations} + Run Keyword If "${should_exist}" == "true" Should Match Regexp ${output} ${str} + Run Keyword If "${should_exist}" == "false" Should Not Match Regexp ${output} ${str} + END Enable OpenFlow [Arguments] ${switch} @@ -89,7 +91,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} @@ -140,10 +142,11 @@ Connect To Switch ${connection_index}= Open Connection Wrapper ${switch} Call Method ${switch} set_connection_index ${connection_index} Configure Connection Index And Prompt Wrapper ${switch} - : FOR ${cmd} IN @{switch.connection_configs} - \ Write Bare Wrapper ${switch} ${cmd} - \ Sleep 1 - \ Read Wrapper ${switch} + FOR ${cmd} IN @{switch.connection_configs} + Write Bare Wrapper ${switch} ${cmd} + Sleep 1 + Read Wrapper ${switch} + END Cleanup Switch [Arguments] ${switch} @@ -158,10 +161,11 @@ Initialize Switch ... and a reconnect to the switch is made. Connect To Switch ${switch} Configure Connection Index And Prompt Wrapper ${switch} - : FOR ${cmd} IN @{switch.initialization_cmds} - \ Write Bare Wrapper ${switch} ${cmd} - \ Sleep 1 - \ Run Keyword And Ignore Error Read Wrapper ${switch} + FOR ${cmd} IN @{switch.initialization_cmds} + Write Bare Wrapper ${switch} ${cmd} + Sleep 1 + Run Keyword And Ignore Error Read Wrapper ${switch} + END Run Keyword If "${switch.initialization_type}" == "reboot" Wait For Switch Reboot ${switch} Run Keyword If "${switch.initialization_type}" == "reboot" Connect To Switch ${switch}