summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandan Kumar <chkumar@redhat.com>2018-05-07 13:40:12 +0530
committerChandan Kumar <chkumar@redhat.com>2018-05-17 13:08:03 +0530
commitc570dd05e2da3ee24c115246c4213f20ae8f8f5d (patch)
treead0c5def29db8c036627d5c923672e87be199f70
parent0c319a9ce0ca01c036fb5150769f7e48009af6be (diff)
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
Notes
Notes (review): Verified-1: RDO Third Party CI <dmsimard+rdothirdparty@redhat.com> Code-Review+2: Sagi Shnaidman <sshnaidm@redhat.com> Code-Review+2: wes hayutin <weshayutin@gmail.com> Workflow+1: wes hayutin <weshayutin@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 21 May 2018 23:40:15 +0000 Reviewed-on: https://review.openstack.org/566526 Project: openstack/tripleo-quickstart-extras Branch: refs/heads/master
-rw-r--r--roles/validate-tempest/README.md2
-rw-r--r--roles/validate-tempest/defaults/main.yml2
-rw-r--r--roles/validate-tempest/tasks/tempest-results.yml5
-rw-r--r--roles/validate-tempest/templates/configure-tempest.sh.j24
-rw-r--r--roles/validate-tempest/templates/run-tempest.sh.j21
5 files changed, 14 insertions, 0 deletions
diff --git a/roles/validate-tempest/README.md b/roles/validate-tempest/README.md
index f6086b2..1516472 100644
--- a/roles/validate-tempest/README.md
+++ b/roles/validate-tempest/README.md
@@ -31,6 +31,8 @@ Role Variables
31* `tempestmail_config`: config.yaml - name of config file for tempestmail script 31* `tempestmail_config`: config.yaml - name of config file for tempestmail script
32* `tempestmail_log_server`: <string> - Server where the logs are saved 32* `tempestmail_log_server`: <string> - Server where the logs are saved
33* `tempest_track_resources`: true/false - whether to save the state of resources after tempest run (default: true) 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* `check_tempest_bugs`: true/false - Will check every bugzilla and launchpad bug in the yaml skip file 36* `check_tempest_bugs`: true/false - Will check every bugzilla and launchpad bug in the yaml skip file
35* `tempest_plugins`: list - List of openstack services tempest plugins to be 37* `tempest_plugins`: list - List of openstack services tempest plugins to be
36 installed 38 installed
diff --git a/roles/validate-tempest/defaults/main.yml b/roles/validate-tempest/defaults/main.yml
index 3822bd6..228d346 100644
--- a/roles/validate-tempest/defaults/main.yml
+++ b/roles/validate-tempest/defaults/main.yml
@@ -30,6 +30,8 @@ tempest_dir: "{{ working_dir }}/tempest"
30tempest_whitelist_file_src: "whitelist_file.j2" 30tempest_whitelist_file_src: "whitelist_file.j2"
31tempest_whitelist_file: "whitelist_file.conf" 31tempest_whitelist_file: "whitelist_file.conf"
32tempest_whitelist: [] 32tempest_whitelist: []
33tempest_log_dir: "/var/log/tempest"
34tempest_log_file: "tempest.log"
33tempest_plugins: >- 35tempest_plugins: >-
34 {% if release not in ['newton', 'ocata', 'pike'] -%} 36 {% if release not in ['newton', 'ocata', 'pike'] -%}
35 [ "python-keystone-tests-tempest", "python-neutron-tests-tempest" ] 37 [ "python-keystone-tests-tempest", "python-neutron-tests-tempest" ]
diff --git a/roles/validate-tempest/tasks/tempest-results.yml b/roles/validate-tempest/tasks/tempest-results.yml
index 9853e51..b97f5f3 100644
--- a/roles/validate-tempest/tasks/tempest-results.yml
+++ b/roles/validate-tempest/tasks/tempest-results.yml
@@ -6,6 +6,11 @@
6 sudo chmod -R 777 {{ tempest_dir }} 6 sudo chmod -R 777 {{ tempest_dir }}
7 when: tempest_format == 'container' 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 - name: Generate testrepository.subunit results file 14 - name: Generate testrepository.subunit results file
10 shell: > 15 shell: >
11 set -o pipefail && 16 set -o pipefail &&
diff --git a/roles/validate-tempest/templates/configure-tempest.sh.j2 b/roles/validate-tempest/templates/configure-tempest.sh.j2
index 2f95c31..6f85502 100644
--- a/roles/validate-tempest/templates/configure-tempest.sh.j2
+++ b/roles/validate-tempest/templates/configure-tempest.sh.j2
@@ -132,6 +132,10 @@ $TEMPESTCONF --out etc/tempest.conf \
132 {% endfor %} 132 {% endfor %}
133 {% endif %} 133 {% endif %}
134 --create \ 134 --create \
135 {% if tempest_format == 'container' %}
136 DEFAULT.log_dir {{ tempest_log_dir }} \
137 DEFAULT.log_file {{ tempest_log_file }} \
138 {% endif %}
135 {% if release in ['newton', 'ocata', 'pike'] %} 139 {% if release in ['newton', 'ocata', 'pike'] %}
136 identity.uri $OS_AUTH_URL \ 140 identity.uri $OS_AUTH_URL \
137 identity.admin_password $OS_PASSWORD \ 141 identity.admin_password $OS_PASSWORD \
diff --git a/roles/validate-tempest/templates/run-tempest.sh.j2 b/roles/validate-tempest/templates/run-tempest.sh.j2
index f027b49..769e412 100644
--- a/roles/validate-tempest/templates/run-tempest.sh.j2
+++ b/roles/validate-tempest/templates/run-tempest.sh.j2
@@ -48,6 +48,7 @@ sudo docker run -i -v $RCFILE:$RCFILE \
48 -v {{ working_dir }}/{{ tempest_whitelist_file }}:{{ working_dir }}/{{ tempest_whitelist_file }} \ 48 -v {{ working_dir }}/{{ tempest_whitelist_file }}:{{ working_dir }}/{{ tempest_whitelist_file }} \
49 -v {{ working_dir }}/{{ tempest_deployer_input_file }}:{{ working_dir }}/{{ tempest_deployer_input_file }} \ 49 -v {{ working_dir }}/{{ tempest_deployer_input_file }}:{{ working_dir }}/{{ tempest_deployer_input_file }} \
50 {% endif %} 50 {% endif %}
51 -v /var/log/containers/tempest:{{ tempest_log_dir }} \
51 -v {{ tempest_dir }}:{{ tempest_dir }} \ 52 -v {{ tempest_dir }}:{{ tempest_dir }} \
52 -v {{ working_dir }}/tempest_container.sh:{{ working_dir }}/tempest_container.sh \ 53 -v {{ working_dir }}/tempest_container.sh:{{ working_dir }}/tempest_container.sh \
53 {% if not 'http' in tempest_test_image_path %} 54 {% if not 'http' in tempest_test_image_path %}