blob: 7ef4928042493e5d1689eea42b6c9068323df590 [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"
Luigi Dino Tamagnone9052dfc2023-04-09 15:24:45 +000030 when: not run_tempest_cleanup_prefix
31
32 - name: Run tempest cleanup with tempest prefix
33 become: yes
34 become_user: tempest
35 command: tox -evenv-tempest -- tempest cleanup --debug --prefix tempest
36 args:
37 chdir: "{{ devstack_base_dir }}/tempest"
38 when: run_tempest_cleanup_prefix
Martin Kopec05c35eb2020-08-12 09:17:35 +000039
40- when:
41 - run_tempest_fail_if_leaked_resources
42 - not init_saved_state
43 block:
44 # let's run dry run again, if haven't already, to check no leftover
45 # resources were left behind after the cleanup in the previous task
46 - import_tasks: dry_run.yaml
47 when: not dry_run
48
49 - name: Fail if any resources are leaked
50 become: yes
51 become_user: tempest
52 shell: |
53 python3 roles/tempest-cleanup/tasks/dry_run_checker.py --file {{ devstack_base_dir }}/tempest/dry_run.json --is-empty
54 args:
55 chdir: "{{ devstack_base_dir }}/tempest"