diff --git a/devstack/lib/tacker b/devstack/lib/tacker index 60c769f76..059cac79d 100644 --- a/devstack/lib/tacker +++ b/devstack/lib/tacker @@ -417,6 +417,10 @@ function tacker_register_default_vim { DEFAULT_VIM_NAME="VIM0" default_vim_id=$(tacker vim-register --is-default --description "Default VIM" --config-file $VIM_CONFIG_FILE $DEFAULT_VIM_NAME -c id | grep id | awk '{print $4}') echo "Default VIM registration done as $default_vim_id at $KEYSTONE_SERVICE_URI." + + echo "Update tacker/tests/etc/samples/local-vim.yaml for functional testing" + functional_vim_file="$TACKER_DIR/tacker/tests/etc/samples/local-vim.yaml" + sed -e "s|^auth_url:.*$|auth_url: \'${KEYSTONE_SERVICE_URI}\'|" -i $functional_vim_file } function modify_heat_flavor_policy_rule { diff --git a/tacker/tests/etc/samples/vim-config-ks-v2.yaml b/tacker/tests/etc/samples/vim-config-ks-v2.yaml deleted file mode 100644 index 142c37bd6..000000000 --- a/tacker/tests/etc/samples/vim-config-ks-v2.yaml +++ /dev/null @@ -1,4 +0,0 @@ -auth_url: http://127.0.0.1:5000/v2.0 -username: nfv_user -password: devstack -project_name: nfv diff --git a/tacker/tests/functional/nfvo/test_vim.py b/tacker/tests/functional/nfvo/test_vim.py index fa9c7bf2b..d3d7c606d 100644 --- a/tacker/tests/functional/nfvo/test_vim.py +++ b/tacker/tests/functional/nfvo/test_vim.py @@ -31,6 +31,13 @@ class VimTestCreate(base.BaseTackerTest): username = data['username'] project_name = data['project_name'] auth_url = data['auth_url'] + if version: + if ('v2' == version and (not auth_url.endswith("/v2.0") or + not auth_url.endswith("/v2.0/"))): + auth_url += "/v2.0" + elif (not auth_url.endswith("/v3") or + not auth_url.endswith("/v3/")): + auth_url += "/v3" domain_name = data.get('domain_name', None) vim_arg = {'vim': {'name': name, 'description': description, 'type': vim_type, @@ -113,5 +120,5 @@ class VimTestCreate(base.BaseTackerTest): description = 'OpenStack VIM with keystone v2' vim_type = 'openstack' ks_version = 'v2' - self._test_create_delete_vim('vim-config-ks-v2.yaml', name, + self._test_create_delete_vim('local-vim.yaml', name, description, vim_type, ks_version)