Port suite from mkumatag personal repo w/o history
All these files came from https://github.com/mkumatag/openbmc-automation
The decision to remove the commit history was because most of the 122
commits did not follow commit comment AND content best practices.
The ability to remove the commit history was possible because all
contributors where from the same company (IBM) making the coordination /
notification/acceptence easy. See all the gory details about the
first try to commit with history here...
https://github.com/openbmc/openbmc-test-automation/pull/1
This suite of tests will run against an OpenBMC based server. It will
run good/bad path testing against the REST interface. There are tests
that will also run ipmitool on the victim BMC too.
If you want to support a new system in to the suite you should only
have to edit two files...
data/<system>.py
tox.ini
The README.md contains details on how to setup for the first time along
with how to execute the test suite
NOTE: some test cases require tools that do not exist on the system.
Currently the ipmitool is needed and if you do not manually copy / link
it in to the tools directory some suites will fail.
diff --git a/lib/ipmi_client.robot b/lib/ipmi_client.robot
new file mode 100755
index 0000000..e7d96b4
--- /dev/null
+++ b/lib/ipmi_client.robot
@@ -0,0 +1,36 @@
+*** Settings ***
+Documentation This module is for IPMI client for copying ipmitool to
+... openbmc box and execute ipmitool commands.
+
+Resource ../lib/resource.txt
+
+Library SSHLibrary
+Library OperatingSystem
+
+*** Keywords ***
+Open Connection And Log In
+ Open connection ${OPENBMC_HOST}
+ Login ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD}
+ Copy ipmitool
+
+Run IPMI Command
+ [arguments] ${args}
+ ${output} ${stderr}= Execute Command /tmp/ipmitool -I dbus raw ${args} return_stderr=True
+ Should Be Empty ${stderr}
+ set test variable ${OUTPUT} "${output}"
+
+Run IPMI Standard Command
+ [arguments] ${args}
+ ${stdout} ${stderr} ${output}= Execute Command /tmp/ipmitool -I dbus ${args} return_stdout=True return_stderr= True return_rc=True
+ Should Be Equal ${output} ${0} msg=${stderr}
+ [return] ${stdout}
+
+Copy ipmitool
+ 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.
+
+ Import Library SCPLibrary WITH NAME scp
+ scp.Open connection ${OPENBMC_HOST} username=${OPENBMC_USERNAME} password=${OPENBMC_PASSWORD}
+ scp.Put File tools/ipmitool /tmp
+ SSHLibrary.Open Connection ${OPENBMC_HOST}
+ Login ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD}
+ Execute Command chmod +x /tmp/ipmitool