Andrew Geissler | 12cd9a4 | 2020-11-13 13:45:57 -0600 | [diff] [blame] | 1 | #!/bin/bash -x |
Andrew Geissler | 0205e8d | 2016-08-10 07:46:19 -0500 | [diff] [blame] | 2 | # Extract and run the OpenBMC robot test suite |
| 3 | # |
| 4 | # The robot test results will be copied to ${HOME} |
| 5 | # |
| 6 | # Requires following env variables be set: |
| 7 | # IP_ADDR IP Address of openbmc |
| 8 | # SSH_PORT SSH port of openbmc |
| 9 | # HTTPS_PORT HTTPS port of openbmc |
| 10 | # |
| 11 | # Optional env variable |
| 12 | # ROBOT_CODE_HOME Location to extract the code |
| 13 | # Default will be a temp location in /tmp/ |
Andrew Geissler | 8890641 | 2016-09-02 10:30:47 -0500 | [diff] [blame] | 14 | # ROBOT_TEST_CMD Command to execute from within obmc robot test framework |
Andrew Geissler | 0c63ce1 | 2018-03-01 12:40:19 -0800 | [diff] [blame] | 15 | # Default will be "tox -e qemu -- --include QEMU_CI tests" |
| 16 | # MACHINE Type of system to run tests against |
| 17 | # Default is qemu |
Andrew Geissler | 0205e8d | 2016-08-10 07:46:19 -0500 | [diff] [blame] | 18 | |
| 19 | # we don't want to fail on bad rc since robot tests may fail |
| 20 | |
Andrew Geissler | 0c63ce1 | 2018-03-01 12:40:19 -0800 | [diff] [blame] | 21 | MACHINE=${MACHINE:-"qemu"} |
Andrew Geissler | 0205e8d | 2016-08-10 07:46:19 -0500 | [diff] [blame] | 22 | ROBOT_CODE_HOME=${ROBOT_CODE_HOME:-/tmp/$(whoami)/${RANDOM}/obmc-robot/} |
Andrew Geissler | cd1b0ac | 2019-05-30 11:18:45 -0500 | [diff] [blame] | 23 | ROBOT_TEST_CMD=${ROBOT_TEST_CMD:-"python3 -m robot\ |
Andrew Geissler | c5c4692 | 2019-01-23 10:44:21 -0600 | [diff] [blame] | 24 | -v OPENBMC_HOST:${IP_ADDR}\ |
| 25 | -v SSH_PORT:${SSH_PORT}\ |
| 26 | -v HTTPS_PORT:${HTTPS_PORT}\ |
George Keishing | d5ce1a2 | 2021-09-17 14:30:59 -0500 | [diff] [blame^] | 27 | -v REDFISH_SUPPORT_TRANS_STATE:1\ |
| 28 | --argumentfile ./test_lists/QEMU_CI ./tests ./redfish ./ipmi"} |
Andrew Geissler | 0205e8d | 2016-08-10 07:46:19 -0500 | [diff] [blame] | 29 | |
| 30 | git clone https://github.com/openbmc/openbmc-test-automation.git \ |
Patrick Williams | 384d741 | 2020-11-06 16:15:41 -0600 | [diff] [blame] | 31 | "${ROBOT_CODE_HOME}" |
Andrew Geissler | 0205e8d | 2016-08-10 07:46:19 -0500 | [diff] [blame] | 32 | |
Patrick Williams | cf77603 | 2021-03-16 00:07:17 -0500 | [diff] [blame] | 33 | cd "${ROBOT_CODE_HOME}" || exit |
Andrew Geissler | 0205e8d | 2016-08-10 07:46:19 -0500 | [diff] [blame] | 34 | |
Patrick Williams | 384d741 | 2020-11-06 16:15:41 -0600 | [diff] [blame] | 35 | chmod ugo+rw -R "${ROBOT_CODE_HOME}"/* |
Andrew Geissler | 0205e8d | 2016-08-10 07:46:19 -0500 | [diff] [blame] | 36 | |
| 37 | # Execute the CI tests |
Patrick Williams | 49f456b | 2020-11-11 11:04:05 -0600 | [diff] [blame] | 38 | eval "${ROBOT_TEST_CMD}" |
Andrew Geissler | 0205e8d | 2016-08-10 07:46:19 -0500 | [diff] [blame] | 39 | |
Patrick Williams | 384d741 | 2020-11-06 16:15:41 -0600 | [diff] [blame] | 40 | cp "${ROBOT_CODE_HOME}"/*.xml "${HOME}/" |
| 41 | cp "${ROBOT_CODE_HOME}"/*.html "${HOME}/" |
Charles Hofer | d358392 | 2016-12-13 12:31:02 -0600 | [diff] [blame] | 42 | if [ -d logs ] ; then |
Patrick Williams | 384d741 | 2020-11-06 16:15:41 -0600 | [diff] [blame] | 43 | cp -Rf "${ROBOT_CODE_HOME}"/logs "${HOME}"/ ; |
Charles Hofer | d358392 | 2016-12-13 12:31:02 -0600 | [diff] [blame] | 44 | fi |
Andrew Geissler | 0205e8d | 2016-08-10 07:46:19 -0500 | [diff] [blame] | 45 | |
| 46 | #rm -rf ${ROBOT_CODE_HOME} |