diff --git a/devstack/upgrade/resources.sh b/devstack/upgrade/resources.sh index 6ee2e313c9..f7e25d28b2 100755 --- a/devstack/upgrade/resources.sh +++ b/devstack/upgrade/resources.sh @@ -18,6 +18,7 @@ source $GRENADE_DIR/grenaderc source $GRENADE_DIR/functions source $TOP_DIR/openrc admin admin +source $TOP_DIR/inc/ini-config set -o xtrace @@ -35,6 +36,14 @@ function _heat_set_user { function create { # run heat_integrationtests instead of tempest smoke before create pushd $BASE_DEVSTACK_DIR/../heat + conf_file=heat_integrationtests/heat_integrationtests.conf + iniset $conf_file heat_plugin username $OS_USERNAME + iniset $conf_file heat_plugin password $OS_PASSWORD + iniset $conf_file heat_plugin tenant_name $OS_PROJECT_NAME + iniset $conf_file heat_plugin auth_url $OS_AUTH_URL + iniset $conf_file heat_plugin user_domain_name $OS_USER_DOMAIN_NAME + iniset $conf_file heat_plugin project_domain_name $OS_PROJECT_DOMAIN_NAME + iniset $conf_file heat_plugin region $OS_REGION_NAME tox -eintegration heat_integrationtests.functional.test_create_update popd diff --git a/heat_integrationtests/README.rst b/heat_integrationtests/README.rst index 0477888747..7087dd93e4 100644 --- a/heat_integrationtests/README.rst +++ b/heat_integrationtests/README.rst @@ -7,11 +7,16 @@ defaults match running against a recent DevStack. To run the tests against DevStack, do the following: - # source DevStack credentials + # Define DEST + + export DEST=/opt/stack - source /opt/stack/devstack/openrc + # create test resources and write config - # run the heat integration tests with those credentials + $DEST/heat/heat_integrationtests/prepare_test_env.sh + $DEST/heat/heat_integrationtests/prepare_test_network.sh + + # run the heat integration tests cd /opt/stack/heat diff --git a/heat_integrationtests/common/config.py b/heat_integrationtests/common/config.py index c2aac652fb..80812822ab 100644 --- a/heat_integrationtests/common/config.py +++ b/heat_integrationtests/common/config.py @@ -35,10 +35,8 @@ HeatGroup = [ default="orchestration", help="Catalog type of the orchestration service."), cfg.StrOpt('username', - default=os.environ.get('OS_USERNAME'), help="Username to use for non admin API requests."), cfg.StrOpt('password', - default=os.environ.get('OS_PASSWORD'), help="Non admin API key to use when authenticating.", secret=True), cfg.StrOpt('admin_username', @@ -47,25 +45,19 @@ HeatGroup = [ help="Admin API key to use when authentication.", secret=True), cfg.StrOpt('tenant_name', - default=(os.environ.get('OS_PROJECT_NAME') or - os.environ.get('OS_TENANT_NAME')), help="Tenant name to use for API requests."), cfg.StrOpt('admin_tenant_name', default='admin', help="Admin tenant name to use for admin API requests."), cfg.StrOpt('auth_url', - default=os.environ.get('OS_AUTH_URL'), help="Full URI of the OpenStack Identity API (Keystone)"), cfg.StrOpt('user_domain_name', - default=os.environ.get('OS_USER_DOMAIN_NAME'), help="User domain name, if keystone v3 auth_url" "is used"), cfg.StrOpt('project_domain_name', - default=os.environ.get('OS_PROJECT_DOMAIN_NAME'), help="Project domain name, if keystone v3 auth_url" "is used"), cfg.StrOpt('region', - default=os.environ.get('OS_REGION_NAME'), help="The region name to use"), cfg.StrOpt('instance_type', help="Instance type for tests. Needs to be big enough for a " diff --git a/heat_integrationtests/post_test_hook.sh b/heat_integrationtests/post_test_hook.sh index 4f08b7ba67..31752127de 100755 --- a/heat_integrationtests/post_test_hook.sh +++ b/heat_integrationtests/post_test_hook.sh @@ -17,8 +17,6 @@ set -ex export DEST=${DEST:-/opt/stack/new} -source $DEST/devstack/openrc admin admin sudo -E $DEST/heat/heat_integrationtests/prepare_test_env.sh sudo -E $DEST/heat/heat_integrationtests/prepare_test_network.sh -source $DEST/devstack/openrc demo demo -sudo -E tox -eintegration +sudo tox -eintegration diff --git a/heat_integrationtests/prepare_test_env.sh b/heat_integrationtests/prepare_test_env.sh index c2ed83d4fd..e323bc7440 100755 --- a/heat_integrationtests/prepare_test_env.sh +++ b/heat_integrationtests/prepare_test_env.sh @@ -16,14 +16,30 @@ # in heat_integrationtests.conf. # Credentials are required for creating nova flavors and glance images. -set -ex +set -e DEST=${DEST:-/opt/stack/new} source $DEST/devstack/inc/ini-config +set -x + conf_file=$DEST/heat/heat_integrationtests/heat_integrationtests.conf +source $DEST/devstack/openrc demo demo +# user creds +iniset $conf_file heat_plugin username $OS_USERNAME +iniset $conf_file heat_plugin password $OS_PASSWORD +iniset $conf_file heat_plugin tenant_name $OS_PROJECT_NAME +iniset $conf_file heat_plugin auth_url $OS_AUTH_URL +iniset $conf_file heat_plugin user_domain_name $OS_USER_DOMAIN_NAME +iniset $conf_file heat_plugin project_domain_name $OS_PROJECT_DOMAIN_NAME +iniset $conf_file heat_plugin region $OS_REGION_NAME + +source $DEST/devstack/openrc admin admin +iniset $conf_file heat_plugin admin_username $OS_USERNAME +iniset $conf_file heat_plugin admin_password $OS_PASSWORD + # Register the flavors for booting test servers iniset $conf_file heat_plugin instance_type m1.heat_int iniset $conf_file heat_plugin minimal_instance_type m1.heat_micro @@ -42,9 +58,6 @@ iniset $conf_file heat_plugin image_ref fedora-heat-test-image iniset $conf_file heat_plugin boot_config_env $DEST/heat-templates/hot/software-config/boot-config/test_image_env.yaml iniset $conf_file heat_plugin heat_config_notify_script $DEST/heat-templates/hot/software-config/elements/heat-config/bin/heat-config-notify iniset $conf_file heat_plugin minimal_image_ref cirros-0.3.4-x86_64-uec -# admin creds already sourced, store in conf -iniset $conf_file heat_plugin admin_username $OS_USERNAME -iniset $conf_file heat_plugin admin_password $OS_PASSWORD # Add scenario tests to skip # VolumeBackupRestoreIntegrationTest skipped until failure rate can be reduced ref bug #1382300 diff --git a/tox.ini b/tox.ini index 2714265cf8..f27e2cb036 100644 --- a/tox.ini +++ b/tox.ini @@ -29,7 +29,6 @@ commands = setenv = VIRTUAL_ENV={envdir} OS_TEST_PATH=./heat_integrationtests TESTR_START_DIR=heat_integrationtests -passenv = OS_* usedevelop = False deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt