ZTS: Add a failsafe callback to run after each test

Tests that get killed do not have an opportunity to clean up.

There are many bad states this can leave the system in, but of
particular gravity is when zinject has been used to induce bad
behavior for one or more of the test disks.

Create a failsafe mechanism in test-runner.py that runs a callback
script after every test. The script is common to all tests so all
tests benefit from the protection.

Add an obligatory `zinject -c all` to clear all zinject state after
every test case is run.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #10096
This commit is contained in:
Ryan Moeller
2020-03-10 14:00:56 -04:00
committed by GitHub
parent 1dc32a67e9
commit ddd9ef3a4f
7 changed files with 145 additions and 48 deletions
+16
View File
@@ -251,6 +251,22 @@ Run \fIscript\fR after any test or test group.
Print only the results summary to the standard output.
.RE
.ne 2
.na
\fB-s\fR \fIscript\fR
.ad
.RS 6n
Run \fIscript\fR as a failsafe after any test is killed.
.RE
.ne 2
.na
\fB-S\fR \fIusername\fR
.ad
.RS 6n
Execute the failsafe script as \fIusername\fR.
.RE
.ne 2
.na
\fB-t\fR \fIn\fR