Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation This module is for IPMI client for copying ipmitool to |
| 3 | ... openbmc box and execute ipmitool commands. |
| 4 | |
| 5 | Resource ../lib/resource.txt |
| 6 | |
| 7 | Library SSHLibrary |
| 8 | Library OperatingSystem |
| 9 | |
| 10 | *** Keywords *** |
| 11 | Open Connection And Log In |
| 12 | Open connection ${OPENBMC_HOST} |
| 13 | Login ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} |
| 14 | Copy ipmitool |
| 15 | |
| 16 | Run IPMI Command |
| 17 | [arguments] ${args} |
| 18 | ${output} ${stderr}= Execute Command /tmp/ipmitool -I dbus raw ${args} return_stderr=True |
| 19 | Should Be Empty ${stderr} |
| 20 | set test variable ${OUTPUT} "${output}" |
| 21 | |
| 22 | Run IPMI Standard Command |
| 23 | [arguments] ${args} |
| 24 | ${stdout} ${stderr} ${output}= Execute Command /tmp/ipmitool -I dbus ${args} return_stdout=True return_stderr= True return_rc=True |
| 25 | Should Be Equal ${output} ${0} msg=${stderr} |
| 26 | [return] ${stdout} |
| 27 | |
| 28 | Copy ipmitool |
| 29 | OperatingSystem.File Should Exist tools/ipmitool msg=The ipmitool program could not be found in the tools directory. It is not part of the automation code by default. You must manually copy or link the correct openbmc version of the tool in to the tools directory in order to run this test suite. |
| 30 | |
| 31 | Import Library SCPLibrary WITH NAME scp |
| 32 | scp.Open connection ${OPENBMC_HOST} username=${OPENBMC_USERNAME} password=${OPENBMC_PASSWORD} |
| 33 | scp.Put File tools/ipmitool /tmp |
| 34 | SSHLibrary.Open Connection ${OPENBMC_HOST} |
| 35 | Login ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} |
| 36 | Execute Command chmod +x /tmp/ipmitool |