Bläddra i källkod

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 år sedan
förälder
incheckning
c570dd05e2

+ 2
- 0
roles/validate-tempest/README.md Visa fil

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

+ 2
- 0
roles/validate-tempest/defaults/main.yml Visa fil

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

+ 5
- 0
roles/validate-tempest/tasks/tempest-results.yml Visa fil

@@ -6,6 +6,11 @@
6 6
         sudo chmod -R 777 {{ tempest_dir }}
7 7
       when: tempest_format == 'container'
8 8
 
9
+    - name: Change permission of tempest container log directory
10
+      shell: |
11
+        sudo chmod -R 777 /var/log/containers/tempest
12
+      when: tempest_format == 'container'
13
+
9 14
     - name: Generate testrepository.subunit results file
10 15
       shell: >
11 16
         set -o pipefail &&

+ 4
- 0
roles/validate-tempest/templates/configure-tempest.sh.j2 Visa fil

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

+ 1
- 0
roles/validate-tempest/templates/run-tempest.sh.j2 Visa fil

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

Laddar…
Avbryt
Spara