Add infrared plugin to tobiko
Work is based on Arie's initial IR-tobiko plugin, thanks ...:) Change-Id: I9dfa8a87e8ca8623d347b06e1818612ea66c5580
This commit is contained in:
parent
879293054b
commit
ede95b9b42
11
infrared/README.md
Normal file
11
infrared/README.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Tobiko
|
||||||
|
|
||||||
|
Tobiko InfraRed Plugin
|
||||||
|
|
||||||
|
Tobiko was created for testing OpenStack Upgrades.
|
||||||
|
You can find the official project right [here](https://github.com/openstack/tobiko)
|
||||||
|
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
infrared tobiko --tests neutron
|
@ -1,27 +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: 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,3 +1,16 @@
|
|||||||
---
|
- name: Tobiko Tests Main
|
||||||
- import_playbook: install.yml
|
hosts: undercloud
|
||||||
when: test.install|default(False)
|
gather_facts: yes
|
||||||
|
any_errors_fatal: yes
|
||||||
|
tasks:
|
||||||
|
|
||||||
|
- name: Install Tobiko
|
||||||
|
include_tasks: tasks/install.yml
|
||||||
|
|
||||||
|
- name: Set up environment configurations
|
||||||
|
include_tasks: tasks/configure.yml
|
||||||
|
|
||||||
|
- name: Run Tobiko
|
||||||
|
include_tasks: tasks/run.yml
|
||||||
|
when:
|
||||||
|
- test.tests is defined
|
||||||
|
34
infrared/tasks/configure.yml
Normal file
34
infrared/tasks/configure.yml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
- name: Create os-faults configuration file
|
||||||
|
template:
|
||||||
|
src: "templates/os-faults.yaml.j2"
|
||||||
|
dest: "~/os-faults.yaml"
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
|
- name: Set up Overcloud resources wget cirros img
|
||||||
|
shell: |
|
||||||
|
source "{{ test.overcloudrc }}"
|
||||||
|
wget -c http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img
|
||||||
|
|
||||||
|
- name: Set up Overcloud resources create cirros img
|
||||||
|
shell: |
|
||||||
|
source "{{ test.overcloudrc }}"
|
||||||
|
openstack image create cirros \
|
||||||
|
--file cirros-0.4.0-x86_64-disk.img \
|
||||||
|
--disk-format qcow2 \
|
||||||
|
--container-format bare \
|
||||||
|
--public
|
||||||
|
|
||||||
|
- name: Set up Overcloud resources create m.tiny flavor
|
||||||
|
shell: |
|
||||||
|
source "{{ test.overcloudrc }}"
|
||||||
|
openstack flavor create --vcpus 1 --ram 64 --disk 1 m1.tiny
|
||||||
|
|
||||||
|
- name: Set up Overcloud resources create ssh keys
|
||||||
|
shell: |
|
||||||
|
test -f ~/.ssh/id_rsa||ssh-keygen -f ~/.ssh/id_rsa -P ''
|
||||||
|
|
||||||
|
- name: Create tobiko configuration file
|
||||||
|
template:
|
||||||
|
src: "templates/tobiko.conf.j2"
|
||||||
|
dest: "{{ test.dir }}/tobiko.conf"
|
||||||
|
mode: 0755
|
33
infrared/tasks/install.yml
Normal file
33
infrared/tasks/install.yml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
- name: Install pip using get-pip.py
|
||||||
|
become: yes
|
||||||
|
shell: |
|
||||||
|
curl https://bootstrap.pypa.io/get-pip.py | python
|
||||||
|
|
||||||
|
- name: Install required packages
|
||||||
|
become: yes
|
||||||
|
vars:
|
||||||
|
required_packages: ['python-virtualenv', 'git', 'gcc', 'python-devel']
|
||||||
|
yum:
|
||||||
|
name: "{{ required_packages }}"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Clone Tobiko project
|
||||||
|
git:
|
||||||
|
repo: 'https://review.opendev.org/x/tobiko'
|
||||||
|
dest: "{{ test.dir }}"
|
||||||
|
|
||||||
|
- name: Create Virtualenv
|
||||||
|
vars:
|
||||||
|
packages: ['pip', 'setuptools', 'tox']
|
||||||
|
pip:
|
||||||
|
virtualenv: "{{ test.venv }}"
|
||||||
|
name: "{{ packages }}"
|
||||||
|
state: latest
|
||||||
|
|
||||||
|
- name: Install Tobiko
|
||||||
|
pip:
|
||||||
|
chdir: "{{ test.dir }}"
|
||||||
|
name: "."
|
||||||
|
virtualenv: "{{ test.venv }}"
|
||||||
|
editable: true
|
||||||
|
extra_args: "-c https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt -r {{ test.dir }}/requirements.txt"
|
6
infrared/tasks/run.yml
Normal file
6
infrared/tasks/run.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
- name: Run Tobiko Tests
|
||||||
|
shell: |
|
||||||
|
cd "{{ test.dir }}"
|
||||||
|
source "{{ test.overcloudrc }}"
|
||||||
|
source "{{ test.venv }}/bin/activate"
|
||||||
|
tox -e "{{ test.tests }}"
|
35
infrared/tasks/templates/os-faults.yaml.j2
Normal file
35
infrared/tasks/templates/os-faults.yaml.j2
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
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
|
10
infrared/tasks/templates/tobiko.conf.j2
Normal file
10
infrared/tasks/templates/tobiko.conf.j2
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
[DEFAULT]
|
||||||
|
debug = true
|
||||||
|
log_file = tobiko.log
|
||||||
|
log_dir = .
|
||||||
|
[nova]
|
||||||
|
image = cirros
|
||||||
|
flavor = m1.tiny
|
||||||
|
key_file=~/.ssh/id_rsa
|
||||||
|
[neutron]
|
||||||
|
floating_network = public
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
config:
|
config:
|
||||||
plugin_type: test
|
plugin_type: test
|
||||||
|
entry_point: ./infrared/main.yml
|
||||||
|
|
||||||
subparsers:
|
subparsers:
|
||||||
tobiko:
|
tobiko:
|
||||||
@ -15,16 +16,23 @@ subparsers:
|
|||||||
Install Tobiko
|
Install Tobiko
|
||||||
- title: Install Options
|
- title: Install Options
|
||||||
options:
|
options:
|
||||||
env:
|
|
||||||
type: Value
|
|
||||||
help: |
|
|
||||||
The tox environment to use
|
|
||||||
dir:
|
dir:
|
||||||
type: Value
|
type: Value
|
||||||
|
default: "{{ ansible_env.HOME }}/tobiko"
|
||||||
help: |
|
help: |
|
||||||
The directory where Tobiko will be installed and used
|
The directory where Tobiko will be installed and used
|
||||||
|
overcloudrc:
|
||||||
|
type: Value
|
||||||
|
default: "{{ ansible_env.HOME }}/overcloudrc"
|
||||||
|
help: |
|
||||||
|
The path to the overcloudrc file
|
||||||
venv:
|
venv:
|
||||||
type: Value
|
type: Value
|
||||||
default: '~/tobiko_venv'
|
default: "{{ ansible_env.HOME }}/tobiko_venv"
|
||||||
help: |
|
help: |
|
||||||
path of existing virtual environment
|
path of existing virtual environment
|
||||||
|
tests:
|
||||||
|
type: Value
|
||||||
|
help: |
|
||||||
|
The set of tests to execute
|
||||||
|
default: neutron
|
Loading…
x
Reference in New Issue
Block a user