summaryrefslogtreecommitdiff
path: root/tests/scripts
diff options
context:
space:
mode:
authorAlon Bar-Lev <alon.barlev@gmail.com>2015-06-18 00:57:04 +0300
committerNikos Mavrogiannopoulos <nmav@redhat.com>2015-06-18 10:52:21 +0200
commit171c13d0d4392424bfed9e086e050b43a938ab48 (patch)
tree33f1e854b11f1e86ad838e6c6d66ec85af92f9e8 /tests/scripts
parent1721799ab7805a36af537d72fff98e4cf9094169 (diff)
downloadgnutls-171c13d0d4392424bfed9e086e050b43a938ab48.tar.gz
tests: dsa: cleanup shell usage
Add quotes for most usages of variables. Added ${} for variables. Cleanup trailing spaces. Removal of unneeded ';'. Minor fix in tests/scripts/common.sh at trap to pass message and avoid killing. Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Diffstat (limited to 'tests/scripts')
-rw-r--r--tests/scripts/common.sh36
1 files changed, 18 insertions, 18 deletions
diff --git a/tests/scripts/common.sh b/tests/scripts/common.sh
index 50880f53c4..3ccfc03797 100644
--- a/tests/scripts/common.sh
+++ b/tests/scripts/common.sh
@@ -21,18 +21,18 @@
RPORT="$(((($$<<15)|RANDOM) % 63001 + 2000))"
fail() {
- PID=$1
- shift;
+ PID="$1"
+ shift
echo "Failure: $1" >&2
- kill $PID
+ [ -n "${PID}" ] && kill ${PID}
exit 1
}
launch_server() {
- PARENT=$1;
- shift;
- $SERV $DEBUG -p $PORT $* >/dev/null 2>&1 &
- LOCALPID="$!";
+ PARENT="$1"
+ shift
+ ${SERV} ${DEBUG} -p "${PORT}" $* >/dev/null 2>&1 &
+ LOCALPID="$!"
trap "[ ! -z \"${LOCALPID}\" ] && kill ${LOCALPID};" 15
wait "${LOCALPID}"
LOCALRET="$?"
@@ -44,12 +44,12 @@ launch_server() {
}
launch_pkcs11_server() {
- PARENT=$1;
- shift;
- PROVIDER=$1;
- shift;
- $VALGRIND $SERV $PROVIDER $DEBUG -p $PORT $* &
- LOCALPID="$!";
+ PARENT="$1"
+ shift
+ PROVIDER="$1"
+ shift
+ ${VALGRIND} ${SERV} "${PROVIDER}" ${DEBUG} -p "${PORT}" $* &
+ LOCALPID="$!"
trap "[ ! -z \"${LOCALPID}\" ] && kill ${LOCALPID};" 15
wait "${LOCALPID}"
LOCALRET="$?"
@@ -61,10 +61,10 @@ launch_pkcs11_server() {
}
launch_bare_server() {
- PARENT=$1;
- shift;
- $SERV $* >/dev/null 2>&1 &
- LOCALPID="$!";
+ PARENT="$1"
+ shift
+ ${SERV} $* >/dev/null 2>&1 &
+ LOCALPID="$!"
trap "[ ! -z \"${LOCALPID}\" ] && kill ${LOCALPID};" 15
wait "${LOCALPID}"
LOCALRET="$?"
@@ -80,4 +80,4 @@ wait_server() {
sleep 4
}
-trap "fail \"Failed to launch a gnutls-serv server, aborting test... \"" 10
+trap "fail '' 'Failed to launch a gnutls-serv server, aborting test... '" 10