Browse Source

Enable tempest.log in /var/log/tempest for container

* In CI, when tempest container is used, It is good to dump the
  logs in /var/log/tempest so that it would be easier to verify
  tempest container is used.
* Introduced tempest_log_dir and tempest_log_file var to the
  validate-tempest-playbook

Depends-On: https://review.openstack.org/#/c/566364/

Change-Id: Ifd72d902c623b3941a6c714e36b7cf104109a570
tags/2.1.1
Chandan Kumar 1 year ago
parent
commit
c570dd05e2
5 changed files with 14 additions and 0 deletions
  1. +2
    -0
      roles/validate-tempest/README.md
  2. +2
    -0
      roles/validate-tempest/defaults/main.yml
  3. +5
    -0
      roles/validate-tempest/tasks/tempest-results.yml
  4. +4
    -0
      roles/validate-tempest/templates/configure-tempest.sh.j2
  5. +1
    -0
      roles/validate-tempest/templates/run-tempest.sh.j2

+ 2
- 0
roles/validate-tempest/README.md View File

@@ -31,6 +31,8 @@ Role Variables
* `tempestmail_config`: config.yaml - name of config file for tempestmail script
* `tempestmail_log_server`: <string> - Server where the logs are saved
* `tempest_track_resources`: true/false - whether to save the state of resources after tempest run (default: true)
* `tempest_log_dir`: <directory path> - The directory path where tempest log file is stored (default: /var/log/tempest)
* `tempest_log_file`: <file name> - The name of tempest log file (default: tempest.log)
* `check_tempest_bugs`: true/false - Will check every bugzilla and launchpad bug in the yaml skip file
* `tempest_plugins`: list - List of openstack services tempest plugins to be
installed

+ 2
- 0
roles/validate-tempest/defaults/main.yml View File

@@ -30,6 +30,8 @@ tempest_dir: "{{ working_dir }}/tempest"
tempest_whitelist_file_src: "whitelist_file.j2"
tempest_whitelist_file: "whitelist_file.conf"
tempest_whitelist: []
tempest_log_dir: "/var/log/tempest"
tempest_log_file: "tempest.log"
tempest_plugins: >-
{% if release not in ['newton', 'ocata', 'pike'] -%}
[ "python-keystone-tests-tempest", "python-neutron-tests-tempest" ]

+ 5
- 0
roles/validate-tempest/tasks/tempest-results.yml View File

@@ -6,6 +6,11 @@
sudo chmod -R 777 {{ tempest_dir }}
when: tempest_format == 'container'

- name: Change permission of tempest container log directory
shell: |
sudo chmod -R 777 /var/log/containers/tempest
when: tempest_format == 'container'

- name: Generate testrepository.subunit results file
shell: >
set -o pipefail &&

+ 4
- 0
roles/validate-tempest/templates/configure-tempest.sh.j2 View File

@@ -132,6 +132,10 @@ $TEMPESTCONF --out etc/tempest.conf \
{% endfor %}
{% endif %}
--create \
{% if tempest_format == 'container' %}
DEFAULT.log_dir {{ tempest_log_dir }} \
DEFAULT.log_file {{ tempest_log_file }} \
{% endif %}
{% if release in ['newton', 'ocata', 'pike'] %}
identity.uri $OS_AUTH_URL \
identity.admin_password $OS_PASSWORD \

+ 1
- 0
roles/validate-tempest/templates/run-tempest.sh.j2 View File

@@ -48,6 +48,7 @@ sudo docker run -i -v $RCFILE:$RCFILE \
-v {{ working_dir }}/{{ tempest_whitelist_file }}:{{ working_dir }}/{{ tempest_whitelist_file }} \
-v {{ working_dir }}/{{ tempest_deployer_input_file }}:{{ working_dir }}/{{ tempest_deployer_input_file }} \
{% endif %}
-v /var/log/containers/tempest:{{ tempest_log_dir }} \
-v {{ tempest_dir }}:{{ tempest_dir }} \
-v {{ working_dir }}/tempest_container.sh:{{ working_dir }}/tempest_container.sh \
{% if not 'http' in tempest_test_image_path %}

Loading…
Cancel
Save