summaryrefslogtreecommitdiffstats
path: root/tests/runfiles
diff options
context:
space:
mode:
authorRyan Moeller <[email protected]>2020-03-10 14:00:56 -0400
committerGitHub <[email protected]>2020-03-10 11:00:56 -0700
commitddd9ef3a4fab1eed3ed7c32900fc7f9474f2929b (patch)
tree27bfc28c31a09694f5752d9dc150a85efdaf7be6 /tests/runfiles
parent1dc32a67e93bbc8d650943f1a460abb9ff6c5083 (diff)
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 <[email protected]> Reviewed-by: John Kennedy <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10096
Diffstat (limited to 'tests/runfiles')
-rw-r--r--tests/runfiles/common.run2
-rw-r--r--tests/runfiles/linux.run2
-rw-r--r--tests/runfiles/sunos.run2
3 files changed, 6 insertions, 0 deletions
diff --git a/tests/runfiles/common.run b/tests/runfiles/common.run
index f2107f47b..c57989fe4 100644
--- a/tests/runfiles/common.run
+++ b/tests/runfiles/common.run
@@ -17,6 +17,8 @@ user = root
timeout = 600
post_user = root
post = cleanup
+failsafe_user = root
+failsafe = callbacks/zfs_failsafe
outputdir = /var/tmp/test_results
tags = ['functional']
diff --git a/tests/runfiles/linux.run b/tests/runfiles/linux.run
index bb83fa57f..897a6a955 100644
--- a/tests/runfiles/linux.run
+++ b/tests/runfiles/linux.run
@@ -17,6 +17,8 @@ user = root
timeout = 600
post_user = root
post = cleanup
+failsafe_user = root
+failsafe = callbacks/zfs_failsafe
outputdir = /var/tmp/test_results
tags = ['functional']
diff --git a/tests/runfiles/sunos.run b/tests/runfiles/sunos.run
index 0cff4046e..9ba00f452 100644
--- a/tests/runfiles/sunos.run
+++ b/tests/runfiles/sunos.run
@@ -17,6 +17,8 @@ user = root
timeout = 600
post_user = root
post = cleanup
+failsafe_user = root
+failsafe = callbacks/zfs_failsafe
outputdir = /var/tmp/test_results
tags = ['functional']