[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 ${system} by ${user} with ${keyfile_pass} and ${prompt}
+ ${current_ssh_connection}= SSHLibrary.Get Connection
+ Log Attempting to execute command "${cmd}" on remote system "${system}" by user "${user}" with keyfile pass "${keyfile_pass}" and prompt "${prompt}"
${conn_id}= SSHLibrary.Open Connection ${system} prompt=${prompt} timeout=${prompt_timeout}
Flexible SSH Login ${user} ${password}
${stdout} ${stderr} SSHLibrary.Execute Command ${cmd} return_stderr=True
SSHLibrary.Close Connection
Log ${stderr}
+ [Teardown] KarafKeywords.Restore_Current_SSH_Connection_From_Index ${current_ssh_connection.index}
[Return] ${stdout}
Write_Bare_Ctrl_C
[Return] ${minutes}
Write Commands Until Expected Prompt
- [Arguments] ${cmd} ${prompt} ${timeout}=${DEFAULT_TIMEOUT}
+ [Arguments] ${cmd} ${prompt} ${timeout}=30s
[Documentation] quick wrapper for Write and Read Until Prompt Keywords to make test cases more readable
SSHLibrary.Set Client Configuration timeout=${timeout}
SSHLibrary.Write ${cmd}
${output}= SSHLibrary.Read Until ${prompt}
[Return] ${output}
+
+Install Package On Ubuntu System
+ [Arguments] ${package_name} ${system}=${TOOLS_SYSTEM_IP} ${user}=${TOOLS_SYSTEM_USER} ${password}=${TOOLS_SYSTEM_PASSWORD} ${prompt}=${DEFAULT_LINUX_PROMPT} ${prompt_timeout}=30s
+ [Documentation] Keyword to install packages for testing to Ubuntu Mininet VM
+ Log Keyword to install package to Mininet Ubuntu VM
+ Open Connection ${system} prompt=${prompt} timeout=${prompt_timeout}
+ Flexible Mininet Login user=${user} password=${password}
+ Write sudo apt-get install -y ${package_name}
+ Read Until ${prompt}