Fix tempest configuration

Fix tempest configuration to be up to date
and pin tempest to prevent breaking configuration

Change-Id: Ia8686a425686dbf99c4e092553fc4d0aa2338f31
This commit is contained in:
Sagi Shnaidman 2016-06-21 10:48:58 +03:00
parent fd337aac59
commit fec44d5dc2
4 changed files with 18 additions and 9 deletions

View File

@ -176,6 +176,8 @@ def discover(auth_provider, region, object_store_discovery=True,
services = {}
service_catalog = 'serviceCatalog'
public_url = 'publicURL'
identity_port = urlparse.urlparse(auth_provider.auth_url).port
identity_version = urlparse.urlparse(auth_provider.auth_url).path
if api_version == 3:
service_catalog = 'catalog'
public_url = 'url'
@ -189,7 +191,12 @@ def discover(auth_provider, region, object_store_discovery=True,
break
else:
ep = entry['endpoints'][0]
services[name]['url'] = ep[public_url]
if 'identity' in ep[public_url]:
services[name]['url'] = ep[public_url].replace(
"/identity", ":{0}{1}".format(
identity_port, identity_version))
else:
services[name]['url'] = ep[public_url]
service_class = get_service_class(name)
service = service_class(name, services[name]['url'], token,
disable_ssl_certificate_validation)

View File

@ -54,6 +54,7 @@ from tempest.lib import exceptions
from tempest.lib.services.compute import flavors_client
from tempest.lib.services.compute import networks_client as nova_net_client
from tempest.lib.services.compute import servers_client
from tempest.lib.services.image.v2 import images_client
from tempest.lib.services.network import networks_client
from tempest.services.identity.v2.json import identity_client
from tempest.services.identity.v2.json import roles_client
@ -61,7 +62,6 @@ from tempest.services.identity.v2.json import tenants_client
from tempest.services.identity.v2.json import users_client
from tempest.services.identity.v3.json \
import identity_client as identity_v3_client
from tempest.lib.services.image.v2 import images_client
LOG = logging.getLogger(__name__)
LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
@ -533,7 +533,7 @@ def create_user_with_tenant(tenants_client, users_client, username,
email = "%s@test.com" % username
# create tenant
try:
tenants_client.create_tenant(tenant_name,
tenants_client.create_tenant(name=tenant_name,
description=tenant_description)
except exceptions.Conflict:
LOG.info("(no change) Tenant '%s' already exists", tenant_name)
@ -541,7 +541,8 @@ def create_user_with_tenant(tenants_client, users_client, username,
tenant_id = identity.get_tenant_by_name(tenants_client, tenant_name)['id']
# create user
try:
users_client.create_user(username, password, tenant_id, email)
users_client.create_user(**{'name': username, 'password': password,
'tenantId': tenant_id, 'email': email})
except exceptions.Conflict:
LOG.info("User '%s' already exists. Setting password to '%s'",
username, password)

View File

@ -178,9 +178,7 @@ fi
if [ $RUN_TEMPEST_TESTS == 1 ] ; then
start_metric "tripleo.overcloud.${TOCI_JOBTYPE}.tempest.seconds"
export TEMPEST_REGEX='^(?=(.*smoke))(?!('
export TEMPEST_REGEX="${TEMPEST_REGEX}tempest.api.orchestration.stacks"
export TEMPEST_REGEX="${TEMPEST_REGEX}|tempest.scenario.test_volume_boot_pattern" # http://bugzilla.redhat.com/1272289
export TEMPEST_REGEX="${TEMPEST_REGEX}|tempest.api.telemetry"
export TEMPEST_REGEX="${TEMPEST_REGEX}tempest.scenario.test_volume_boot_pattern" # http://bugzilla.redhat.com/1272289
export TEMPEST_REGEX="${TEMPEST_REGEX}|tempest.api.identity.*v3" # https://bugzilla.redhat.com/1266947
export TEMPEST_REGEX="${TEMPEST_REGEX}|.*test_external_network_visibility" # https://bugs.launchpad.net/tripleo/+bug/1577769
export TEMPEST_REGEX="${TEMPEST_REGEX}))"

View File

@ -134,6 +134,7 @@ TEMPEST_RUN=${TEMPEST_RUN:-""}
TEMPEST_ARGS=${TEMPEST_ARGS:-"--parallel --subunit"}
TEMPEST_ADD_CONFIG=${TEMPEST_ADD_CONFIG:-}
TEMPEST_REGEX=${TEMPEST_REGEX:-"^(?=(.*smoke))(?!(tempest.api.orchestration.stacks|tempest.scenario.test_volume_boot_pattern|tempest.api.telemetry))"}
TEMPEST_PINNED="fb77374ddeeb1642bffa086311d5f281e15142b2"
# TODO: remove this when Image create in openstackclient supports the v2 API
export OS_IMAGE_API_VERSION=1
@ -702,13 +703,14 @@ function tempest_run {
root_dir=$(realpath $(dirname ${BASH_SOURCE[0]:-$0}))
[[ ! -e $HOME/tempest ]] && git clone https://github.com/openstack/tempest $HOME/tempest
pushd $HOME/tempest
git checkout $TEMPEST_PINNED
FLOATING_IP_CIDR=${FLOATING_IP_CIDR:-"192.0.2.0/24"};
FLOATING_IP_START=${FLOATING_IP_START:-"192.0.2.50"};
FLOATING_IP_END=${FLOATING_IP_END:-"192.0.2.64"};
export EXTERNAL_NETWORK_GATEWAY=${EXTERNAL_NETWORK_GATEWAY:-"192.0.2.1"};
neutron net-create nova --shared --router:external=True --provider:network_type flat --provider:physical_network datacentre;
neutron subnet-create --name ext-subnet --allocation-pool start=$FLOATING_IP_START,end=$FLOATING_IP_END --disable-dhcp --gateway $EXTERNAL_NETWORK_GATEWAY nova $FLOATING_IP_CIDR;
sudo yum install -y libffi-devel openssl-devel
sudo yum install -y libffi-devel openssl-devel python-virtualenv
virtualenv --no-site-packages .venv
$HOME/tempest/tools/with_venv.sh pip install -U pip setuptools
$HOME/tempest/tools/with_venv.sh pip install junitxml httplib2 -r test-requirements.txt -r requirements.txt
@ -727,6 +729,7 @@ function tempest_run {
identity.admin_password $OS_PASSWORD \
compute.build_timeout 500 \
compute.image_ssh_user cirros \
orchestration.stack_owner_role _member_ \
compute.ssh_user cirros \
network.build_timeout 500 \
volume.build_timeout 500 \
@ -740,7 +743,7 @@ function tempest_run {
tee >( subunit2junitxml --output-to=/var/log/tempest/tempest.xml ) | \
subunit-trace --no-failure-debug -f 2>&1 | \
tee /var/log/tempest/tempest_console.log && exitval=0 || exitval=$?
subunit2html $(find $HOME/tempest/.testrepository -name [0-9] | head -1) /var/log/tempest/tempest.html
subunit2html $HOME/tempest/.testrepository/$(ls -t $HOME/tempest/.testrepository/ | grep -e "[0-9]" | head -1) /var/log/tempest/tempest.html
exit ${exitval}
}