diff mbox

[kvm-unit-tests,04/12] scripts/mkstandalone: use bash in standalone test

Message ID 1453209851-27760-5-git-send-email-rkrcmar@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Radim Krčmář Jan. 19, 2016, 1:24 p.m. UTC
A New Hope.

Limiting ourselves to POSIX shell is what made mkstandalone very messy.

Bash knows EXIT trap, which always happens.

Signed-off-by: Radim Kr?má? <rkrcmar@redhat.com>
---
 scripts/mkstandalone.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh
index a187adc856b7..9ab4b1920e50 100755
--- a/scripts/mkstandalone.sh
+++ b/scripts/mkstandalone.sh
@@ -66,7 +66,7 @@  function mkstandalone()
 	exec {tmpfd}<&1
 	exec > $standalone
 
-	echo "#!/bin/sh"
+	echo "#!/bin/bash"
 
 	cat config.mak | grep '^ARCH='
 
@@ -89,7 +89,7 @@  echo "skip $testname (test kernel not present)" 1>&2
 exit 1
 EOF
 else
-	echo "trap 'rm -f \$cleanup; exit 1' HUP INT TERM"
+	echo "trap 'rm -f \$cleanup' EXIT"
 
 	temp_file bin "$kernel"
 
@@ -122,7 +122,6 @@  if [ \$ret -le 1 ]; then
 else
 	echo FAIL $testname 1>&2
 fi
-rm -f \$bin
 exit 0
 EOF
 fi