Add initial .zuul file, devstack and packstack job
* Create a structure for Zuul v3 jobs. * Add tempest job running on devstack and packstack environment. Depends-On: I6f19d2b8128fbb0f2034892a11127bce73d102f9 Change-Id: Id52e7e1c42e7e93bece7907b8f4b05e5bfa2a7f9
This commit is contained in:
parent
5fa5f9c51d
commit
3dfd9cebc9
|
@ -0,0 +1,54 @@
|
||||||
|
- project:
|
||||||
|
name: openstack/python-tempestconf
|
||||||
|
check:
|
||||||
|
jobs:
|
||||||
|
- python-tempestconf-tempest-devstack
|
||||||
|
- python-tempestconf-tempest-packstack
|
||||||
|
gate:
|
||||||
|
jobs:
|
||||||
|
- python-tempestconf-tempest-devstack
|
||||||
|
- python-tempestconf-tempest-packstack
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: python-tempestconf-tempest-devstack
|
||||||
|
parent: devstack
|
||||||
|
description: Tempest job for python-tempestconf on a devstack environment.
|
||||||
|
required-projects:
|
||||||
|
- openstack/python-tempestconf
|
||||||
|
- openstack/tempest
|
||||||
|
- openstack-dev/devstack
|
||||||
|
roles:
|
||||||
|
- zuul: openstack/python-tempestconf
|
||||||
|
- zuul: openstack/tempest
|
||||||
|
- zuul: openstack-dev/devstack
|
||||||
|
run: playbooks/python-tempestconf-tempest-devstack.yaml
|
||||||
|
vars:
|
||||||
|
devstack_services:
|
||||||
|
tempest: True
|
||||||
|
irrelevant-files:
|
||||||
|
- config_tempest/tests/.*$
|
||||||
|
- ^doc/.*$
|
||||||
|
- ^releasenotes/.*$
|
||||||
|
- ^.*\.rst$
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: python-tempestconf-tempest-packstack
|
||||||
|
parent: packstack-base
|
||||||
|
description: Tempest job for python-tempestconf on a packstack environment.
|
||||||
|
required-projects:
|
||||||
|
- openstack/packstack
|
||||||
|
- openstack/python-tempestconf
|
||||||
|
- openstack/tempest
|
||||||
|
roles:
|
||||||
|
- zuul: openstack/packstack
|
||||||
|
- zuul: openstack/python-tempestconf
|
||||||
|
- zuul: openstack/tempest
|
||||||
|
run: playbooks/python-tempestconf-tempest-packstack.yaml
|
||||||
|
vars:
|
||||||
|
scenario: scenario000
|
||||||
|
irrelevant-files:
|
||||||
|
- config_tempest/tests/.*$
|
||||||
|
- ^doc/.*$
|
||||||
|
- ^releasenotes/.*$
|
||||||
|
- ^.*\.rst$
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
- hosts: all
|
||||||
|
roles:
|
||||||
|
# roles are inherited from openstack/tempest project
|
||||||
|
# except of generate-tempestconf-file role
|
||||||
|
- run-devstack
|
||||||
|
|
||||||
|
- hosts: tempest
|
||||||
|
vars:
|
||||||
|
devstack_full_path: "{{ ansible_user_dir }}/{{ zuul._projects['git.openstack.org/openstack-dev/devstack'].src_dir }}/openrc"
|
||||||
|
# It's important that OS_AUTH_URL is in this format:
|
||||||
|
# <protocol>://<host>/identity/v3
|
||||||
|
# In some cases it can be only: <protocol>://<host>:5000
|
||||||
|
# https://github.com/openstack-dev/devstack/blob/2c9343e5db44fa7a41ca6924737331dd9088ef8f/openrc#L87-L89
|
||||||
|
# (mkopec) That would end up with an HTTP MaxRetryError to <host>:5000,
|
||||||
|
# therefor OS_AUTH_URL is defined manually
|
||||||
|
set_auth_url: "OS_AUTH_URL=$SERVICE_PROTOCOL://$SERVICE_HOST/identity/v3"
|
||||||
|
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 python-tempestconf
|
||||||
|
include_role:
|
||||||
|
name: generate-tempestconf-file
|
||||||
|
vars:
|
||||||
|
source_admin_credentials_commands: "source {{ devstack_full_path }} admin admin \ {{ set_auth_url }}"
|
||||||
|
source_demo_credentials_commands: "source {{ devstack_full_path }} demo demo \ {{ set_auth_url }}"
|
||||||
|
- name: Run Tempest Tests
|
||||||
|
include_role:
|
||||||
|
name: run-tempest
|
|
@ -0,0 +1,18 @@
|
||||||
|
- hosts: all
|
||||||
|
roles:
|
||||||
|
# packstack-integration-tempest role is inherited from
|
||||||
|
# openstack/tempest project
|
||||||
|
- name: Install packstack allinone
|
||||||
|
include_role:
|
||||||
|
name: packstack-integration-tempest
|
||||||
|
- name: Prepare keystone credentials generated by packstack
|
||||||
|
include_role:
|
||||||
|
name: copy-keystone-files
|
||||||
|
- name: Generate configuration file for python-tempestconf
|
||||||
|
include_role:
|
||||||
|
name: generate-tempestconf-file
|
||||||
|
vars:
|
||||||
|
source_admin_credentials_commands: "source {{ ansible_user_dir }}/keystone_admin"
|
||||||
|
source_demo_credentials_commands: "source {{ ansible_user_dir }}/keystone_demo"
|
||||||
|
- name: Run Tempest Tests
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
- name: Copy keystone files to home directory
|
||||||
|
copy:
|
||||||
|
src: /root/keystone_{{ item }}
|
||||||
|
dest: {{ ansible_user_dir }}/keystone_{{ admin }}
|
||||||
|
mode: 0644
|
||||||
|
with_items:
|
||||||
|
- admin
|
||||||
|
- demo
|
|
@ -0,0 +1,47 @@
|
||||||
|
Generate configuration file for tempest
|
||||||
|
|
||||||
|
Installs python-tempestconf cloned from git and generates tempest.conf which
|
||||||
|
is then copied to tempest directory.
|
||||||
|
|
||||||
|
**Role Variables**
|
||||||
|
|
||||||
|
.. zuul:rolevar:: devstack_cloud_admin
|
||||||
|
:type: string
|
||||||
|
|
||||||
|
Named cloud with admin user credentials.
|
||||||
|
|
||||||
|
.. zuul:rolevar:: devstack_cloud_demo
|
||||||
|
:type: string
|
||||||
|
|
||||||
|
Named cloud with demo user credentials.
|
||||||
|
|
||||||
|
.. zuul:rolevar:: virtualenvs
|
||||||
|
:type: dict
|
||||||
|
|
||||||
|
A dictionary of paths to virtual environments.
|
||||||
|
|
||||||
|
.. zuul:rolevar:: tempestconf
|
||||||
|
:default: ~/.virtualenvs/.tempestconf
|
||||||
|
|
||||||
|
The path to the virtual environment of python-tempestconf tool.
|
||||||
|
|
||||||
|
.. zuul:rolevar:: url_cirros_image
|
||||||
|
:type: string
|
||||||
|
|
||||||
|
A URL address of the cirros image.
|
||||||
|
|
||||||
|
.. zuul:rolevar:: devstack_src_relative_path
|
||||||
|
:type: string
|
||||||
|
|
||||||
|
A relative path to a devstack project which is by default cloned to the
|
||||||
|
Zuul home directory. Value of the variable is set in the role to that
|
||||||
|
default path. If needed, the variable can be overridden from the playbook
|
||||||
|
where the role is called.
|
||||||
|
|
||||||
|
.. zuul:rolevar:: tempestconf_src_relative_path
|
||||||
|
:type: string
|
||||||
|
|
||||||
|
A relative path to a python-tempestconf project which is by default cloned
|
||||||
|
to the Zuul home directory. Value of the variable is set in the role to
|
||||||
|
that default path. If needed, the variable can be overridden from the
|
||||||
|
playbook where the role is called.
|
|
@ -0,0 +1,5 @@
|
||||||
|
devstack_cloud_admin: "devstack-admin"
|
||||||
|
devstack_cloud_demo: "devstack"
|
||||||
|
virtualenvs:
|
||||||
|
tempestconf: ~/.virtualenvs/.tempestconf
|
||||||
|
url_cirros_image: "http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img"
|
|
@ -0,0 +1,90 @@
|
||||||
|
- block:
|
||||||
|
- debug:
|
||||||
|
var: source_admin_credentials_commands
|
||||||
|
|
||||||
|
- debug:
|
||||||
|
var: source_demo_credentials_commands
|
||||||
|
|
||||||
|
- name: Create python-tempestconf venv with latest pip, setuptools and pbr
|
||||||
|
pip:
|
||||||
|
virtualenv: "{{ virtualenvs.tempestconf }}"
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: latest
|
||||||
|
with_items:
|
||||||
|
- pip
|
||||||
|
- setuptools
|
||||||
|
- pbr
|
||||||
|
|
||||||
|
- name: Debug, list tempetsconf dir
|
||||||
|
shell: |
|
||||||
|
ls -all .
|
||||||
|
pwd
|
||||||
|
args:
|
||||||
|
chdir: "{{ tempestconf_src_relative_path }}"
|
||||||
|
|
||||||
|
- name: Install python-tempestconf
|
||||||
|
pip:
|
||||||
|
name: "."
|
||||||
|
virtualenv: "{{ virtualenvs.tempestconf }}"
|
||||||
|
chdir: "{{ tempestconf_src_relative_path }}"
|
||||||
|
|
||||||
|
- name: Generate tempest configuration file as admin user
|
||||||
|
shell: |
|
||||||
|
export PATH=$PATH:/usr/local/sbin:/usr/sbin
|
||||||
|
source {{ virtualenvs.tempestconf }}/bin/activate
|
||||||
|
{{ source_admin_credentials_commands }}
|
||||||
|
printenv
|
||||||
|
discover-tempest-config \
|
||||||
|
--debug \
|
||||||
|
-v \
|
||||||
|
--create \
|
||||||
|
identity.uri $OS_AUTH_URL \
|
||||||
|
identity.admin_password $OS_PASSWORD \
|
||||||
|
image.http_image {{ url_cirros_image }} \
|
||||||
|
object-storage.operator_role swiftoperator
|
||||||
|
register: admin_result
|
||||||
|
ignore_errors: True
|
||||||
|
args:
|
||||||
|
chdir: "{{ tempestconf_src_relative_path }}"
|
||||||
|
executable: /bin/bash
|
||||||
|
|
||||||
|
- name: Print tempest.conf generated as admin user
|
||||||
|
shell: |
|
||||||
|
cat {{ tempestconf_src_relative_path }}/etc/tempest.conf
|
||||||
|
ignore_errors: True
|
||||||
|
|
||||||
|
- name: Generate tempest configuration file as demo user
|
||||||
|
shell: |
|
||||||
|
export PATH=$PATH:/usr/local/sbin:/usr/sbin
|
||||||
|
source {{ virtualenvs.tempestconf }}/bin/activate
|
||||||
|
{{ source_demo_credentials_commands }}
|
||||||
|
printenv
|
||||||
|
discover-tempest-config \
|
||||||
|
--debug \
|
||||||
|
-v \
|
||||||
|
--create \
|
||||||
|
identity.uri $OS_AUTH_URL \
|
||||||
|
identity.admin_password $OS_PASSWORD \
|
||||||
|
image.http_image {{ url_cirros_image }} \
|
||||||
|
object-storage.operator_role swiftoperator
|
||||||
|
register: demo_result
|
||||||
|
ignore_errors: True
|
||||||
|
args:
|
||||||
|
chdir: "{{ tempestconf_src_relative_path }}"
|
||||||
|
executable: /bin/bash
|
||||||
|
|
||||||
|
- name: Print tempest.conf generated as demo user
|
||||||
|
shell: |
|
||||||
|
cat {{ tempestconf_src_relative_path }}/etc/tempest.conf
|
||||||
|
ignore_errors: True
|
||||||
|
|
||||||
|
- name: Fail if generation of tempest.conf failed as admin or demo user
|
||||||
|
fail: msg="Generation of tempest.conf FAILED"
|
||||||
|
when: admin_result.failed or demo_result.failed
|
||||||
|
|
||||||
|
- name: Copy tempest.conf to tempest directory
|
||||||
|
copy:
|
||||||
|
src: "{{ tempestconf_src_relative_path }}/etc/tempest.conf"
|
||||||
|
dest: "{{ ansible_user_dir }}/tempest/etc/tempest.conf"
|
||||||
|
vars:
|
||||||
|
tempestconf_src_relative_path: "{{ zuul._projects['git.openstack.org/openstack/python-tempestconf'].src_dir }}"
|
Loading…
Reference in New Issue