Use the new ansible roles for DevStack CI jobs
- Test cases are being installed on /opt/stack/tobiko as the folder is used for DevStack plugin - DevStack plugin generate /etc/tobiko/tobiko.conf file - Tobiko roles use zuul user on test host - Test cases get conf from both configuration files: * /etc/tobiko/tobiko.conf (generated by DevStack plugin) * /opt/stack/tobiko/tobiko.conf (generated by tobiko-configure role) - Tobiko roles are now in charge of managing files recollection therefore log file is no more required to be written into DevStack logs folder Change-Id: If9bc702c3b97764a7ed81e074b407e2f336a6fbf
This commit is contained in:
parent
c9e233f23f
commit
b696f70b21
@ -2,9 +2,7 @@
|
|||||||
TOBIKO_PLUGIN_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
TOBIKO_PLUGIN_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
|
||||||
|
|
||||||
function install_tobiko {
|
function install_tobiko_deps {
|
||||||
echo_summary "Installing tobiko-plugin"
|
|
||||||
|
|
||||||
if [ "${TOBIKO_BINDEP}" != "" ]; then
|
if [ "${TOBIKO_BINDEP}" != "" ]; then
|
||||||
install_python3
|
install_python3
|
||||||
install_bindep "${TOBIKO_DIR}/bindep.txt" test
|
install_bindep "${TOBIKO_DIR}/bindep.txt" test
|
||||||
@ -163,9 +161,11 @@ function iniset_nonempty {
|
|||||||
if [[ "$1" == "stack" ]]; then
|
if [[ "$1" == "stack" ]]; then
|
||||||
case "$2" in
|
case "$2" in
|
||||||
install)
|
install)
|
||||||
install_tobiko
|
echo_summary "Installing Tobiko dependencies"
|
||||||
|
install_tobiko_deps
|
||||||
;;
|
;;
|
||||||
test-config)
|
test-config)
|
||||||
|
echo_summary "Configuring Tobiko test cases"
|
||||||
configure_tobiko
|
configure_tobiko
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
define_plugin tobiko
|
||||||
|
plugin_requires tobiko heat
|
||||||
|
|
||||||
# --- General settings ----
|
# --- General settings ----
|
||||||
TOBIKO_REPO=${TOBIKO_REPO:-${GIT_BASE}/x/tobiko.git}
|
TOBIKO_REPO=${TOBIKO_REPO:-${GIT_BASE}/x/tobiko.git}
|
||||||
|
@ -1,31 +1,6 @@
|
|||||||
# Copyright 2018 Red Hat
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
# not use this file except in compliance with the License. You may obtain
|
|
||||||
# a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
# License for the specific language governing permissions and limitations
|
|
||||||
# under the License.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
- hosts: tempest
|
- hosts: tempest
|
||||||
roles:
|
roles:
|
||||||
- role: tobiko
|
- tobiko-zuul
|
||||||
tags:
|
- tobiko-post-run
|
||||||
- tobiko-post-run
|
|
||||||
vars:
|
|
||||||
tobiko_pre_run: false
|
|
||||||
tobiko_run: false
|
|
||||||
tobiko_post_run: true
|
|
||||||
|
|
||||||
|
|
||||||
- hosts: tempest
|
|
||||||
become: true
|
|
||||||
roles:
|
|
||||||
- role: process-stackviz
|
|
||||||
|
@ -1,58 +1,17 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
# devstack copies repos from hardcoded list of organizations only and performa
|
- hosts: tempest
|
||||||
# is not there so e.g. os-faults repo can't be copied there easily and we need
|
roles:
|
||||||
# to do this on our own
|
- tobiko-zuul
|
||||||
# copied from https://opendev.org/openstack/devstack/src/branch/master/roles/setup-devstack-source-dirs/tasks/main.yaml
|
- tobiko-pre-run
|
||||||
|
|
||||||
- hosts: all
|
|
||||||
tasks:
|
|
||||||
- name: Find source repos from performa organization
|
|
||||||
find:
|
|
||||||
paths:
|
|
||||||
- src/opendev.org/performa
|
|
||||||
file_type: directory
|
|
||||||
register: found_repos
|
|
||||||
|
|
||||||
- name: Copy Zuul repos into devstack working directory
|
|
||||||
synchronize:
|
|
||||||
src: "{{ item.path }}"
|
|
||||||
dest: /opt/stack
|
|
||||||
use_ssh_args: true
|
|
||||||
recursive: true
|
|
||||||
with_items: '{{ found_repos.files }}'
|
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: Set ownership of repos
|
|
||||||
file:
|
|
||||||
path: /opt/stack
|
|
||||||
state: directory
|
|
||||||
recurse: true
|
|
||||||
owner: stack
|
|
||||||
group: stack
|
|
||||||
become: yes
|
|
||||||
|
|
||||||
|
|
||||||
- hosts: all
|
- hosts: all
|
||||||
roles:
|
roles:
|
||||||
|
|
||||||
- role: bindep
|
|
||||||
|
|
||||||
- role: copy-build-sshkey
|
- role: copy-build-sshkey
|
||||||
copy_sshkey_target_user: stack
|
vars:
|
||||||
|
copy_sshkey_target_user: zuul
|
||||||
|
|
||||||
- role: multi-node-setup
|
- role: multi-node-setup
|
||||||
|
|
||||||
- role: orchestrate-devstack
|
- role: orchestrate-devstack
|
||||||
|
|
||||||
|
|
||||||
- hosts: tempest
|
|
||||||
roles:
|
|
||||||
|
|
||||||
- role: tobiko
|
|
||||||
tags:
|
|
||||||
- tobiko-pre-run
|
|
||||||
vars:
|
|
||||||
tobiko_pre_run: true
|
|
||||||
tobiko_run: false
|
|
||||||
tobiko_post_run: false
|
|
||||||
|
@ -16,8 +16,5 @@
|
|||||||
|
|
||||||
- hosts: tempest
|
- hosts: tempest
|
||||||
roles:
|
roles:
|
||||||
- role: tobiko
|
- tobiko-zuul
|
||||||
vars:
|
- tobiko-run
|
||||||
tobiko_pre_run: false
|
|
||||||
tobiko_run: true
|
|
||||||
tobiko_post_run: false
|
|
||||||
|
4
roles/tobiko-zuul/meta/main.yaml
Normal file
4
roles/tobiko-zuul/meta/main.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
- role: tobiko-common
|
10
roles/tobiko-zuul/vars/main.yaml
Normal file
10
roles/tobiko-zuul/vars/main.yaml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
tobiko_src_dir: "{{ zuul.executor.work_root }}/{{ zuul.projects['opendev.org/x/tobiko'].src_dir }}"
|
||||||
|
# tobiko_dir: '/opt/stack/tobiko'
|
||||||
|
tobiko_user: 'zuul'
|
||||||
|
# test_conf_file: '/etc/tobiko/tobiko.conf'
|
||||||
|
test_src_dir: '{{ zuul.executor.work_root }}/{{ zuul.project.src_dir }}'
|
||||||
|
test_dir: '{{ tobiko_dir }}'
|
||||||
|
test_user: 'zuul'
|
||||||
|
test_collect_dir: '{{ zuul.executor.log_root }}'
|
@ -60,19 +60,15 @@
|
|||||||
$NOVA_CONF:
|
$NOVA_CONF:
|
||||||
quota:
|
quota:
|
||||||
instances: 20
|
instances: 20
|
||||||
test_results_stage_name: test_results
|
|
||||||
zuul_copy_output:
|
zuul_copy_output:
|
||||||
'{{ devstack_log_dir }}/tobiko*.log': logs
|
|
||||||
'{{ stage_dir }}/stackviz': logs
|
'{{ stage_dir }}/stackviz': logs
|
||||||
extensions_to_txt:
|
extensions_to_txt:
|
||||||
conf: true
|
conf: true
|
||||||
log: true
|
log: true
|
||||||
yaml: true
|
yaml: true
|
||||||
yml: true
|
yml: true
|
||||||
tobiko_user: stack
|
tobiko_dir: '/opt/stack/tobiko'
|
||||||
tobiko_dir: /opt/stack/tobiko
|
test_src_dir: '{{ zuul.executor.work_root }}/{{ zuul.project.src_dir }}'
|
||||||
tobiko_log_file: /opt/stack/logs/tobiko.log
|
|
||||||
test_report_dir: /opt/stack/logs
|
|
||||||
|
|
||||||
pre-run: playbooks/devstack/pre.yaml
|
pre-run: playbooks/devstack/pre.yaml
|
||||||
run: playbooks/devstack/run.yaml
|
run: playbooks/devstack/run.yaml
|
||||||
@ -102,8 +98,6 @@
|
|||||||
- openstack/tripleo-image-elements
|
- openstack/tripleo-image-elements
|
||||||
timeout: 7800
|
timeout: 7800
|
||||||
vars:
|
vars:
|
||||||
devstack_plugins:
|
|
||||||
octavia: https://opendev.org/openstack/octavia
|
|
||||||
devstack_services:
|
devstack_services:
|
||||||
# Octavia
|
# Octavia
|
||||||
octavia: true
|
octavia: true
|
||||||
@ -134,7 +128,7 @@
|
|||||||
description: |
|
description: |
|
||||||
Base Tobiko devstack job to execute functional tests.
|
Base Tobiko devstack job to execute functional tests.
|
||||||
vars:
|
vars:
|
||||||
tox_envlist: functional
|
test_workflow: functional
|
||||||
irrelevant-files:
|
irrelevant-files:
|
||||||
- ^.*\.rst$
|
- ^.*\.rst$
|
||||||
- ^doc/
|
- ^doc/
|
||||||
@ -161,28 +155,9 @@
|
|||||||
|
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: tobiko-devstack-scenario
|
name: tobiko-devstack-multinode
|
||||||
parent: tobiko-devstack
|
parent: tobiko-devstack
|
||||||
abstract: true
|
abstract: true
|
||||||
description: |
|
|
||||||
Integration test that runs all tests against DevStack provided cloud
|
|
||||||
vars:
|
|
||||||
tox_envlist: scenario
|
|
||||||
irrelevant-files:
|
|
||||||
- ^.*\.rst$
|
|
||||||
- ^doc/
|
|
||||||
- ^infrared/
|
|
||||||
- ^releasenotes/
|
|
||||||
- ^report/
|
|
||||||
- ^tobiko/tests/faults/
|
|
||||||
- ^tobiko/tests/functional/
|
|
||||||
- ^tobiko/tests/unit/
|
|
||||||
|
|
||||||
|
|
||||||
- job:
|
|
||||||
name: tobiko-devstack-scenario-multinode
|
|
||||||
parent: tobiko-devstack-scenario
|
|
||||||
abstract: true
|
|
||||||
description: Base Tobiko devstack job with multinode.
|
description: Base Tobiko devstack job with multinode.
|
||||||
vars:
|
vars:
|
||||||
topology: multinode
|
topology: multinode
|
||||||
@ -214,12 +189,12 @@
|
|||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: tobiko-devstack-faults
|
name: tobiko-devstack-faults
|
||||||
parent: tobiko-devstack-scenario-multinode
|
parent: tobiko-devstack-multinode
|
||||||
abstract: true
|
abstract: true
|
||||||
description: |
|
description: |
|
||||||
Base Tobiko devstack job to execute scenario+faults+scenario test cases.
|
Base Tobiko devstack job to execute scenario+faults+scenario test cases.
|
||||||
vars:
|
vars:
|
||||||
tobiko_run_faults: true
|
test_workflow: faults
|
||||||
irrelevant-files:
|
irrelevant-files:
|
||||||
- ^.*\.rst$
|
- ^.*\.rst$
|
||||||
- ^doc/
|
- ^doc/
|
Loading…
Reference in New Issue
Block a user