Add install command to IR plugin

* Allow users and CI pipelines to run tobiko install command
* Users can specify which environment to use

Also:

* Removed os-fault configuration generation - this is done
  by Tobiko itself
* Remove other unused tasks

Change-Id: Ieeba8d4094cb3764a2a2de99debbac3acd886180
changes/50/643750/8
abregman 4 years ago
parent 3ee4feee49
commit 641b627a7a

@ -0,0 +1,27 @@
---
- name: Install Tobiko
hosts: undercloud
any_errors_fatal: true
gather_facts: yes
tasks:
- name: Install required packages
become: yes
yum:
name: "{{ item }}"
state: present
with_items:
- 'python-virtualenv'
- 'git'
- name: Create Virtualenv
vars:
packages: ['pip', 'setuptools', 'pbr', 'tox']
pip:
virtualenv: "{{ test.venv }}"
name: "{{ packages }}"
state: latest
- name: Create virtual env for Tobiko test cases
shell: |
"source {{ test.venv }}/bin/activate"
"tox -e {{ test.environment }} --notest"

@ -1,11 +1,3 @@
- name: Install Tobiko
import_playbook: tasks/install.yml
- name: Set up os-faults configuration
import_playbook: tasks/configure.yml
- name: Run Tobiko
import_playbook: tasks/run.yml
when:
- test.tests is defined
- test.tests
---
- import_playbook: install.yml
when: test.install|default(False)

@ -4,12 +4,27 @@ config:
subparsers:
tobiko:
description: Tobiko Options
description: Executes Tobiko Framework
include_groups: ["Ansible options", "Inventory", "Common options", "Answers file"]
groups:
- title: Testing Parameters
- title: Stages Control
options:
tests:
install:
type: Bool
help: |
Install Tobiko
- title: Install Options
options:
env:
type: Value
help: |
The tox environment to use
dir:
type: Value
help: |
The directory where Tobiko will be installed and used
venv:
type: Value
default: '~/tobiko_venv'
help: |
Group of tests to execute
path of existing virtual environment

@ -1,12 +0,0 @@
---
- name: Generate os-faults configuration
hosts: undercloud
any_errors_fatal: true
gather_facts: yes
tasks:
- name: Create os-faults configuration file
template:
src: "templates/os-faults.yaml.j2"
dest: "~/os-faults.yaml"
mode: 0755

@ -1,37 +0,0 @@
---
- name: Install Tobiko
hosts: undercloud
any_errors_fatal: true
gather_facts: yes
tasks:
- name: Install required packages
become: yes
yum:
name: "{{ item }}"
state: present
with_items:
- 'python-virtualenv'
- 'git'
- name: Clone Tobiko project
git:
repo: 'https://github.com/rhos-infra/tobiko'
dest: "~/tobiko"
- name: Create Virtualenv
pip:
virtualenv: "~/tobiko_venv"
name: "{{ item }}"
state: latest
with_items:
- pip
- setuptools
- pbr
- name: Install Tobiko
pip:
chdir: "~/tobiko"
virtualenv: "~/tobiko_venv"
name: "."
editable: true

@ -1,11 +0,0 @@
---
- name: Run Tobiko
hosts: undercloud
any_errors_fatal: true
gather_facts: no
tasks:
- name: Run Tobiko Tests
shell: |
tobiko -e {{ test.tests }}

@ -1,35 +0,0 @@
cloud_management:
driver: universal
node_discover:
driver: node_list
args:
{% for host_name in groups.overcloud_nodes|sort %}
- fqdn: {{ host_name }}
ip: {{ hostvars[host_name]['ansible_host'] }}
auth:
username: heat-admin
private_key_file: /home/stack/.ssh/id_rsa
become: true
{% endfor %}
services:
openvswitch:
driver: system_service
args:
service_name: openvswitch
grep: openvswitch
containers:
neutron_ovs_agent:
driver: docker_container
args:
container_name: neutron_ovs_agent
neutron_metadata_agent:
driver: docker_container
args:
container_name: neutron_metadata_agent
neutron_api:
driver: docker_container
args:
container_name: neutron_api
Loading…
Cancel
Save