blob: e043a9e358fec8ca8fc715359ec35265ca12905b [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
George Keishing4d6c1da2016-07-15 05:51:22 -05002Documentation This module is for IPMI client for copying ipmitool to
3... openbmc box and execute ipmitool commands.
Chris Austenb29d2e82016-06-07 12:25:35 -05004
5Resource ../lib/resource.txt
George Keishing4d6c1da2016-07-15 05:51:22 -05006Resource ../lib/connection_client.robot
Chris Austenb29d2e82016-06-07 12:25:35 -05007
8*** Keywords ***
Chris Austenb29d2e82016-06-07 12:25:35 -05009Run IPMI Command
10 [arguments] ${args}
George Keishing4d6c1da2016-07-15 05:51:22 -050011 Copy ipmitool
Chris Austenb29d2e82016-06-07 12:25:35 -050012 ${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
16Run IPMI Standard Command
17 [arguments] ${args}
George Keishing4d6c1da2016-07-15 05:51:22 -050018 Copy ipmitool
Chris Austenb29d2e82016-06-07 12:25:35 -050019 ${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
23Copy 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