Commit 7f86ceb4 authored by Tycho Andersen's avatar Tycho Andersen Committed by Pavel Emelyanov

zdtm.py: don't fail tests if pids collide

It seems with the new zdtm.py that pids collide a lot more (perhaps because
everything is in its own pid namespace? not sure). In any case, this is
annoying as it prevents a second run of the tests from actually getting to
the test part.

So, let's try to move the old directory out of the way.
Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent a985500c
...@@ -469,6 +469,15 @@ class criu_cli: ...@@ -469,6 +469,15 @@ class criu_cli:
def set_test(self, test): def set_test(self, test):
self.__test = test self.__test = test
self.__dump_path = "dump/" + test.getname() + "/" + test.getpid() self.__dump_path = "dump/" + test.getname() + "/" + test.getpid()
if os.path.exists(self.__dump_path):
for i in xrange(100):
newpath = self.__dump_path + "." + str(i)
if not os.path.exists(newpath):
os.rename(self.__dump_path, newpath)
break
else:
raise test_fail_exc("couldn't find dump dir %s" % self.__dump_path)
os.makedirs(self.__dump_path) os.makedirs(self.__dump_path)
def cleanup(self): def cleanup(self):
......
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