-Require_Python
- [Documentation] Verify current SSH connection leads to machine with python working. Fatal fail otherwise.
- ${passed} = Execute_Command_Passes python --help
- BuiltIn.Return_From_Keyword_If ${passed}
- BuiltIn.Fatal_Error Python is not installed!
-
-Assure_Library_Counter
- [Arguments] ${workspace}=/tmp
- [Documentation] Tests whether Counter is present in collections on ssh-connected machine, Puts Counter.py to workspace if not.
- ${passed} = Execute_Command_Passes bash -c 'cd "${workspace}" && python -c "from collections import Counter"'
- # TODO: Move the bash-cd wrapper to separate keyword?
- BuiltIn.Return_From_Keyword_If ${passed}
- SSHLibrary.Put_File ${CURDIR}/../../../libraries/Counter.py ${workspace}/
-
-Assure_Library_Ipaddr
- [Arguments] ${workspace}=/tmp
- [Documentation] Tests whether ipaddr module is present on ssh-connected machine, Puts ipaddr.py to workspace if not.
- ${passed} = Execute_Command_Passes bash -c 'cd "${workspace}" && python -c "import ipaddr"'
- BuiltIn.Return_From_Keyword_If ${passed}
- SSHLibrary.Put_File ${CURDIR}/../../../libraries/ipaddr.py ${workspace}/
-
-Execute_Command_Passes
- [Arguments] ${command}
- [Documentation] Execute command via SSH. If RC is nonzero, log everything. Retrun bool of command success.
- ${stdout} ${stderr} ${rc} = SSHLibrary.Execute_Command ${command} return_stderr=True return_rc=True
- BuiltIn.Return_From_Keyword_If ${rc} == 0 True
- BuiltIn.Log ${stdout}
- BuiltIn.Log ${stderr}
- BuiltIn.Log ${rc}
- [Return] False
-