Changes

Jump to navigation Jump to search
83 bytes removed ,  13:32, 1 September 2016
Line 125: Line 125:  
All logs from test, including the pass/fail status would be in the <code>$test.out</code> file.
 
All logs from test, including the pass/fail status would be in the <code>$test.out</code> file.
   −
== Adding test to automatic suite ==
+
== Test's .desc file ==
   −
The above part of the article describes what should be done to make the test work itself. Now, to check how the test is dumped and restored one should add the test to the suite. This is done simply by editing the <code>test/zdtm.sh</code> script and adding the test name to the <code>TEST_LIST</code> variable. Some tricks apply though.
+
Put the <code>${test_name}.desc</code> next to the test's .c file to configure the test. The .desc file can have the following fields in JSON format:
   −
=== Caring about namespaces ===
+
; 'flavor'
 +
: Add space-separated 'h', 'ns' or 'uns' list here to limit the test by host, namespaces or (namespaces and user namespaces) run.
   −
If your test behaves very differently when run inside sub-namespace or tests namespaces stuff, then the test should not be added to the very first definition of the <code>TEST_LIST</code> list, but instead to the one that goes after the <code># These ones are not in ns</code> comment, optionally with the <code>ns/</code> prefix.
+
; 'flags'
 +
: Space-separated values. <code>suid</code>: test needs root prio to run. <code>noauto</code>: test is excluded from <code>--all</code> run of zdtm.py. <code>crfail</code>: dump should fail for this test. <code>nouser</code>: test cannot be checkpointed in [[user-mode]]. <code>excl</code>: test should not be run in parallel with any other test. <code>samens</code>: no <code>--join-ns</code> testing.
   −
=== Requiring special features ===
+
; 'opts'
 +
: Any test-specific options for criu dump/restore actions should go here
   −
If in order to C/R the test some special support from the kernel is required, then CRIU itself should be taught to check this support with the <code>check --feature=$name</code> option (see cr-check.c file for details). The test itself should be conditionally added to the <code>TEST_LIST</code> variable. Check how the <code>static/tun</code> test is added for reference.
+
; 'feature'
 +
: The feature that should be [[Checking the kernel|checked]] before running the test.
 +
 
 +
; 'arch'
 +
: The test checks architecture-specific thing (regs/TLS/etc.) and should only be run on the arch specified.
 +
 
 +
== See also ==
 +
[[ZDTM Test Suite]]
    
[[Category: Development]]
 
[[Category: Development]]
 
[[Category: Testing]]
 
[[Category: Testing]]

Navigation menu