blob: d1fad900a4b9b07764f1d1241d8799f0c755509b [file] [log] [blame]
Martin Kopecf62dbc12019-12-12 00:20:41 +00001Tempest cleanup
2===============
3
4Documentation regarding tempest cleanup can be found at the following
5link:
6https://docs.openstack.org/tempest/latest/cleanup.html
7
8When init_saved_state and dry_run variables are set to false, the role
9execution will run tempest cleanup which deletes resources not present in the
10saved_state.json file.
11
12**Role Variables**
13
14.. zuul:rolevar:: devstack_base_dir
15 :default: /opt/stack
16
17 The devstack base directory.
18
19.. zuul:rolevar:: init_saved_state
20 :default: false
21
22 When true, tempest cleanup --init-saved-state will be executed which
23 initializes the saved state of the OpenStack deployment and will output
24 a saved_state.json file containing resources from the deployment that will
25 be preserved from the cleanup command. This should be done prior to running
26 Tempest tests.
27
28.. zuul:rolevar:: dry_run
29 :default: false
30
31 When true, tempest cleanup creates a report (./dry_run.json) of the
32 resources that would be cleaned up if the role was ran with dry_run option
33 set to false.
Martin Kopec05c35eb2020-08-12 09:17:35 +000034
35.. zuul:rolevar:: run_tempest_fail_if_leaked_resources
36 :default: false
37
38 When true, the role will fail if any leaked resources are detected.
39 The detection is done via dry_run.json file which if contains any resources,
40 some must have been leaked. This can be also used to verify that tempest
41 cleanup was successful.
42
43
44Role usage
45----------
46
47The role can be also used for verification that tempest tests don't leak any
48resources or to test that 'tempest cleanup' command deleted all leaked
49resources as expected.
50Either way the role needs to be run first with init_saved_state variable set
51to true prior any tempest tests got executed.
52Then, after tempest tests got executed this role needs to be run again with
53role variables set according to the desired outcome:
54
551. to verify that tempest tests don't leak any resources
56 run_tempest_dry_cleanup and run_tempest_fail_if_leaked_resources have to
57 be set to true.
58
592. to check that 'tempest cleanup' command deleted all the leaked resources
60 run_tempest_cleanup and run_tempest_fail_if_leaked_resources have to be set
61 to true.