Additional logging in functional tests
Print setup-ipa-client.log in case the enrollment test fails. Change-Id: I8980da9da9e9edfc95c58345bff7bde722677f81
This commit is contained in:
parent
938a999a02
commit
610e03d33b
@ -167,6 +167,13 @@ class TestEnrollment(testtools.TestCase):
|
||||
tries -= 1
|
||||
else: # cloud-init script finished
|
||||
break
|
||||
|
||||
# Save setup-ipa-client.log, to be collected by Zuul.
|
||||
stdin, stdout, stderr = ssh.exec_command(
|
||||
'cat /var/log/setup-ipa-client.log')
|
||||
with open('/tmp/setup-ipa-client.log', 'w') as log:
|
||||
log.write(stdout.read().decode("utf-8"))
|
||||
|
||||
stdin, stdout, stderr = ssh.exec_command('id admin')
|
||||
self.assertRegex(
|
||||
'uid=\d+\(admin\) gid=\d+\(admins\) groups=\d+\(admins\)',
|
||||
@ -195,6 +202,9 @@ class TestEnrollment(testtools.TestCase):
|
||||
def test_enroll_server(self):
|
||||
self._create_server()
|
||||
self._associate_floating_ip()
|
||||
|
||||
self._check_ipa_client_install()
|
||||
|
||||
self._check_ipa_client_created()
|
||||
self._check_ip_record_added()
|
||||
self._disassociate_floating_ip()
|
||||
@ -202,8 +212,6 @@ class TestEnrollment(testtools.TestCase):
|
||||
self._associate_floating_ip()
|
||||
self._check_ip_record_added()
|
||||
|
||||
self._check_ipa_client_install()
|
||||
|
||||
self._check_server_compact_services(['http\\test1', 'http\\test2'])
|
||||
|
||||
self._update_server_compact_service_new()
|
||||
|
@ -31,3 +31,11 @@
|
||||
src: "/var/log/novajoin"
|
||||
verify_host: true
|
||||
failed_when: false
|
||||
|
||||
- name: Collect setup ipa client log
|
||||
synchronize:
|
||||
dest: "{{ zuul.executor.log_root }}"
|
||||
mode: pull
|
||||
src: "/tmp/setup-ipa-client.log"
|
||||
verify_host: true
|
||||
failed_when: false
|
||||
|
Loading…
x
Reference in New Issue
Block a user