python-ironicclient/playbooks/functional/run.yaml

54 lines
1.6 KiB
YAML

- hosts: all
roles:
- ensure-tox
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
echo 'Running Functional Tests under Python3'
{{ tox_executable }} -e functionalpy3
executable: /bin/bash
chdir: '/opt/stack/python-ironicclient'