Skip to content

Commit

Permalink
centos-6: configuration test fix workaround (#550)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
gut authored and adjackura committed Sep 24, 2018
1 parent 1f39a38 commit 350bfba
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions image_test/configuration/linux/generic_distro.py
Expand Up @@ -14,6 +14,7 @@
# limitations under the License.

import abc
import time

import utils

Expand Down Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand All @@ -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)

0 comments on commit 350bfba

Please sign in to comment.