From 15140ee2547f62cc10f1c0e2de15ecfebc60f8a2 Mon Sep 17 00:00:00 2001 From: zhufl Date: Wed, 25 Jul 2018 16:26:21 +0800 Subject: [PATCH] Use a smaller number for checking console log length Not all images can return console log longer than 10 lines, e.g., Red Hat Enterprise Linux Server 7.0 will return console log with 5 lines. We don't know how many console log lines should an image return, but generally speaking it's safer to use a smaller number so that Tempest can be used for images other than cirros. Change-Id: I7f6ffe5bdc6b7992fe15935d4f8498e8acf59453 Closes-Bug: #1783509 --- tempest/api/compute/servers/test_server_actions.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py index 350e8baf88..ca10e08797 100644 --- a/tempest/api/compute/servers/test_server_actions.py +++ b/tempest/api/compute/servers/test_server_actions.py @@ -527,10 +527,10 @@ class ServerActionsTestJSON(base.BaseV2ComputeTest): def _get_output(self): output = self.client.get_console_output( - self.server_id, length=10)['output'] + self.server_id, length=3)['output'] self.assertTrue(output, "Console output was empty.") lines = len(output.split('\n')) - self.assertEqual(lines, 10) + self.assertEqual(lines, 3) @decorators.idempotent_id('4b8867e6-fffa-4d54-b1d1-6fdda57be2f3') @testtools.skipUnless(CONF.compute_feature_enabled.console_output, @@ -561,8 +561,8 @@ class ServerActionsTestJSON(base.BaseV2ComputeTest): # NOTE: This test tries to get full length console log, and the # length should be bigger than the one of test_get_console_output. - self.assertGreater(lines, 10, "Cannot get enough console log " - "length. (lines: %s)" % lines) + self.assertGreater(lines, 3, "Cannot get enough console log " + "length. (lines: %s)" % lines) self.wait_for(_check_full_length_console_log)