Files
python-ironicclient/playbooks/functional/run.yaml
Iury Gregory Melo Ferreira 9b881cb973 Run jobs under python2 and python3
-Switch functional job to run under python3
-Create a functional job to run under python2
-Create a tempest job to run under python2
-Create tox env to run functional tests under python3
-Validate if `USE_PYTHON3` is set to `True` to call
the correct env for tests
-Remove hardcoded path for client when running functional tests
- Update tests failures to work for python2 and python3

Change-Id: I55abc999f6f397b171d05fd9e9b39d833ca95e55
2019-03-15 17:43:19 +01:00

56 lines
1.8 KiB
YAML

- hosts: all
tasks:
- shell:
cmd: |
set -e
set -x
export BASE='/opt/stack'
export IRONICCLIENT_DIR="$BASE/python-ironicclient"
sudo chmod -R a+rw /opt/stack/
cd $IRONICCLIENT_DIR
set +e
echo "Running ironicclient functional test suite"
# Only admin credentials needed for ironic api
source $BASE/devstack/openrc admin admin
FUNC_TEST_DIR=$IRONICCLIENT_DIR/ironicclient/tests/functional
CONFIG_FILE=$IRONICCLIENT_DIR/test.conf
echo 'Generating configuration file for functional tests'
if [[ -n "$IRONIC_URL" ]]; then
cat <<END >$CONFIG_FILE
[functional]
api_version = 1
auth_strategy=noauth
ironic_url=$IRONIC_URL
END
else
cat <<END >$CONFIG_FILE
[functional]
api_version = 1
os_auth_url=$OS_AUTH_URL
os_identity_api_version=$OS_IDENTITY_API_VERSION
os_username=$OS_USERNAME
os_password=$OS_PASSWORD
os_project_name=$OS_PROJECT_NAME
os_user_domain_id=$OS_USER_DOMAIN_ID
os_project_domain_id=$OS_PROJECT_DOMAIN_ID
os_service_type=baremetal
os_endpoint_type=public
END
fi
echo 'Configuration file is in '$CONFIG_FILE''
export IRONICCLIENT_TEST_CONFIG=$CONFIG_FILE
cd $IRONICCLIENT_DIR
if [[ $USE_PYTHON3 == "True" ]]; then
echo 'Running Functional Tests under Python3'
tox -e functionalpy3
else
echo 'Running Functional Tests under Python2'
tox -e functional
fi
executable: /bin/bash
chdir: '/opt/stack/python-ironicclient'