Changes

Jump to navigation Jump to search
1,438 bytes added ,  13:32, 1 September 2016
Line 3: Line 3:  
== Overview ==
 
== Overview ==
   −
The ZDTM test-suite is the automated suite that launches individual subtests as processes, waits for them to get prepared, then dumps the process(es) started, then restores them and asks to check whether the restored state is what test thinks to be proper. In order to write more subtests developer should use the API declared below. Tests themselves live in one of <code>test/zdtm/live/</code> sub-directory. The full-cycle suite is the <code>test/zdtm.sh</code> script.
+
The ZDTM test-suite is the automated suite that launches individual subtests as processes, waits for them to get prepared, then dumps the process(es) started, then restores them and asks to check whether the restored state is what test thinks to be proper. In order to write more subtests developer should use the API declared below. Tests themselves live in one of <code>test/zdtm/</code> sub-directory. The full-cycle suite is the <code>test/zdtm.py</code> script.
    
== API for test itself ==
 
== API for test itself ==
Line 112: Line 112:  
</pre>
 
</pre>
   −
== Adding test to automatic suite ==
+
=== Checking test works ===
 +
 
 +
To make sure test itself works do these steps:
 +
 
 +
<pre>
 +
make cleanout  # to clean the directory from old stuff
 +
make $test    # to build the test
 +
make $test.pid # to start the test
 +
make $test.out # to stop the test and ask it for "checking" stage and results
 +
</pre>
 +
 
 +
All logs from test, including the pass/fail status would be in the <code>$test.out</code> file.
 +
 
 +
== Test's .desc file ==
 +
 
 +
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:
 +
 
 +
; 'flavor'
 +
: Add space-separated 'h', 'ns' or 'uns' list here to limit the test by host, namespaces or (namespaces and user namespaces) run.
 +
 
 +
; '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.
 +
 
 +
; 'opts'
 +
: Any test-specific options for criu dump/restore actions should go here
 +
 
 +
; '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]]

Navigation menu