]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Made scripts bourne shell compliant and not bash.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 28 Mar 2011 19:27:19 +0000 (21:27 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 28 Mar 2011 19:32:49 +0000 (21:32 +0200)
tests/dsa/testdsa
tests/openpgp-certs/testcerts

index bbd0802e464fdcdc96d1f0ae1f8225bc1a775e0c..910bf8b1671f265c333fd4654b5cd7343f96a6a5 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 # Copyright (C) 2010 Free Software Foundation, Inc.
 #
@@ -38,7 +38,8 @@ echo "Checking various DSA key sizes"
 
 echo "Checking DSA-1024 with TLS 1.0"
 
-$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" --x509certfile $srcdir/cert.dsa.1024.pem --x509keyfile $srcdir/dsa.1024.pem >/dev/null 2>&1 &
+$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" --x509certfile $srcdir/cert.dsa.1024.pem --x509keyfile $srcdir/dsa.1024.pem >/dev/null 2>&1 & PID=$!
+trap "kill $PID" 1 15 2
 
 # give the server a chance to initialize
 sleep 2
@@ -64,14 +65,15 @@ echo "Checking server DSA-1024 with client DSA-3072 and TLS 1.0"
 $CLI $DEBUG -p $PORT 127.0.0.1 --insecure --x509certfile $srcdir/cert.dsa.3072.pem --x509keyfile $srcdir/dsa.3072.pem </dev/null >/dev/null 2>&1 && \
   fail "Succeeded connection to a server with a client DSA 3072 key and TLS 1.0!"
 
-kill %1
+kill $PID
 wait
 
 # DSA 1024 + TLS 1.2
 
 echo "Checking DSA-1024 with TLS 1.2"
 
-$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2" --x509certfile $srcdir/cert.dsa.1024.pem --x509keyfile $srcdir/dsa.1024.pem >/dev/null 2>&1 &
+$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2" --x509certfile $srcdir/cert.dsa.1024.pem --x509keyfile $srcdir/dsa.1024.pem >/dev/null 2>&1 & PID=$!
+trap "kill $PID" 1 15 2
 
 # give the server a chance to initialize
 sleep 2
@@ -98,14 +100,15 @@ $CLI $DEBUG -p $PORT 127.0.0.1 --insecure --x509certfile $srcdir/cert.dsa.3072.p
   fail "Failed connection to a server with a client DSA 3072 key and TLS 1.2!"
 
 
-kill %1
+kill $PID
 wait
 
 # DSA 2048 + TLS 1.0
 
 echo "Checking DSA-2048 with TLS 1.0"
 
-$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" --x509certfile $srcdir/cert.dsa.2048.pem --x509keyfile $srcdir/dsa.2048.pem >/dev/null 2>&1 &
+$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" --x509certfile $srcdir/cert.dsa.2048.pem --x509keyfile $srcdir/dsa.2048.pem >/dev/null 2>&1 & PID=$!
+trap "kill $PID" 1 15 2
 
 # give the server a chance to initialize
 sleep 2
@@ -113,14 +116,15 @@ sleep 2
 $CLI $DEBUG -p $PORT 127.0.0.1 --insecure </dev/null >/dev/null 2>&1 && \
   fail "Succeeded connection to a server with DSA 2048 key and TLS 1.0. Should have failed!"
 
-kill %1
+kill $PID
 wait
 
 # DSA 2048 + TLS 1.2
 
 echo "Checking DSA-2048 with TLS 1.2"
 
-$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2" --x509certfile $srcdir/cert.dsa.2048.pem --x509keyfile $srcdir/dsa.2048.pem >/dev/null 2>&1 &
+$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2" --x509certfile $srcdir/cert.dsa.2048.pem --x509keyfile $srcdir/dsa.2048.pem >/dev/null 2>&1 & PID=$!
+trap "kill $PID" 1 15 2
 
 # give the server a chance to initialize
 sleep 2
@@ -128,14 +132,15 @@ sleep 2
 $CLI $DEBUG -p $PORT 127.0.0.1 --insecure </dev/null >/dev/null || \
   fail "Failed connection to a server with DSA 2048 key and TLS 1.2!"
 
-kill %1
+kill $PID
 wait
 
 # DSA 3072 + TLS 1.0
 
 echo "Checking DSA-3072 with TLS 1.0"
 
-$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" --x509certfile $srcdir/cert.dsa.3072.pem --x509keyfile $srcdir/dsa.3072.pem >/dev/null 2>&1 &
+$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" --x509certfile $srcdir/cert.dsa.3072.pem --x509keyfile $srcdir/dsa.3072.pem >/dev/null 2>&1 & PID=$!
+trap "kill $PID" 1 15 2
 
 # give the server a chance to initialize
 sleep 2
@@ -143,14 +148,15 @@ sleep 2
 $CLI $DEBUG -p $PORT 127.0.0.1 --insecure </dev/null >/dev/null 2>&1 && \
   fail "Succeeded connection to a server with DSA 2048 key and TLS 1.0. Should have failed!"
 
-kill %1
+kill $PID
 wait
 
 # DSA 3072 + TLS 1.2
 
 echo "Checking DSA-3072 with TLS 1.2"
 
-$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2" --x509certfile $srcdir/cert.dsa.3072.pem --x509keyfile $srcdir/dsa.3072.pem >/dev/null 2>&1 &
+$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2" --x509certfile $srcdir/cert.dsa.3072.pem --x509keyfile $srcdir/dsa.3072.pem >/dev/null 2>&1 & PID=$!
+trap "kill $PID" 1 15 2
 
 # give the server a chance to initialize
 sleep 2
@@ -158,7 +164,7 @@ sleep 2
 $CLI $DEBUG -p $PORT 127.0.0.1 --insecure </dev/null >/dev/null || \
   fail "Failed connection to a server with DSA 3072 key and TLS 1.2!"
 
-kill %1
+kill $PID
 wait
 
 exit 0
index dbb0810df8ad56e6a8b22d1cdd48b47644973804..ecf39810d1700f633a28158fbeb669cc23818055 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 # Copyright (C) 2010 Free Software Foundation, Inc.
 #
@@ -33,7 +33,8 @@ fail() {
 
 echo "Checking OpenPGP certificate verification"
 
-$SERV -p $PORT --pgpcertfile $srcdir/srv-public-127.0.0.1-signed.gpg --pgpkeyfile $srcdir/srv-secret.gpg >/dev/null 2>&1 &
+$SERV -p $PORT --pgpcertfile $srcdir/srv-public-127.0.0.1-signed.gpg --pgpkeyfile $srcdir/srv-secret.gpg >/dev/null 2>&1 & PID=$!
+trap "kill $PID" 1 15 2
 
 # give the server a chance to initialize
 sleep 2
@@ -50,10 +51,12 @@ $CLI -p $PORT 127.0.0.2 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null
 $CLI -p $PORT localhost --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null && \
   fail "Connection to unverified (but present) 'localhost' should have failed!"
 
-kill %1
+kill $PID
 wait
 
-$SERV -p $PORT --pgpcertfile $srcdir/srv-public-localhost-signed.gpg --pgpkeyfile $srcdir/srv-secret.gpg >/dev/null 2>&1 &
+$SERV -p $PORT --pgpcertfile $srcdir/srv-public-localhost-signed.gpg --pgpkeyfile $srcdir/srv-secret.gpg >/dev/null 2>&1 & PID=$!
+trap "kill $PID" 1 15 2
+
 # give the server a chance to initialize
 sleep 2
 
@@ -67,10 +70,12 @@ $CLI -p $PORT 127.0.0.2 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null
 #$CLI -p $PORT localhost --pgpkeyring ca-public.gpg </dev/null >/dev/null || \
 #  fail "Connection to verified 'localhost' should have succeded! (error code $?)" $?
 
-kill %1 >/dev/null 2>&1
+kill $PID
 wait
 
-$SERV -p $PORT --pgpcertfile $srcdir/srv-public-all-signed.gpg --pgpkeyfile $srcdir/srv-secret.gpg >/dev/null 2>&1 &
+$SERV -p $PORT --pgpcertfile $srcdir/srv-public-all-signed.gpg --pgpkeyfile $srcdir/srv-secret.gpg >/dev/null 2>&1 & PID=$!
+trap "kill $PID" 1 15 2
+
 # give the server a chance to initialize
 sleep 2
 echo | $CLI -p $PORT 127.0.0.1 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null || \
@@ -79,7 +84,7 @@ echo | $CLI -p $PORT 127.0.0.1 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/d
 $CLI -p $PORT 127.0.0.2 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null && \
   fail "Connection to unrecognized IP address should have failed!"
 
-kill %1 >/dev/null 2>&1
+kill $PID
 wait
 
 exit ${RETCODE:-0}