summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2010-04-16 16:58:16 +0200
committerHarald Hoyer <harald@redhat.com>2010-04-16 17:59:50 +0200
commit97add1b38333949960f3b1d60641716cce47766e (patch)
treef97f2a07eefa8b4522c5847c90aeaf187029d88f /test
parent3de984ba7f14bea072322016e5edc1817d979ea7 (diff)
downloaddracut-97add1b38333949960f3b1d60641716cce47766e.tar.gz
dracut-97add1b38333949960f3b1d60641716cce47766e.tar.bz2
dracut-97add1b38333949960f3b1d60641716cce47766e.zip
NBD: kill server after failed test
Diffstat (limited to 'test')
-rwxr-xr-xtest/TEST-40-NBD/test.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh
index d84d6573..8da1ba41 100755
--- a/test/TEST-40-NBD/test.sh
+++ b/test/TEST-40-NBD/test.sh
@@ -88,6 +88,10 @@ test_run() {
echo "Failed to start server" 1>&2
return 1
fi
+ client_run || { kill_server; return 1; }
+}
+
+client_run() {
# The default is ext3,errors=continue so use that to determine
# if our options were parsed and used
@@ -309,11 +313,15 @@ test_setup() {
-f initramfs.testing $KVERSION || return 1
}
-test_cleanup() {
+kill_server() {
if [[ -s server.pid ]]; then
sudo kill -TERM $(cat server.pid)
rm -f server.pid
fi
+}
+
+test_cleanup() {
+ kill_server
rm -fr overlay mnt
rm -f flag.img server.ext2 nbd.ext2 encrypted.ext2
rm -f initramfs.server initramfs.testing initramfs.makeroot