ср, 24 июн. 2020 г. в 00:37, Gert Doering <g...@greenie.muc.de>:

> Hi,
>
> On Tue, Jun 23, 2020 at 12:32:42PM -0700, James Bottomley wrote:
> > > James, are you triggering on specific openvpn messages?  "--enable-
> > > small"
> > > changes these (trimming some warnings and help texts).  Can you test
> > > with
> > > "configure --enable-small", please?
> > >
> > > https://travis-ci.org/github/OpenVPN/openvpn/builds/701385033?utm_med
> > > ium=notification&utm_source=email
> >
> > Yes, that's it.  The problem is the message output by openssl is
> >
> > 2020-06-23 19:28:46 OpenSSL: error:0B080074:lib(11):func(128):reason(116)
> >
> > Instead of:
> >
> > 2020-06-23 12:30:43 OpenSSL: error:0B080074:x509 certificate
> routines:X509_check_private_key:key values mismatch
>
> Indeed :-)
>
> > I think I can make the grep work with the former.
>
> Please do not forget to output log.txt when it fails - it eases diagnosing
> remote failures where we do not have easy access to "file system things"
> (like travis or buildbot).
>

I've added output of log.txt, if you are going to modify "grep" magic, can
you adopt something like that, please ?


https://travis-ci.org/github/chipitsine/openvpn/jobs/701409750


diff --git a/tests/unit_tests/engine-key/check_engine_keys.sh
b/tests/unit_tests/engine-key/check_engine_keys.sh
index e0c9d7b0..770a0c9c 100755
--- a/tests/unit_tests/engine-key/check_engine_keys.sh
+++ b/tests/unit_tests/engine-key/check_engine_keys.sh
@@ -8,6 +8,10 @@ password='AT3S4PASSWD'
 key="${builddir}/client.key"
 pwdfile="${builddir}/passwd"

+grep_a_log () {
+  grep -q $1 $2 || { echo $3; cat $2 ; exit 1; }
+}
+
 # create an engine key for us
 sed 's/PRIVATE KEY/TEST ENGINE KEY/' <
${top_srcdir}/sample/sample-keys/client.key > ${key}
 echo "$password" > $pwdfile
@@ -21,10 +25,10 @@ ${top_builddir}/src/openvpn/openvpn --cd
${top_srcdir}/sample --config sample-co
 # first off check we died because of a key mismatch.  If this doesn't
 # pass, suspect openssl of returning different messages and update the
 # test accordingly
-grep -q 'X509_check_private_key:key values mismatch' log.txt || { echo
"Key mismatch not detected"; exit 1; }
+grep_a_log 'X509_check_private_key:key values mismatch' log.txt 'Key
mismatch not detected'

 # now look for the engine prints (these are under our control)
-grep -q 'ENGINE: engine_init called' log.txt || { echo "Engine
initialization not detected"; exit 1; }
-grep -q 'ENGINE: engine_load_key called' log.txt || { echo "Key was not
loaded from engine"; exit 1; }
-grep -q "ENGINE: engine_load_key got password ${password}" log.txt || {
echo "Key password was not retrieved by the engine"; exit 1; }
+grep_a_log 'ENGINE: engine_init called' log.txt 'Engine initialization not
detected'
+grep_a_log 'ENGINE: engine_load_key called' log.txt 'Key was not loaded
from engine'
+grep_a_log "ENGINE: engine_load_key got password ${password}" log.txt 'Key
password was not retrieved by the engine'
 exit 0
-- 
2.26.2







>
> gert
>
> --
> "If was one thing all people took for granted, was conviction that if you
>  feed honest figures into a computer, honest figures come out. Never
> doubted
>  it myself till I met a computer with a sense of humor."
>                              Robert A. Heinlein, The Moon is a Harsh
> Mistress
>
> Gert Doering - Munich, Germany
> g...@greenie.muc.de
>
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to