[PATCH] selinux-testsuite: Allow nfs test script to close cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Whenever 'make test' fails, close cleanly.

Signed-off-by: Richard Haines <richard_c_haines@xxxxxxxxxxxxxx>
---
 tools/nfs.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tools/nfs.sh b/tools/nfs.sh
index 314f898..f99c76b 100755
--- a/tools/nfs.sh
+++ b/tools/nfs.sh
@@ -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
-- 
2.24.1




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux