[CRIU] skip() does not work in zdtm tests

Filipe Brandenburger filbranden at google.com
Mon Jun 23 23:18:04 PDT 2014


Hi Andrew,

I've been looking at conditionally skipping a zdtm test. I noticed
there's a skip() macro that logs a SKIP: ... message but I tried that
with an exit 0 and that doesn't really seem to work...

I wrote a short proof of concept (attached) and tried it. Without
skipping the test, everything works as expected:

$ sudo test/zdtm.sh ns/static/skiptest
Execute zdtm/live/static/skiptest
./skiptest --pidfile=skiptest.pid --outfile=skiptest.out
  PID TTY          TIME CMD
13953 ?        00:00:00 skiptest
Dump 13953
Restore
Check results 13979
Waiting...
05:21:08.607:     4: PASS
Test: zdtm/live/static/skiptest, Result: PASS
ZDTM tests PASS.


But when I set the env var that makes it try to skip, it fails, with
an ugly error message:

$ sudo env SKIP_TEST=1 test/zdtm.sh ns/static/skiptest
Execute zdtm/live/static/skiptest
./skiptest --pidfile=skiptest.pid --outfile=skiptest.out
The test failed (0, 1)
make: *** [skiptest.pid] Error 1
ERROR: fail to start zdtm/live/static/skiptest
cat: /home/filbranden/devel/criu/test/zdtm/live/static/skiptest.init.pid:
No such file or directory
error: list of process IDs must follow -p
Test: zdtm/live/static/skiptest, Result: FAIL
==================================== ERROR
Test: zdtm/live/static/skiptest, Namespace: 1
Output file: /home/filbranden/devel/criu/test/zdtm/live/static/skiptest.out
------------------------------------------------------------------------------
05:20:53.014:     4: SKIP: skiptest.c:12: I would like to skip this test.
05:20:53.014:     3: ERR: test.c:176: Test exited with unexpectedly with code 0
 (errno = 11 (No such file or directory))
  PID   SID COMMAND
    1     1 skiptest
    5     1 ps
waitpid() failed: No child processes
------------------------------------- END -------------------------------------
================================= ERROR OVER


It seems the problem is the way in which test_init() sets up
parent/child processes for the test runner and isn't really ready for
a test that doesn't go into test_daemon() and test_waitsig()...

I was wondering what was the initial plan for skip, whether it is
actually supposed to work and maybe I've been using it wrong (even
though the other examples I saw seem to be using the same pattern.) Do
you have a suggestion on how to fix this behavior?

Thanks!
Filipe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-zdtm-test-skip.patch
Type: application/octet-stream
Size: 1675 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/criu/attachments/20140623/cd148f8d/attachment.obj>


More information about the CRIU mailing list