blob: 25d2808dc15738f4a64cdb567417b2c8243e1ef4 [file] [log] [blame]
Andrew Geissler0205e8d2016-08-10 07:46:19 -05001#!/bin/bash -x
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 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 Geisslerc5c46922019-01-23 10:44:21 -060023ROBOT_TEST_CMD=${ROBOT_TEST_CMD:-"python -m robot\
24 -v OPENBMC_HOST:${IP_ADDR}\
25 -v SSH_PORT:${SSH_PORT}\
26 -v HTTPS_PORT:${HTTPS_PORT}\
27 --argumentfile ./test_lists/QEMU_CI ./tests"}
Andrew Geissler0205e8d2016-08-10 07:46:19 -050028
29git clone https://github.com/openbmc/openbmc-test-automation.git \
30 ${ROBOT_CODE_HOME}
31
32cd ${ROBOT_CODE_HOME}
33
34chmod ugo+rw -R ${ROBOT_CODE_HOME}/*
35
36# Execute the CI tests
Andrew Geissler88906412016-09-02 10:30:47 -050037"$($ROBOT_TEST_CMD)"
Andrew Geissler0205e8d2016-08-10 07:46:19 -050038
39cp ${ROBOT_CODE_HOME}/*.xml ${HOME}/
40cp ${ROBOT_CODE_HOME}/*.html ${HOME}/
Charles Hoferd3583922016-12-13 12:31:02 -060041if [ -d logs ] ; then
42 cp -Rf ${ROBOT_CODE_HOME}/logs ${HOME}/ ;
43fi
Andrew Geissler0205e8d2016-08-10 07:46:19 -050044
45#rm -rf ${ROBOT_CODE_HOME}