selinux-testsuite: Allow nfs test script to close cleanly
PATCH 1/1 selinux-testsuite: Allow nfs test script to close cleanly
Whenever 'make test' fails, close cleanly.
Signed-off-by Richard Haines <[email protected]>
--- tools/nfs.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+)
tools/nfs.sh +12 -0
@@ -1,4 +1,16 @@ #!/bin/sh -e + +# If 'make test' fails, close down cleanly +function err_exit() { + popd + umount /mnt/selinux-testsuite + exportfs -u localhost:$MOUNT + rmdir /mnt/selinux-testsuite + systemctl stop nfs-server +} + +trap 'err_exit' EXIT + MOUNT=`stat --print %m .` TESTDIR=`pwd` systemctl start nfs-server
Signature · 1 line
2.24.1