blob: e7d96b49900898a7b478ab206a024b9039c70d1d [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
2Documentation This module is for IPMI client for copying ipmitool to
3... openbmc box and execute ipmitool commands.
4
5Resource ../lib/resource.txt
6
7Library SSHLibrary
8Library OperatingSystem
9
10*** Keywords ***
11Open Connection And Log In
12 Open connection ${OPENBMC_HOST}
13 Login ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD}
14 Copy ipmitool
15
16Run 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
22Run 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
28Copy 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