From 1b11ec7a047e0e0692f63565b6e697bf81f0dcef Mon Sep 17 00:00:00 2001 From: Federico Ressi Date: Fri, 23 Aug 2019 18:03:42 +0200 Subject: [PATCH] Check hostname without domain name. Change-Id: I5fd2fb27c392443360bcd5b3aaefec823b618ff8 --- tobiko/tests/functional/openstack/stacks/test_cirros.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tobiko/tests/functional/openstack/stacks/test_cirros.py b/tobiko/tests/functional/openstack/stacks/test_cirros.py index 34962d7de..2ac807f43 100644 --- a/tobiko/tests/functional/openstack/stacks/test_cirros.py +++ b/tobiko/tests/functional/openstack/stacks/test_cirros.py @@ -46,9 +46,10 @@ class CirrosServerStackTest(testtools.TestCase): """Test that hostname of instance server matches Nova server name""" self.stack.ssh_client.connect() - hostname, = sh.execute( - 'hostname', ssh_client=self.stack.ssh_client).stdout.splitlines() - self.assertEqual(hostname, self.stack.server_name) + stdout = sh.execute('hostname', + ssh_client=self.stack.ssh_client).stdout + hostname = stdout.strip().split('.', 1)[0] + self.assertEqual(self.stack.server_name, hostname) def test_console_output(self): # wait for server to be ready for connection