blob: fab7941bf2d6ac71e8d9459222ddbeb243842368 [file] [log] [blame]
Andrew Geissler12cd9a42020-11-13 13:45:57 -06001#!/bin/bash -x
Andrew Geissler0205e8d2016-08-10 07:46:19 -05002# 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 Geissler88906412016-09-02 10:30:47 -050014# ROBOT_TEST_CMD Command to execute from within obmc robot test framework
Andrew Geissler0c63ce12018-03-01 12:40:19 -080015# Default will be "tox -e qemu -- --include QEMU_CI tests"
16# MACHINE Type of system to run tests against
17# Default is qemu
Andrew Geissler0205e8d2016-08-10 07:46:19 -050018
19# we don't want to fail on bad rc since robot tests may fail
20
Andrew Geissler0c63ce12018-03-01 12:40:19 -080021MACHINE=${MACHINE:-"qemu"}
Andrew Geissler0205e8d2016-08-10 07:46:19 -050022ROBOT_CODE_HOME=${ROBOT_CODE_HOME:-/tmp/$(whoami)/${RANDOM}/obmc-robot/}
Andrew Geisslercd1b0ac2019-05-30 11:18:45 -050023ROBOT_TEST_CMD=${ROBOT_TEST_CMD:-"python3 -m robot\
Andrew Geisslerc5c46922019-01-23 10:44:21 -060024 -v OPENBMC_HOST:${IP_ADDR}\
25 -v SSH_PORT:${SSH_PORT}\
26 -v HTTPS_PORT:${HTTPS_PORT}\
George Keishingd5ce1a22021-09-17 14:30:59 -050027 -v REDFISH_SUPPORT_TRANS_STATE:1\
28 --argumentfile ./test_lists/QEMU_CI ./tests ./redfish ./ipmi"}
Andrew Geissler0205e8d2016-08-10 07:46:19 -050029
30git clone https://github.com/openbmc/openbmc-test-automation.git \
Patrick Williams384d7412020-11-06 16:15:41 -060031 "${ROBOT_CODE_HOME}"
Andrew Geissler0205e8d2016-08-10 07:46:19 -050032
Patrick Williamscf776032021-03-16 00:07:17 -050033cd "${ROBOT_CODE_HOME}" || exit
Andrew Geissler0205e8d2016-08-10 07:46:19 -050034
Patrick Williams384d7412020-11-06 16:15:41 -060035chmod ugo+rw -R "${ROBOT_CODE_HOME}"/*
Andrew Geissler0205e8d2016-08-10 07:46:19 -050036
37# Execute the CI tests
Patrick Williams49f456b2020-11-11 11:04:05 -060038eval "${ROBOT_TEST_CMD}"
Andrew Geissler0205e8d2016-08-10 07:46:19 -050039
Patrick Williams384d7412020-11-06 16:15:41 -060040cp "${ROBOT_CODE_HOME}"/*.xml "${HOME}/"
41cp "${ROBOT_CODE_HOME}"/*.html "${HOME}/"
Charles Hoferd3583922016-12-13 12:31:02 -060042if [ -d logs ] ; then
Patrick Williams384d7412020-11-06 16:15:41 -060043 cp -Rf "${ROBOT_CODE_HOME}"/logs "${HOME}"/ ;
Charles Hoferd3583922016-12-13 12:31:02 -060044fi
Andrew Geissler0205e8d2016-08-10 07:46:19 -050045
46#rm -rf ${ROBOT_CODE_HOME}