Add new flag cleanup-heat-stacks to the infrared plugin
When this flag is set, the heat stacks created by tobiko are deleted at the end of the tobiko infrared execution Additionally, the images created by tobiko are also removed from glance Change-Id: I3415a7fd73f02e47cf4a0c3351d90db3f7614fef
This commit is contained in:
parent
632ce945da
commit
454a63f4e6
@ -193,6 +193,13 @@ subparsers:
|
|||||||
help: Ignore test execution errors
|
help: Ignore test execution errors
|
||||||
ansible_variable: ignore_test_failures
|
ansible_variable: ignore_test_failures
|
||||||
|
|
||||||
|
- title: Cleanup stage
|
||||||
|
options:
|
||||||
|
cleanup-heat-stacks:
|
||||||
|
type: Flag
|
||||||
|
help: Cleanup heat stacks created by tobiko
|
||||||
|
ansible_variable: stacks_cleanup
|
||||||
|
|
||||||
- title: Collect stage
|
- title: Collect stage
|
||||||
options:
|
options:
|
||||||
collect-dir:
|
collect-dir:
|
||||||
|
@ -5,3 +5,4 @@ tobiko_git_refspec: ''
|
|||||||
test_git_refspec: ''
|
test_git_refspec: ''
|
||||||
tobiko_git_remote: ''
|
tobiko_git_remote: ''
|
||||||
test_git_remote: ''
|
test_git_remote: ''
|
||||||
|
stacks_cleanup: false
|
||||||
|
@ -43,6 +43,10 @@
|
|||||||
include_role: name=tobiko-run
|
include_role: name=tobiko-run
|
||||||
|
|
||||||
rescue:
|
rescue:
|
||||||
|
- name: "clean up heat stacks generated during tobiko tests"
|
||||||
|
include_role: name=tobiko-cleanup
|
||||||
|
when: stacks_cleanup
|
||||||
|
|
||||||
- name: "finalize test execution"
|
- name: "finalize test execution"
|
||||||
include_role: name=tobiko-collect
|
include_role: name=tobiko-collect
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
@ -51,6 +55,10 @@
|
|||||||
msg: 'TEST EXECUTION FAILED'
|
msg: 'TEST EXECUTION FAILED'
|
||||||
|
|
||||||
|
|
||||||
|
- name: "clean up heat stacks generated during tobiko tests"
|
||||||
|
include_role: name=tobiko-cleanup
|
||||||
|
when: stacks_cleanup
|
||||||
|
|
||||||
- name: "finalize test execution"
|
- name: "finalize test execution"
|
||||||
include_role: name=tobiko-collect
|
include_role: name=tobiko-collect
|
||||||
|
|
||||||
|
4
roles/tobiko-cleanup/defaults/main.yaml
Normal file
4
roles/tobiko-cleanup/defaults/main.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
# OpenStack client credentials
|
||||||
|
stackrc_file: '{{ ansible_user_dir }}/overcloudrc'
|
8
roles/tobiko-cleanup/tasks/main.yaml
Normal file
8
roles/tobiko-cleanup/tasks/main.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: "cleanup stacks created by tobiko tests"
|
||||||
|
shell: |
|
||||||
|
source {{ stackrc_file }}
|
||||||
|
openstack stack list -f value -c 'Stack Name' | grep "^tobiko\." | xargs openstack stack delete --wait
|
||||||
|
openstack image list -f value -c Name | grep "^tobiko\." | xargs openstack image delete
|
||||||
|
ignore_errors: yes
|
Loading…
Reference in New Issue
Block a user