summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAndrew Yourtchenko <ayourtch@gmail.com>2019-10-21 12:55:48 +0000
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-10-29 09:52:42 +0000
commitf7b53e155a779a45ec0cf140bd5f4cb716fb551f (patch)
treef10ea39c51bffaede5885346db094c12670eb233 /test
parentaad7fa7d6f590ac05d483d78b010eed5b531bf97 (diff)
tests: add PID of VPP under test to API dump filename for the test
Some testclasses (e.g. IPSec) have methods with the same names, this causes a race when running in parallel to save the API and move it into the test's directory - the name of the file has only the test method name as a discriminator. Saving two traces from two VPP instances "succeeds", in that it silently overwrites the file. But only one mv operation works - the other gives an error "file not found" and fails the test. Solution: add the PID of VPP under test to the API dump filename, this way the filenames become guaranteed unique and the race is avoided. Change-Id: I1bb47ed73369fea0f1bfbf907588a51e2cabfb7f Type: test Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com> (cherry picked from commit 586d3edf49f5dd8cd3e4f836afd562e21766914d)
Diffstat (limited to 'test')
-rw-r--r--test/framework.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/framework.py b/test/framework.py
index fb1446572ee..bfd848c145c 100644
--- a/test/framework.py
+++ b/test/framework.py
@@ -682,7 +682,8 @@ class VppTestCase(unittest.TestCase):
self.show_commands_at_teardown()
self.registry.remove_vpp_config(self.logger)
# Save/Dump VPP api trace log
- api_trace = "vpp_api_trace.%s.log" % self._testMethodName
+ m = self._testMethodName
+ api_trace = "vpp_api_trace.%s.%d.log" % (m, self.vpp.pid)
tmp_api_trace = "/tmp/%s" % api_trace
vpp_api_trace_log = "%s/%s" % (self.tempdir, api_trace)
self.logger.info(self.vapi.ppcli("api trace save %s" % api_trace))