summaryrefslogblamecommitdiff
path: root/user/gnutls/tests-certtool.patch
blob: 13dc12b3b0f0930571d56b5abf66343f1781ba49 (plain) (tree)
































                                                                                                                                                                                         
I think this tests is simply wrong.
When a PIN is given, the program should run in batch mode.
So the question for "Enter password" should _not_ be present.

Fails on the builders:

> Generating a 3072 bit RSA private key...
> Generating a self signed certificate...
> No PIN given.
> note: when operating in batch mode, set the GNUTLS_PIN or GNUTLS_SO_PIN environment variables
> cert generation failed
> FAIL certtool.sh (exit status: 1)

--- a/tests/cert-tests/certtool.sh	2019-02-07 07:33:45.960887338 +0000
+++ b/tests/cert-tests/certtool.sh	2019-02-07 07:36:14.550955051 +0000
@@ -49,7 +49,7 @@
 
 	#check whether password is being honoured
 	#some CI runners need GNUTLS_PIN (GNUTLS_PIN=${PASS})
-	${SETSID} "${CERTTOOL}" --generate-self-signed --load-privkey ${TMPFILE1} --template ${srcdir}/templates/template-test.tmpl --ask-pass >${TMPFILE2} 2>&1 <<EOF
+	GNUTLS_PIN=${PASS} ${SETSID} "${CERTTOOL}" --generate-self-signed --load-privkey ${TMPFILE1} --template ${srcdir}/templates/template-test.tmpl --ask-pass >${TMPFILE2} 2>&1 <<EOF
 $PASS
 EOF
 	if test $? != 0;then
@@ -59,7 +59,7 @@
 	fi
 
 	grep "Enter password" ${TMPFILE2} >/dev/null 2>&1
-	if test $? != 0;then
+	if test $? != 1; then
 		cat ${TMPFILE2}
 		echo "No password was asked"
 		exit 1