blob: c81715e000399928854efdd4825ee0bca078bc08 [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/}
Patrick Williams476a7e92022-12-06 09:52:53 -060023ROBOT_TEST_CMD="${ROBOT_TEST_CMD:-"python3 -m robot\
Andrew Geisslerc5c46922019-01-23 10:44:21 -060024 -v OPENBMC_HOST:${IP_ADDR}\
George Keishinge24df802023-11-16 14:44:24 +053025 -v OPENBMC_PASSWORD:0penBmc\
26 -v IPMI_PASSWORD:0penBmc\
Andrew Geisslerc5c46922019-01-23 10:44:21 -060027 -v SSH_PORT:${SSH_PORT}\
28 -v HTTPS_PORT:${HTTPS_PORT}\
George Keishingd5ce1a22021-09-17 14:30:59 -050029 -v REDFISH_SUPPORT_TRANS_STATE:1\
George Keishingf116f6f2023-04-03 10:38:51 -050030 --argumentfile ./test_lists/QEMU_CI ./redfish ./ipmi"}"
Andrew Geissler0205e8d2016-08-10 07:46:19 -050031
32git clone https://github.com/openbmc/openbmc-test-automation.git \
Patrick Williams476a7e92022-12-06 09:52:53 -060033 "${ROBOT_CODE_HOME}"
Andrew Geissler0205e8d2016-08-10 07:46:19 -050034
Patrick Williamscf776032021-03-16 00:07:17 -050035cd "${ROBOT_CODE_HOME}" || exit
Andrew Geissler0205e8d2016-08-10 07:46:19 -050036
Patrick Williams384d7412020-11-06 16:15:41 -060037chmod ugo+rw -R "${ROBOT_CODE_HOME}"/*
Andrew Geissler0205e8d2016-08-10 07:46:19 -050038
39# Execute the CI tests
Patrick Williams49f456b2020-11-11 11:04:05 -060040eval "${ROBOT_TEST_CMD}"
Andrew Geissler0205e8d2016-08-10 07:46:19 -050041
Patrick Williams384d7412020-11-06 16:15:41 -060042cp "${ROBOT_CODE_HOME}"/*.xml "${HOME}/"
43cp "${ROBOT_CODE_HOME}"/*.html "${HOME}/"
Charles Hoferd3583922016-12-13 12:31:02 -060044if [ -d logs ] ; then
Patrick Williams384d7412020-11-06 16:15:41 -060045 cp -Rf "${ROBOT_CODE_HOME}"/logs "${HOME}"/ ;
Charles Hoferd3583922016-12-13 12:31:02 -060046fi
Andrew Geissler0205e8d2016-08-10 07:46:19 -050047
48#rm -rf ${ROBOT_CODE_HOME}