From fa373795ba1000eb6ee369a21b412c5d32826e0f Mon Sep 17 00:00:00 2001 From: Naoaki Horie Date: Fri, 5 Jun 2020 00:14:46 +0000 Subject: [PATCH] Unexpected update in setup script for functional test There are some placeholder files for running functional test in zuul. The contents of the files, such as `auth_url` of the following files, are updated while running devstack `stack.sh`. * tacker/tests/etc/samples/local-vim.yaml * tools/test-setup-default-vim.sh These Git management files including the above, should not be modified. Therefore, I will be fix as follow. The need files to be change for Zuul are deploy by Ansible, so the deploy process is run with Ansible instead of the `devstack/lib/tacker` script. Allow `tools/test-setup-default-vim.sh` script to be executed by itself, so the git management files aren't updated by running devstack `stack.sh`. Also, as other improvements, replace the file path included in Ansible role to definition value. Change-Id: Iad88c7adfe56e926ee0324d94787577ba066989b Closes-Bug: #1879303 --- devstack/lib/tacker | 15 --------- roles/setup-default-vim/tasks/main.yaml | 43 +++++++++++++++++++++++-- roles/show-net-setup/tasks/main.yaml | 8 ++--- tools/test-setup-default-vim.sh | 22 +++++++++++++ 4 files changed, 67 insertions(+), 21 deletions(-) diff --git a/devstack/lib/tacker b/devstack/lib/tacker index 5114ccfbe..b34d767c6 100644 --- a/devstack/lib/tacker +++ b/devstack/lib/tacker @@ -436,26 +436,11 @@ function tacker_register_default_vim { sed -e "s|^auth_url:.*$|auth_url: \'${KEYSTONE_SERVICE_URI}\'|" -i $VIM_CONFIG_FILE echo "The content of VIM config file $VIM_CONFIG_FILE :" cat $VIM_CONFIG_FILE - DEFAULT_VIM_NAME="VIM0" # TODO(tpatil): Remove installing python-tackerclient using pip once # a solution is available to install it using requirements. pip_install python-tackerclient - cat >> $TACKER_DIR/tools/test-setup-default-vim.sh < /opt/stack/ipaddress.txt" + shell: sudo bash -c "ip address > {{ devstack_base_dir }}//ipaddress.txt" - name: Collect net information fetch: flat: yes dest: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}/confs/devstack/ipaddress.txt" - src: "/opt/stack/ipaddress.txt" + src: "{{ devstack_base_dir }}//ipaddress.txt" - name: print ovs information - shell: sudo bash -c "ovs-vsctl show > /opt/stack/ovsvsctl.txt" + shell: sudo bash -c "ovs-vsctl show > {{ devstack_base_dir }}//ovsvsctl.txt" - name: Collect ovs information fetch: flat: yes dest: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}/confs/devstack/ovsvsctl.txt" - src: "/opt/stack/ovsvsctl.txt" + src: "{{ devstack_base_dir }}//ovsvsctl.txt" diff --git a/tools/test-setup-default-vim.sh b/tools/test-setup-default-vim.sh index 5111041da..bde2dfb80 100755 --- a/tools/test-setup-default-vim.sh +++ b/tools/test-setup-default-vim.sh @@ -4,3 +4,25 @@ # for functional testing, which cannot be put # in devstack/plugin.sh because new zuul3 CI # cannot keep the devstack plugins order +# +# Also, this script updates the following +# parameter which has been modified +# unintentionally by ansible playbook +# `roles/setup-default-vim/tasks/main.yaml` +# according to the execution environment of +# Zuul. +# +# --os-auth-url +# --config-file + +openstack vim register \ + --os-username nfv_user \ + --os-project-name nfv \ + --os-password devstack \ + --os-auth-url http://127.0.0.1/identity \ + --os-project-domain-name Default \ + --os-user-domain-name Default \ + --is-default \ + --description "Default VIM" \ + --config-file /opt/stack/tacker/tacker/tests/etc/samples/local-vim.yaml \ + VIM0