Browse Source

Add ability to publish test artifacts

This patch adds ability to publish tests artifacts using ssh protocol.

Change-Id: Ieb29f647a0d05309be54b525966cf41a2718a953
Sergey Reshetnyak 2 years ago
parent
commit
1795ea6890
3 changed files with 31 additions and 0 deletions
  1. 8
    0
      service/files/defaults.yaml
  2. 20
    0
      service/files/run-tempest.sh.j2
  3. 3
    0
      service/files/tempest.conf.j2

+ 8
- 0
service/files/defaults.yaml View File

@@ -14,6 +14,14 @@ configs:
14 14
         ipv6_subnet_attributes: false
15 15
       object_storage_feature:
16 16
         discoverability: false
17
+      static:
18
+        host: localhost
19
+        path: static/
20
+        port: 22
21
+        private_key: ""
22
+        publish: false
23
+        site: http://localhost
24
+        username: jenkins
17 25
       volume:
18 26
         storage_protocol: ceph
19 27
 

+ 20
- 0
service/files/run-tempest.sh.j2 View File

@@ -2,6 +2,22 @@
2 2
 
3 3
 set -ex
4 4
 
5
+function publish_artifacts {
6
+    local path="{{ rally.tempest.static.path }}"
7
+    mkdir -p "${path}"
8
+
9
+    cp /var/lib/rally/tempest.log "${path}/tempest.log"
10
+    rally verify results --output-file "${path}/result.json"
11
+    rally verify results --html --output-file "${path}/result.html"
12
+    # TODO: add junit report
13
+
14
+    local private_key_path="private.key"
15
+    echo "{{ rally.tempest.static.private_key }}" > "${private_key_path}"
16
+    chmod 600 "${private_key_path}"
17
+    scp -i "${private_key_path}" "${path}" {{ rally.tempest.static.username }}@{{ rally.tempest.static.host }}:{{ rally.tempest.static.port }}:
18
+    echo "Artifacts are located to {{ rally.tempest.static.site }}/${path}"
19
+}
20
+
5 21
 # OS credentials
6 22
 export OS_AUTH_URL={{ address("keystone", keystone.admin_port, with_scheme=True) }}
7 23
 export OS_IDENTITY_API_VERSION=3
@@ -34,4 +50,8 @@ os_release="{{ rally.tempest.openstack_release }}"
34 50
 
35 51
 rally verify start --skip-list "/var/lib/rally/${os_release}-skip-list.list"
36 52
 
53
+{% if rally.tempest.static.publish %}
54
+publish_artifacts
55
+{% endif %}
56
+
37 57
 rally verify results | /var/lib/rally/check_status.py

+ 3
- 0
service/files/tempest.conf.j2 View File

@@ -1,3 +1,6 @@
1
+[DEFAULT]
2
+log_file = /var/lib/rally/tempest.log
3
+
1 4
 [compute]
2 5
 min_microversion = 2.1
3 6
 {% if rally.tempest.openstack_release == "mitaka" %}

Loading…
Cancel
Save