From: Jouni Malinen Date: Sat, 21 Feb 2015 14:06:57 +0000 (+0200) Subject: tests: Rename dmesg files to a unique name X-Git-Tag: hostap_2_4~101 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cfb5576d9343a1b0605e0a3024d3194daa74ed9e;p=thirdparty%2Fhostap.git tests: Rename dmesg files to a unique name 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 --- diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py index b2aa85776..0cd404325 100755 --- a/tests/hwsim/run-tests.py +++ b/tests/hwsim/run-tests.py @@ -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):