xref: /openbmc/openbmc-build-scripts/scripts/run-robot.sh (revision 0205e8dacd8a380dfd88ac150b8f6e6545656d1a)
1#!/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/
14
15# we don't want to fail on bad rc since robot tests may fail
16
17ROBOT_CODE_HOME=${ROBOT_CODE_HOME:-/tmp/$(whoami)/${RANDOM}/obmc-robot/}
18
19git clone https://github.com/openbmc/openbmc-test-automation.git \
20        ${ROBOT_CODE_HOME}
21
22cd ${ROBOT_CODE_HOME}
23
24chmod ugo+rw -R ${ROBOT_CODE_HOME}/*
25
26# Execute the CI tests
27export OPENBMC_HOST=${IP_ADDR}
28export SSH_PORT=${SSH_PORT}
29export HTTPS_PORT=${HTTPS_PORT}
30
31tox -e qemu -- --include CI tests
32
33cp ${ROBOT_CODE_HOME}/*.xml ${HOME}/
34cp ${ROBOT_CODE_HOME}/*.html ${HOME}/
35
36#rm -rf ${ROBOT_CODE_HOME}
37