From 350bfbaafbffe7d613e39df5d3dd95e4ac9bcdc0 Mon Sep 17 00:00:00 2001 From: Gustavo Serra Scalet Date: Mon, 24 Sep 2018 13:16:07 -0300 Subject: [PATCH] centos-6: configuration test fix workaround (#550) I noticed that there was an overload off the log output due to tracing and adding some sleeps when I noticed that the log froze helped to avoid this issue. Note: Still missing a solution to kernel messages not being printed on /dev/console (rsyslog test) --- image_test/configuration/linux/generic_distro.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/image_test/configuration/linux/generic_distro.py b/image_test/configuration/linux/generic_distro.py index 968d651cc..16c8415f0 100644 --- a/image_test/configuration/linux/generic_distro.py +++ b/image_test/configuration/linux/generic_distro.py @@ -14,6 +14,7 @@ # limitations under the License. import abc +import time import utils @@ -132,8 +133,11 @@ def TestRsyslogConfig(self): ['kern.info', 'RsyslogKernelConsoleTest'], ['daemon.info', 'RsyslogDaemonConsoleTest'], ] + # Avoid log output overload on centos-6 + time.sleep(0.1) for facility in info: utils.Execute(['logger', '-p'] + facility) + time.sleep(0.1) def TestRootPasswordDisabled(self): """ @@ -163,6 +167,8 @@ def TestSshdConfig(self): def ParseSshdConfig(path): configs = {} with open(path) as f: + # Avoid log output overload on centos-6 + time.sleep(0.1) for line in filter(RemoveCommentAndStrip, f.read().split('\n')): if line: # use line separator for key and # values @@ -285,6 +291,8 @@ def CheckSecurityParameter(key, desired_value): sysctl_configs = self.GetSysctlConfigs() for config in sysctl_configs: + # Avoid log output overload on centos-6 + time.sleep(0.1) CheckSecurityParameter(config, sysctl_configs[config]) def TestGcloudUpToDate(self): @@ -304,6 +312,12 @@ def TestGcloudUpToDate(self): return raise e + # Avoid log output overload on centos-6 + time.sleep(1) # now test if their API are still valid utils.Execute(['gcloud', 'compute', 'images', 'list']) + + # Avoid log output overload on centos-6 + time.sleep(1) utils.Execute(['gsutil', 'ls']) + time.sleep(1)