Track the tempest resources before and after tempest run

* Run tempest cleanup --init-saved-state before running the tempest
  tests to save resources before tempest execution.
* Run tempest cleanup --dry-run to see what new resources got created
  after tempest run.
* use tempest_track_resources: true in defaults/main.yml to track
  tempest resources before and after tempest run

Change-Id: I9787950996055bb2ca6876b5f42048be55028675
This commit is contained in:
Chandan Kumar 2017-07-09 19:58:02 +05:30
parent 1024c3e5e1
commit 6bf001558e
4 changed files with 15 additions and 1 deletions

View File

@ -28,6 +28,7 @@ artcl_collect_list:
- /home/*/tempest/*.log
- /home/*/tempest/etc/*.conf
- /home/*/tempest/*.subunit
- /home/*/tempest/*.json
- /home/*/local_tht/
- /home/*/gating_repo.tar.gz
- /home/*/browbeat/ansible/bug_report.log

View File

@ -27,6 +27,7 @@ Role Variables
* `tempest_failing`: false/true - default is false, run only tests known to be failing
* `tempest_exit_on_failure`: true/false - whether to exit from role with tempest exit code (default: true)
* `tempestmail_config`: config.yaml - name of config file for tempestmail script
* `tempest_track_resources`: true/false - whether to save the state of resources after tempest run (default: true)
Skip tests file
---------------

View File

@ -35,3 +35,4 @@ tempest_version_dict: { 'mitaka': 'mitaka', 'newton': 'newton',
'ocata': '16.0.0', 'master': 'master'}
tempest_version: "{{ tempest_version_dict[release] }}"
tempestmail_config: config.yaml
tempest_track_resources: true

View File

@ -26,6 +26,12 @@ ostestr -l
## List tempest plugins
$TEMPESTCLI list-plugins
## Save the resources before running tempest tests
## It will create saved_state.json in tempest workspace.
{% if tempest_track_resources|bool %}
$TEMPESTCLI cleanup --init-saved-state
{% endif %}
( $OSTESTR '({{ test_regex }})' --no-pretty --subunit {% if skip_file_src != '' %}--blacklist_file={{ working_dir }}/{{ skip_file }}{% endif %}
{% if tempest_workers is defined %} --concurrency {{ tempest_workers }} {% endif %}
{% if tempest_isolated|bool %} --isolated {% endif %}
@ -34,5 +40,10 @@ $TEMPESTCLI list-plugins
{% if tempest_failing|bool %} --failing {% endif %}
) | tee >( $S2JXML ) | $SUBUNIT
### --stop_docs
## Check which all tenants would be modified in the tempest run
## It will create dry_run.json in tempest workspace.
{% if tempest_track_resources|bool %}
$TEMPESTCLI cleanup --dry-run
{% endif %}
### --stop_docs