summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Bar-Lev <alon.barlev@gmail.com>2015-06-18 09:41:55 +0300
committerNikos Mavrogiannopoulos <nmav@redhat.com>2015-06-18 10:54:25 +0200
commit672c27254dbb94df2306b5850180c8c943e2a722 (patch)
tree516c29c6d6fc4e544cf9bb843df245b2e5a6cf03
parentc198ee2fd5bf9bb4debf8a56b5156a3c751a526e (diff)
downloadgnutls-672c27254dbb94df2306b5850180c8c943e2a722.tar.gz
tests: openpgp-certs: cleanup shell usage
Add quotes for most usages of variables. Added ${} for variables. Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
-rwxr-xr-xtests/openpgp-certs/testcerts50
-rwxr-xr-xtests/openpgp-certs/testselfsigs8
2 files changed, 29 insertions, 29 deletions
diff --git a/tests/openpgp-certs/testcerts b/tests/openpgp-certs/testcerts
index add6908216..c8d25d1fbf 100755
--- a/tests/openpgp-certs/testcerts
+++ b/tests/openpgp-certs/testcerts
@@ -29,59 +29,59 @@ if test "${WINDIR}" != "";then
exit 77
fi
-. $srcdir/../scripts/common.sh
+. "${srcdir}/../scripts/common.sh"
PORT="${PORT:-$RPORT}"
echo "Checking OpenPGP certificate verification"
-launch_server $$ --priority NORMAL:+CTYPE-OPENPGP --pgpcertfile $srcdir/srv-public-127.0.0.1-signed.gpg --pgpkeyfile $srcdir/srv-secret.gpg >/dev/null 2>&1 & PID=$!
-wait_server $PID
+launch_server $$ --priority NORMAL:+CTYPE-OPENPGP --pgpcertfile "${srcdir}/srv-public-127.0.0.1-signed.gpg" --pgpkeyfile "${srcdir}/srv-secret.gpg" >/dev/null 2>&1 & PID=$!
+wait_server ${PID}
# give the server a chance to initialize
#gnutls currently only considers PGP certificates verified only if
#all user IDs in the certificate were signed.
-#$CLI -p $PORT 127.0.0.1 --pgpkeyring ca-public.gpg </dev/null >/dev/null || \
+#"${CLI}" -p "${PORT}" 127.0.0.1 --pgpkeyring ca-public.gpg </dev/null >/dev/null || \
# fail "Connection to verified IP address should have succeeded! (error code $?)" $?
-$CLI $DEBUG -p $PORT 127.0.0.2 --priority NORMAL:+CTYPE-OPENPGP --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null 2>&1 && \
- fail $PID "Connection to unrecognized IP address should have failed!"
+"${CLI}" ${DEBUG} -p "${PORT}" 127.0.0.2 --priority NORMAL:+CTYPE-OPENPGP --pgpkeyring "${srcdir}/ca-public.gpg" </dev/null >/dev/null 2>&1 && \
+ fail ${PID} "Connection to unrecognized IP address should have failed!"
-$CLI $DEBUG -p $PORT localhost --priority NORMAL:+CTYPE-OPENPGP --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null 2>&1 && \
- fail $PID "Connection to unverified (but present) 'localhost' should have failed!"
+"${CLI}" ${DEBUG} -p "${PORT}" localhost --priority NORMAL:+CTYPE-OPENPGP --pgpkeyring "${srcdir}/ca-public.gpg" </dev/null >/dev/null 2>&1 && \
+ fail ${PID} "Connection to unverified (but present) 'localhost' should have failed!"
-kill $PID
+kill ${PID}
wait
-launch_server $$ --priority NORMAL:+CTYPE-OPENPGP --pgpcertfile $srcdir/srv-public-localhost-signed.gpg --pgpkeyfile $srcdir/srv-secret.gpg >/dev/null 2>&1 & PID=$!
-wait_server $PID
+launch_server $$ --priority NORMAL:+CTYPE-OPENPGP --pgpcertfile "${srcdir}/srv-public-localhost-signed.gpg" --pgpkeyfile "${srcdir}/srv-secret.gpg" >/dev/null 2>&1 & PID=$!
+wait_server ${PID}
-echo | $CLI $DEBUG --priority NORMAL:+CTYPE-OPENPGP -p $PORT 127.0.0.1 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null 2>&1 && \
- fail $PID "Connection to unverified IP address should have failed! (error code $?)" $?
+echo | "${CLI}" ${DEBUG} --priority NORMAL:+CTYPE-OPENPGP -p "${PORT}" 127.0.0.1 --pgpkeyring "${srcdir}/ca-public.gpg" </dev/null >/dev/null 2>&1 && \
+ fail ${PID} "Connection to unverified IP address should have failed! (error code $?)" $?
-$CLI $DEBUG --priority NORMAL:+CTYPE-OPENPGP -p $PORT 127.0.0.2 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null 2>&1 && \
- fail $PID "Connection to unrecognized IP address should have failed!"
+"${CLI}" ${DEBUG} --priority NORMAL:+CTYPE-OPENPGP -p "${PORT}" 127.0.0.2 --pgpkeyring "${srcdir}/ca-public.gpg" </dev/null >/dev/null 2>&1 && \
+ fail ${PID} "Connection to unrecognized IP address should have failed!"
#see reason above
-#$CLI -p $PORT localhost --pgpkeyring ca-public.gpg </dev/null >/dev/null || \
-# fail $PID "Connection to verified 'localhost' should have succeded! (error code $?)" $?
+#"${CLI}" -p "${PORT}" localhost --pgpkeyring ca-public.gpg </dev/null >/dev/null || \
+# fail ${PID} "Connection to verified 'localhost' should have succeded! (error code $?)" $?
-kill $PID
+kill ${PID}
wait
-launch_server $$ --priority NORMAL:+CTYPE-OPENPGP --pgpcertfile $srcdir/srv-public-all-signed.gpg --pgpkeyfile $srcdir/srv-secret.gpg >/dev/null 2>&1 & PID=$!
-wait_server $PID
+launch_server $$ --priority NORMAL:+CTYPE-OPENPGP --pgpcertfile "${srcdir}/srv-public-all-signed.gpg" --pgpkeyfile "${srcdir}/srv-secret.gpg" >/dev/null 2>&1 & PID=$!
+wait_server ${PID}
# give the server a chance to initialize
-echo | $CLI $DEBUG --priority NORMAL:+CTYPE-OPENPGP -p $PORT 127.0.0.1 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null || \
- fail $PID "Connection to signed PGP certificate should have succeeded! (error code $?)" $?
+echo | "${CLI}" ${DEBUG} --priority NORMAL:+CTYPE-OPENPGP -p "${PORT}" 127.0.0.1 --pgpkeyring "${srcdir}/ca-public.gpg" </dev/null >/dev/null || \
+ fail ${PID} "Connection to signed PGP certificate should have succeeded! (error code $?)" $?
-$CLI $DEBUG --priority NORMAL:+CTYPE-OPENPGP -p $PORT 127.0.0.2 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null 2>&1 && \
- fail $PID "Connection to unrecognized IP address should have failed!"
+"${CLI}" ${DEBUG} --priority NORMAL:+CTYPE-OPENPGP -p "${PORT}" 127.0.0.2 --pgpkeyring "${srcdir}/ca-public.gpg" </dev/null >/dev/null 2>&1 && \
+ fail ${PID} "Connection to unrecognized IP address should have failed!"
-kill $PID
+kill ${PID}
wait
exit 0
diff --git a/tests/openpgp-certs/testselfsigs b/tests/openpgp-certs/testselfsigs
index 3c99a6f656..c997f9ae31 100755
--- a/tests/openpgp-certs/testselfsigs
+++ b/tests/openpgp-certs/testselfsigs
@@ -34,19 +34,19 @@ fail() {
echo "Checking OpenPGP certificate self verification"
-($CERTTOOL --inraw --pgp-certificate-info --infile $srcdir/selfsigs/alice.pub \
+("${CERTTOOL}" --inraw --pgp-certificate-info --infile "${srcdir}/selfsigs/alice.pub" \
| grep "^Self Signature verification: ok" > /dev/null) || \
fail "Self sig Verification should have succeeded!"
-($CERTTOOL --inraw --pgp-certificate-info --infile $srcdir/selfsigs/alice-mallory-badsig18.pub \
+("${CERTTOOL}" --inraw --pgp-certificate-info --infile "${srcdir}/selfsigs/alice-mallory-badsig18.pub" \
| grep "^Self Signature verification: failed" > /dev/null) || \
fail "Self sig Verification should have failed!"
-($CERTTOOL --inraw --pgp-certificate-info --infile $srcdir/selfsigs/alice-mallory-irrelevantsig.pub \
+("${CERTTOOL}" --inraw --pgp-certificate-info --infile "${srcdir}/selfsigs/alice-mallory-irrelevantsig.pub" \
| grep "^Self Signature verification: failed" >/dev/null) || \
fail "Self sig Verification should have failed!"
-($CERTTOOL --inraw --pgp-certificate-info --infile $srcdir/selfsigs/alice-mallory-nosig18.pub \
+("${CERTTOOL}" --inraw --pgp-certificate-info --infile "${srcdir}/selfsigs/alice-mallory-nosig18.pub" \
| grep "^Self Signature verification: failed" >/dev/null) || \
fail "Self sig Verification should have failed!"