首页 > 技术文章 > [Tempest Doc] Post Tempest Run Cleanup Utility 译文

nuo0903 2019-08-07 17:50 原文

Post Tempest Run Cleanup Utility

运行清理模块

 
Utility for cleaning up environment after Tempest test run.
Tempest测试运行后清理环境的实用程序
 
Usage: tempest cleanup [--help] [OPTIONS]
 
If run with no arguments, tempest cleanup will query your OpenStack deployment and build a list of resources to delete and destroy them. This list will exclude the resources from saved_state.json and will include the configured admin account if the --delete-tempest-conf-objects flag is specified. By default the admin project is not deleted and the admin user specified in tempest.conf is never deleted.
 
如果在没有参数的情况下运行这个命令(tempest cleanup),tempest cleanup将查询您的OpenStack部署, 同时将构建一个资源列表,用以删除和销毁它们。 此列表将从saved_state.json中排除资源。如果指定了--delete-tempest-conf-objects标志,则此列表将包括已配置的管理员帐户。 默认情况下,不删除admin项目,并且永远不会删除tempest.conf中指定的admin用户。

Example Run

示例运行
 
Warning
If step 1 is skipped in the example below, the cleanup procedure may delete resources that existed in the cloud before the test run. This may cause an unwanted destruction of cloud resources, so use caution with this command.
Examples:
$ tempest cleanup --init-saved-state
$ # Actual running of Tempest tests
$ tempest cleanup
 
警告
如果在下面的示例中跳过了步骤1,则清理过程可能会删除测试运行之前云中存在的资源。这可能会导致云资源的意外破坏,因此请谨慎使用此命令。
 

Runtime Arguments

运行时参数
 
  • --init-saved-state: Initializes the saved state of the OpenStack deployment and will output a saved_state.json file containing resources from your deployment that will be preserved from the cleanup command. This should be done prior to running Tempest tests.
  • 初始化OpenStack部署过程中将保存的状态。这个过程将输出一个saved_state.json文件。这个文件将包含在部署过程中你希望保存的资源。在执行完 cleanup 命令后这些资源将被保存。该命令应在运行Tempest测试之前完成。
  • --delete-tempest-conf-objects: If option is present, then the command will delete the admin project in addition to the resources associated with them on clean up. If option is not present, the command will delete the resources associated with the Tempest and alternate Tempest users and projects but will not delete the projects themselves.
  • 如果存在此选项,这个命令将会删除admin项目。与此同时,还将清理与admin项目相关联的资源。如果此选项不存在,则此命令将删除 tempest 和 alter tempest 的使用者和项目相关联的资源,但不会删除项目本身。
  • --dry-run: Creates a report (./dry_run.json) of the projects that will be cleaned up (in the _projects_to_cleandictionary 1) and the global objects that will be removed (domains, flavors, images, roles, projects, and users). Once the cleanup command is executed (e.g. run without parameters), running it again with --dry-run should yield an empty report.
  • 执行 cleanup 命令时,附带此运行时参数,将产生一个报告(./dry_run.json)。项目中在_projects_to_clean dictionary中的资源都将被清理,同时全局变量也将被删除(domains, flavors, images, roles, projects, and users). 一旦cleanup命令执行过一次后(没有带任何运行时参数执行),再次执行cleanup命令,并带上运行时参数--dry-run,同时全,将得到一个空的dry_run.json报告。因为之前已经清理过一次资源,再次清理一遍自然是什么也得不到的。
  • --help: Print the help text for the command and parameters.
  • 打印出帮助文本,是其对应的命令和参数。
The _projects_to_clean dictionary in dry_run.json lists the projects that tempest cleanup will loop through to delete child objects, but the command will, by default, not delete the projects themselves. This may differ from the projects list as you can clean the Tempest and alternate Tempest users and projects but they will not be deleted unless the --delete-tempest-conf-objects flag is used to force their deletion.
 
在 dry_run.json文件中的 _projects_to_clean 字典中,将列出 ’tempest cleanup’ 命令中遍历删除的子对象,但该命令将在默认情况下,不删除该项目本身。这可能与 projects 列表不同,Tempest和备用Tempest用户和项目将不会被删除,除非强制执行 --delete-tempest-conf-objects 运行时参数。
 
 

推荐阅读