Commit 438d1332 authored by Julien Muchembled's avatar Julien Muchembled Committed by Klaus Wölfel

testnode: use smaller random string for the log directory

parent dbc82bf0
...@@ -811,7 +811,7 @@ shared = true ...@@ -811,7 +811,7 @@ shared = true
self.assertTrue(suite.suite_log_path.endswith('suite.log')) self.assertTrue(suite.suite_log_path.endswith('suite.log'))
m = re.match('.*\-(.*)\/suite.log', suite.suite_log_path) m = re.match('.*\-(.*)\/suite.log', suite.suite_log_path)
rand_part = m.groups()[0] rand_part = m.groups()[0]
self.assertEqual(len(rand_part), 32) self.assertEqual(len(rand_part), 10)
self.assertNotIn(rand_part, rand_part_set) self.assertNotIn(rand_part, rand_part_set)
rand_part_set.add(rand_part) rand_part_set.add(rand_part)
suite_log = open(suite.suite_log_path, 'r') suite_log = open(suite.suite_log_path, 'r')
......
...@@ -77,11 +77,11 @@ class NodeTestSuite(SlapOSInstance): ...@@ -77,11 +77,11 @@ class NodeTestSuite(SlapOSInstance):
vcs_repository['repository_path'] = repository_path vcs_repository['repository_path'] = repository_path
def createSuiteLog(self): def createSuiteLog(self):
# /srv/slapgrid/slappartXX/srv/var/log/testnode/az-mlksjfmlk234Sljssdflkj23KSdfslj/suite.log # /srv/slapgrid/slappartXX/srv/var/log/testnode/az-D27KqX7FxJ/suite.log
alphabets = string.digits + string.letters alphabets = string.digits + string.letters
while 1: while 1:
log_folder_name = '%s-%s' % (self.reference, log_folder_name = '%s-%s' % (self.reference,
''.join(random.choice(alphabets) for i in xrange(32))) ''.join(random.choice(alphabets) for i in xrange(10)))
log_folder_path = os.path.join(self.log_directory, log_folder_name) log_folder_path = os.path.join(self.log_directory, log_folder_name)
try: try:
os.makedirs(log_folder_path) os.makedirs(log_folder_path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment