Difference between revisions of "Fault injection"

From CRIU
Jump to navigation Jump to search
 
Line 1: Line 1:
[[Category:Empty articles]]
+
Fault injection testing is used to validate error paths in CRIU. Faults are artificially generated in peeked places of the code to check for particular roll-backs.
 +
 
 +
Faults are enforced by setting the <code>CRIU_FAULT</code> [[environment variables|env]] before executing CRIU binary. Values are described in <code>criu/include/fault-injection.h</code> header file.
 +
 
 +
== Fatal faults ==
 +
 
 +
These make CRIU abort the current operation and exit with error.
 +
 
 +
=== Abort dump early ===
 +
 
 +
<code>FI_DUMP_EARLY == 1</code>. Makes CRIU abort duming right after infecting the task with [[parasite code]]. Checks that parasite unloading on error works OK.
 +
 
 +
=== Abort restore early ===
 +
 
 +
<code>FI_RESTORE_ROOT_ONLY == 2</code>. Makes CRIU stop restoring right after spawning (and pre-restoring) the root task. Checks that early preparations (such as [[invisible files]] pre-creation) doesn't leave garbage in the system.
 +
 
 +
=== Abort link-remap file opening ==
 +
 
 +
<code>FI_RESTORE_OPEN_LINK_REMAP == 3</code>. Make CRIU fail the very first attempt opening the [[invisible files|link remap]] file. Additional check for invisible files cleanup.
 +
 
 +
=== Abort connection to parasite code ===
 +
 
 +
<code>FI_PARASITE_CONNECT == 4</code>. Makes CRIU simulate impossibility for [[parasite code]] to connect back to CRIU.
 +
 
 +
== Non fatal faults ==
 +
 
 +
These just make CRIU chose different paths on dump/restore, trying harder to get work done.
 +
 
 +
=== Abort open-by-handle ===
 +
 
 +
<code>FI_CHECK_OPEN_HANDLE == 128</code>. Simulates failure of the <code>open_by_handle_at</code> system call. Forces the [[irmap]] engine to work.
 +
 
 +
=== Abort memfd creation ===
 +
 
 +
<code>FI_NO_MEMFD == 129</code>. Forces [[parasite code]] use shmem-based blob instead of memfd-based. Used for older kernels (not having the <code>memfd_create()</code> system call) to work.
 +
 
 +
=== Abort breakpoints injectioin ===
 +
 
 +
<code>FI_NO_BREAKPOINTS == 130</code>. Disables breakpoints and makes CRIU unload [[code blobs]] by step-by-step tracing.
 +
 
 +
 
 
[[Category:Testing]]
 
[[Category:Testing]]

Revision as of 17:45, 26 September 2016

Fault injection testing is used to validate error paths in CRIU. Faults are artificially generated in peeked places of the code to check for particular roll-backs.

Faults are enforced by setting the CRIU_FAULT env before executing CRIU binary. Values are described in criu/include/fault-injection.h header file.

Fatal faults

These make CRIU abort the current operation and exit with error.

Abort dump early

FI_DUMP_EARLY == 1. Makes CRIU abort duming right after infecting the task with parasite code. Checks that parasite unloading on error works OK.

Abort restore early

FI_RESTORE_ROOT_ONLY == 2. Makes CRIU stop restoring right after spawning (and pre-restoring) the root task. Checks that early preparations (such as invisible files pre-creation) doesn't leave garbage in the system.

= Abort link-remap file opening

FI_RESTORE_OPEN_LINK_REMAP == 3. Make CRIU fail the very first attempt opening the link remap file. Additional check for invisible files cleanup.

Abort connection to parasite code

FI_PARASITE_CONNECT == 4. Makes CRIU simulate impossibility for parasite code to connect back to CRIU.

Non fatal faults

These just make CRIU chose different paths on dump/restore, trying harder to get work done.

Abort open-by-handle

FI_CHECK_OPEN_HANDLE == 128. Simulates failure of the open_by_handle_at system call. Forces the irmap engine to work.

Abort memfd creation

FI_NO_MEMFD == 129. Forces parasite code use shmem-based blob instead of memfd-based. Used for older kernels (not having the memfd_create() system call) to work.

Abort breakpoints injectioin

FI_NO_BREAKPOINTS == 130. Disables breakpoints and makes CRIU unload code blobs by step-by-step tracing.