This repository has been archived by the owner on Jun 26, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate tempest.conf automatically using refstack-client
Usage: $ refstack-client config --use-test-accounts <path to test accounts file> If not accounts.yaml is passed then: $ refstack-client config It will generate accounts.yaml and tempest.conf in etc folder * It adds support for the above command * Added zuul based devstack job to run the same * let setup_env handles the installation of tempestconf * updated git url for tempest * It also generates accounts.yaml if no account file is passed * we can --overrides flag to overrides the tempest.conf value. * volume-feature-enabled.api_v2=True is added as default in overrides as it is deprecated in Rocky cycle but needed for interop tests. Depends-On: https://review.openstack.org/589260 Story: 2001696 Task: 19758 Change-Id: I9cabfc52672e7a8a54792ca9d867c62babf12cb7
- Loading branch information
1 parent
a13a5a4
commit e1744ea
Showing
8 changed files
with
286 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
- project: | ||
check: | ||
jobs: | ||
- refstack-client-devstack-tempestconf | ||
- openstack-tox-py35 | ||
gate: | ||
jobs: | ||
- refstack-client-devstack-tempestconf | ||
- openstack-tox-py35 | ||
|
||
- job: | ||
name: refstack-client-devstack-tempestconf | ||
parent: devstack | ||
description: | | ||
Refstack client job for testing python-tempestconf and RefStack Integration | ||
required-projects: | ||
- openstack/refstack-client | ||
- openstack/tempest | ||
- openstack-dev/devstack | ||
- openstack/python-tempestconf | ||
roles: | ||
- zuul: openstack/python-tempestconf | ||
- zuul: openstack/tempest | ||
- zuul: openstack-dev/devstack | ||
- zuul: openstack/refstack-client | ||
run: playbooks/tempestconf-refstack-devstack.yaml | ||
vars: | ||
user: demo | ||
cloud_user: devstack | ||
test_demo: True | ||
cloud_admin: devstack-admin | ||
irrelevant-files: | ||
- config_tempest/tests/.*$ | ||
- ^doc/.*$ | ||
- ^releasenotes/.*$ | ||
- ^.*\.rst$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
- hosts: all | ||
roles: | ||
- run-devstack | ||
|
||
- hosts: tempest | ||
vars: | ||
set_auth_url: "OS_AUTH_URL=$SERVICE_PROTOCOL://$SERVICE_HOST/identity/v3" | ||
devstack_base_dir: "/opt/stack" | ||
aditional_tempestconf_params: "auth.tempest_roles Member" | ||
tasks: | ||
- name: Setup Tempest Run Directory | ||
include_role: | ||
name: setup-tempest-run-dir | ||
- name: Setup Tempest Data Directory | ||
include_role: | ||
name: setup-tempest-data-dir | ||
- name: ACL devstack files | ||
include_role: | ||
name: acl-devstack-files | ||
- name: Generate configuration file for Tempest as admin | ||
include_role: | ||
name: generate-tempestconf-file | ||
vars: | ||
output_path: "/etc/openstack/tempest_admin.conf" | ||
source_credentials_commands: "export HOST_IP={{ ansible_default_ipv4.address }}; source {{ devstack_base_dir }}/devstack/openrc admin admin; {{ set_auth_url }}" | ||
user: admin | ||
- name: Generate accounts.yaml file for Demo | ||
include_role: | ||
name: generate-accounts-file | ||
vars: | ||
aditional_tempestconf_params: "auth.tempest_roles Member" | ||
source_credentials_commands: "export HOST_IP={{ ansible_default_ipv4.address }}; source {{ devstack_base_dir }}/devstack/openrc admin admin; {{ set_auth_url }}" | ||
accounts_file_destination: "/etc/openstack" | ||
tempest_config_file: "/etc/openstack/tempest_admin.conf" | ||
- name: Generate tempest.conf using refstack-client and run tempest tests | ||
include_role: | ||
name: generate-tempestconf-refstack | ||
vars: | ||
source_credentials_commands: "export HOST_IP={{ ansible_default_ipv4.address }}; source {{ devstack_base_dir }}/devstack/openrc {{ user }} {{ user }}; {{ set_auth_url }}" | ||
user: demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
cloud_user: "devstack" | ||
virtualenvs: | ||
refstack_client: "~/.virtualenvs/.refstack_client" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
- block: | ||
- name: Install refstack-client and python-tempestconf | ||
shell: | | ||
set -ex | ||
export PATH=$PATH:/usr/local/sbin:/usr/sbin | ||
./setup_env | ||
args: | ||
chdir: "{{ refstack_client_src_relative_path }}" | ||
executable: /bin/bash | ||
|
||
- name: Print Tempest account file | ||
shell: | | ||
set -ex | ||
cat /etc/openstack/accounts.yaml | ||
- name: Generate tempest configuration file | ||
shell: | | ||
set -ex | ||
export PATH=$PATH:/usr/local/sbin:/usr/sbin | ||
source .venv/bin/activate | ||
{{ source_credentials_commands }} | ||
printenv | ||
refstack-client config --use-test-accounts /etc/openstack/accounts.yaml \ | ||
--image http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img \ | ||
--out /tmp/tempest.conf | ||
args: | ||
chdir: "{{ refstack_client_src_relative_path }}" | ||
executable: /bin/bash | ||
|
||
- name: Print generated tempest.conf | ||
shell: | | ||
set -ex | ||
cat /tmp/tempest.conf | ||
- name: Run refstack-client tests | ||
shell: | | ||
set -ex | ||
export PATH=$PATH:/usr/local/sbin:/usr/sbin | ||
source .venv/bin/activate | ||
printenv | ||
refstack-client test -c /tmp/tempest.conf \ | ||
-v --test-list "https://refstack.openstack.org/api/v1/guidelines/2017.09/tests?target=platform&type=required&alias=true&flag=false" | ||
args: | ||
chdir: "{{ refstack_client_src_relative_path }}" | ||
executable: /bin/bash | ||
|
||
vars: | ||
refstack_client_src_relative_path: "{{ zuul.projects['git.openstack.org/openstack/refstack-client'].src_dir }}" | ||
tempestconf_src_relative_path: "{{ zuul.projects['git.openstack.org/openstack/python-tempestconf'].src_dir }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters