]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Rename dmesg files to a unique name
authorJouni Malinen <j@w1.fi>
Sat, 21 Feb 2015 14:06:57 +0000 (16:06 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 21 Feb 2015 14:07:53 +0000 (16:07 +0200)
This allows multiple dmesg files to be saved if a test case is executed
multiple times similarly to the other logfiles.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/run-tests.py

index b2aa85776757751212f121c92c325b2d5cc8a191..0cd404325a977e7fe427a7931f858424b5ac6fa3 100755 (executable)
@@ -142,6 +142,10 @@ class DataCollector(object):
             self._trace_cmd.wait()
         if self._dmesg:
             output = os.path.join(self._logdir, '%s.dmesg' % (self._testname, ))
+            num = 0
+            while os.path.exists(output):
+                output = os.path.join(self._logdir, '%s.dmesg-%d' % (self._testname, num))
+                num += 1
             subprocess.call(['dmesg', '-c'], stdout=open(output, 'w'))
 
 def rename_log(logdir, basename, testname, dev):