blob: c1d63f03ebc9e18c6d04e57892ae9b6f2244efd8 [file] [log] [blame]
Martin Kopecf62dbc12019-12-12 00:20:41 +00001- when: init_saved_state
2 block:
3 - name: Run tempest cleanup init-saved-state
4 become: yes
5 become_user: tempest
Martin Kopeca8578802020-04-07 08:19:14 +00006 command: tox -evenv-tempest -- tempest cleanup --init-saved-state --debug
Martin Kopecf62dbc12019-12-12 00:20:41 +00007 args:
8 chdir: "{{ devstack_base_dir }}/tempest"
9
10 - name: Cat saved_state.json
11 command: cat "{{ devstack_base_dir }}/tempest/saved_state.json"
12
13- when: dry_run
14 block:
Martin Kopec05c35eb2020-08-12 09:17:35 +000015 - import_tasks: dry_run.yaml
Martin Kopecf62dbc12019-12-12 00:20:41 +000016
17 - name: Cat dry_run.json
18 command: cat "{{ devstack_base_dir }}/tempest/dry_run.json"
19
Martin Kopec05c35eb2020-08-12 09:17:35 +000020- when:
21 - not dry_run
22 - not init_saved_state
23 block:
24 - name: Run tempest cleanup
25 become: yes
26 become_user: tempest
27 command: tox -evenv-tempest -- tempest cleanup --debug
28 args:
29 chdir: "{{ devstack_base_dir }}/tempest"
30
31- when:
32 - run_tempest_fail_if_leaked_resources
33 - not init_saved_state
34 block:
35 # let's run dry run again, if haven't already, to check no leftover
36 # resources were left behind after the cleanup in the previous task
37 - import_tasks: dry_run.yaml
38 when: not dry_run
39
40 - name: Fail if any resources are leaked
41 become: yes
42 become_user: tempest
43 shell: |
44 python3 roles/tempest-cleanup/tasks/dry_run_checker.py --file {{ devstack_base_dir }}/tempest/dry_run.json --is-empty
45 args:
46 chdir: "{{ devstack_base_dir }}/tempest"