Browse Source

Merge "Additional logging in functional tests"

tags/1.2.0
Zuul 1 week ago
parent
commit
366480da1a
2 changed files with 18 additions and 2 deletions
  1. 10
    2
      novajoin/tests/functional/test_enrollment.py
  2. 8
    0
      playbooks/functional/post.yaml

+ 10
- 2
novajoin/tests/functional/test_enrollment.py View File

@@ -167,6 +167,13 @@ class TestEnrollment(testtools.TestCase):
167 167
                 tries -= 1
168 168
             else:  # cloud-init script finished
169 169
                 break
170
+
171
+        # Save setup-ipa-client.log, to be collected by Zuul.
172
+        stdin, stdout, stderr = ssh.exec_command(
173
+            'cat /var/log/setup-ipa-client.log')
174
+        with open('/tmp/setup-ipa-client.log', 'w') as log:
175
+            log.write(stdout.read().decode("utf-8"))
176
+
170 177
         stdin, stdout, stderr = ssh.exec_command('id admin')
171 178
         self.assertRegex(
172 179
             'uid=\d+\(admin\) gid=\d+\(admins\) groups=\d+\(admins\)',
@@ -195,6 +202,9 @@ class TestEnrollment(testtools.TestCase):
195 202
     def test_enroll_server(self):
196 203
         self._create_server()
197 204
         self._associate_floating_ip()
205
+
206
+        self._check_ipa_client_install()
207
+
198 208
         self._check_ipa_client_created()
199 209
         self._check_ip_record_added()
200 210
         self._disassociate_floating_ip()
@@ -202,8 +212,6 @@ class TestEnrollment(testtools.TestCase):
202 212
         self._associate_floating_ip()
203 213
         self._check_ip_record_added()
204 214
 
205
-        self._check_ipa_client_install()
206
-
207 215
         self._check_server_compact_services(['http\\test1', 'http\\test2'])
208 216
 
209 217
         self._update_server_compact_service_new()

+ 8
- 0
playbooks/functional/post.yaml View File

@@ -31,3 +31,11 @@
31 31
         src: "/var/log/novajoin"
32 32
         verify_host: true
33 33
       failed_when: false
34
+
35
+    - name: Collect setup ipa client log
36
+      synchronize:
37
+        dest: "{{ zuul.executor.log_root }}"
38
+        mode: pull
39
+        src: "/tmp/setup-ipa-client.log"
40
+        verify_host: true
41
+      failed_when: false

Loading…
Cancel
Save