Chapter 4. Cleaning Integration Test Suite (tempest) resources

Before you validate your deployments by using OpenStack Integration Test Suite (tempest), run the cleanup command with the --init-saved-state flag. This command scans your environment to discover resources, for example networks, volumes, images, flavors, projects, and users. The discovered resources are saved in a file called saved_state.json. When the tempest cleanup command is executed all resources not recorded in the saved_state.json file are deleted.


  • An OpenStack environment that contains the Integration Test Suite packages. For more information, see Installing the Integration Test Suite with director.
  • An Integration Test Suite configuration that corresponds to your OpenStack environment. For more information, see Creating a workspace.
  • One or more completed Integration Test Suite validation tests.

4.1. Performing a dry run

Perform a dry run before you execute the cleanup. A dry run lists the files that Integration Test Suite would delete by a cleanup, without actually deleting any files. The dry_run.json file contains the list of files that a cleanup deletes.


  1. Complete the dry run:

    # tempest cleanup --dry-run
  2. Review the dry_run.json file to ensure that the cleanup does not delete any files that you require for your environment.

4.2. Performing a tempest clean up

Before you run any tempest tests, you must initialize the saved state. This creates the file saved_state.json, which prevents the cleanup from deleting objects that must be kept.


If you do not run the cleanup command with the --init-saved-state flag, RHOSP objects are deleted.

If you create objects after running the cleanup command with --init-saved-state, those objects can be deleted by subsequent tempest commands.


  1. Initialize the saved state to create the saved_state.json file:

    # tempest cleanup --init-saved-state
  2. Perform the cleanup:

    # tempest cleanup

The tempest cleanup command deletes tempest resources but does not delete projects or the tempest administrator account.


You can modify the saved_state.json file to include or exclude objects that you want to retain or remove.