zdtm/cgroup_yard: create a test cgroup yard from the post-start hook

Submitted by Andrei Vagin on Sept. 19, 2019, 8:37 p.m.

Details

Message ID 20190919203757.2761-1-avagin@gmail.com
State New
Series "zdtm/cgroup_yard: create a test cgroup yard from the post-start hook"
Headers show

Commit Message

Andrei Vagin Sept. 19, 2019, 8:37 p.m.
Right now, it is created from the pre-dump hook, but
if the --snap option is set, the test fails:
$ python test/zdtm.py run -t zdtm/static/cgroup_yard -f h --snap --iter 3
...
Running zdtm/static/cgroup_yard.hook(--pre-dump)
Traceback (most recent call last):
  File zdtm/static/cgroup_yard.hook, line 14, in <module>
    os.mkdir(yard)
OSError: [Errno 17] File exists: 'external_yard'

Cc: Michał Cłapiński <mclapinski@google.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
---
 test/zdtm/static/cgroup_yard.hook | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/test/zdtm/static/cgroup_yard.hook b/test/zdtm/static/cgroup_yard.hook
index cc3971707..072b9d38d 100755
--- a/test/zdtm/static/cgroup_yard.hook
+++ b/test/zdtm/static/cgroup_yard.hook
@@ -7,7 +7,7 @@  import tempfile
 
 yard = "external_yard"
 
-if sys.argv[1] == "--pre-dump":
+if sys.argv[1] == "--post-start":
 	'''
 	Create external cgroup yard to be passed to CRIU via --cgroup-yard
 	'''