Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
George Keishing | 4d6c1da | 2016-07-15 05:51:22 -0500 | [diff] [blame] | 2 | Documentation This module is for IPMI client for copying ipmitool to |
| 3 | ... openbmc box and execute ipmitool commands. |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 4 | |
| 5 | Resource ../lib/resource.txt |
George Keishing | 4d6c1da | 2016-07-15 05:51:22 -0500 | [diff] [blame] | 6 | Resource ../lib/connection_client.robot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 7 | |
| 8 | *** Keywords *** |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 9 | Run IPMI Command |
| 10 | [arguments] ${args} |
George Keishing | 4d6c1da | 2016-07-15 05:51:22 -0500 | [diff] [blame] | 11 | Copy ipmitool |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 12 | ${output} ${stderr}= Execute Command /tmp/ipmitool -I dbus raw ${args} return_stderr=True |
| 13 | Should Be Empty ${stderr} |
| 14 | set test variable ${OUTPUT} "${output}" |
| 15 | |
| 16 | Run IPMI Standard Command |
| 17 | [arguments] ${args} |
George Keishing | 4d6c1da | 2016-07-15 05:51:22 -0500 | [diff] [blame] | 18 | Copy ipmitool |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 19 | ${stdout} ${stderr} ${output}= Execute Command /tmp/ipmitool -I dbus ${args} return_stdout=True return_stderr= True return_rc=True |
| 20 | Should Be Equal ${output} ${0} msg=${stderr} |
| 21 | [return] ${stdout} |
| 22 | |
| 23 | Copy ipmitool |
| 24 | 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. |
| 25 | |
| 26 | Import Library SCPLibrary WITH NAME scp |
| 27 | scp.Open connection ${OPENBMC_HOST} username=${OPENBMC_USERNAME} password=${OPENBMC_PASSWORD} |
| 28 | scp.Put File tools/ipmitool /tmp |
| 29 | SSHLibrary.Open Connection ${OPENBMC_HOST} |
| 30 | Login ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} |
| 31 | Execute Command chmod +x /tmp/ipmitool |