]> git.proxmox.com Git - mirror_zfs.git/commit - tests/runfiles/linux.run
ZTS: Add a failsafe callback to run after each test
authorRyan Moeller <ryan@iXsystems.com>
Tue, 10 Mar 2020 18:00:56 +0000 (14:00 -0400)
committerGitHub <noreply@github.com>
Tue, 10 Mar 2020 18:00:56 +0000 (11:00 -0700)
commitddd9ef3a4fab1eed3ed7c32900fc7f9474f2929b
tree27bfc28c31a09694f5752d9dc150a85efdaf7be6
parent1dc32a67e93bbc8d650943f1a460abb9ff6c5083
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
tests/runfiles/common.run
tests/runfiles/linux.run
tests/runfiles/sunos.run
tests/test-runner/bin/test-runner.py
tests/test-runner/man/test-runner.1
tests/zfs-tests/callbacks/Makefile.am
tests/zfs-tests/callbacks/zfs_failsafe.ksh [new file with mode: 0755]