From a1194ad04ec79091695fd4ea1533347936c22262 Mon Sep 17 00:00:00 2001 From: Trevor Vaughan Date: Apr 11 2018 20:28:17 +0000 Subject: Updated tests Worked around the fact that data under the 'cas' directory is dynamically provisioned by moving from `cmp` to `diff -q -I` in run-tests.sh and excluding everything in the dynamically generated space. Ref #89 --- diff --git a/tests/028-dbus/expected.out b/tests/028-dbus/expected.out index 8a81a7f..ca3179e 100644 --- a/tests/028-dbus/expected.out +++ b/tests/028-dbus/expected.out @@ -542,6 +542,9 @@ After setting template-eku to 1.2.3.4.5.6.7.8.9.10, we got dbus.Array([dbus.Stri + + + @@ -586,6 +589,8 @@ After setting template-eku to 1.2.3.4.5.6.7.8.9.10, we got dbus.Array([dbus.Stri + + @@ -594,6 +599,9 @@ After setting template-eku to 1.2.3.4.5.6.7.8.9.10, we got dbus.Array([dbus.Stri +[ /org/fedorahosted/certmonger/cas/CA1: org.fedorahosted.certmonger.ca.get_config_file_path ] +$tmpdir/cas/local + [ /org/fedorahosted/certmonger/cas/CA1: org.fedorahosted.certmonger.ca.get_nickname ] local @@ -647,6 +655,9 @@ dbus.Array([], signature=dbus.Signature('s')) + + + @@ -691,6 +702,8 @@ dbus.Array([], signature=dbus.Signature('s')) + + @@ -699,6 +712,9 @@ dbus.Array([], signature=dbus.Signature('s')) +[ /org/fedorahosted/certmonger/cas/CA2: org.fedorahosted.certmonger.ca.get_config_file_path ] +$tmpdir/cas/20180327134236 + [ /org/fedorahosted/certmonger/cas/CA2: org.fedorahosted.certmonger.ca.get_nickname ] SelfSign @@ -721,7 +737,7 @@ dbus.Array([], signature=dbus.Signature('s')) [ /org/fedorahosted/certmonger/cas/CA2: org.fedorahosted.certmonger.ca.refresh ] 1 -/org/fedorahosted/certmonger/cas/CA2: warning: property org.fedorahosted.certmonger.ca.scep-ca-identifier not settable on this object +/org/fedorahosted/certmonger/cas/CA2: property org.fedorahosted.certmonger.ca.scep-cipher not set: (, x) [ /org/fedorahosted/certmonger/cas/CA3: org.freedesktop.DBus.Introspectable.Introspect ] @@ -754,6 +770,9 @@ dbus.Array([], signature=dbus.Signature('s')) + + + @@ -798,6 +817,8 @@ dbus.Array([], signature=dbus.Signature('s')) + + @@ -806,6 +827,9 @@ dbus.Array([], signature=dbus.Signature('s')) +[ /org/fedorahosted/certmonger/cas/CA3: org.fedorahosted.certmonger.ca.get_config_file_path ] +$tmpdir/cas/20180327134236-1 + [ /org/fedorahosted/certmonger/cas/CA3: org.fedorahosted.certmonger.ca.get_nickname ] IPA @@ -859,6 +883,9 @@ dbus.Array([], signature=dbus.Signature('s')) + + + @@ -903,6 +930,8 @@ dbus.Array([], signature=dbus.Signature('s')) + + @@ -911,6 +940,9 @@ dbus.Array([], signature=dbus.Signature('s')) +[ /org/fedorahosted/certmonger/cas/CA4: org.fedorahosted.certmonger.ca.get_config_file_path ] +$tmpdir/cas/20180327134236-2 + [ /org/fedorahosted/certmonger/cas/CA4: org.fedorahosted.certmonger.ca.get_nickname ] certmaster @@ -964,6 +996,9 @@ dbus.Array([], signature=dbus.Signature('s')) + + + @@ -1008,6 +1043,8 @@ dbus.Array([], signature=dbus.Signature('s')) + + @@ -1016,6 +1053,9 @@ dbus.Array([], signature=dbus.Signature('s')) +[ /org/fedorahosted/certmonger/cas/CA5: org.fedorahosted.certmonger.ca.get_config_file_path ] +$tmpdir/cas/20180327134236-3 + [ /org/fedorahosted/certmonger/cas/CA5: org.fedorahosted.certmonger.ca.get_nickname ] dogtag-ipa-renew-agent diff --git a/tests/033-scep/run.sh b/tests/033-scep/run.sh index 567e610..a36cd5a 100755 --- a/tests/033-scep/run.sh +++ b/tests/033-scep/run.sh @@ -103,7 +103,7 @@ check_nonce() { fi } -set_digest md5 +set_digest sha256 $toolsdir/scepgen ca entry > scepdata echo "[req, no trust root]" @@ -135,7 +135,7 @@ grep ^gic: scepdata | cut -f2- -d: | base64 -i -d | $toolsdir/pk7verify -r mini. check_failed echo OK echo "[req, old root]" -set_digest md5 +set_digest sha256 $toolsdir/scepgen ca entry > scepdata if test x`grep ^req: scepdata | cut -f2- -d:` = x ; then echo missing req @@ -145,7 +145,7 @@ check_verified check_msgtype $SCEP_MSGTYPE_PKCSREQ check_txid check_nonce -check_digest md5 +check_digest sha256 echo OK echo "[gic, old trust root]" set_digest sha1 diff --git a/tests/run-tests.sh b/tests/run-tests.sh index 7490e75..580a965 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -78,7 +78,9 @@ for testid in "$@" $subdirs ; do if ! test -s "$i" ; then break fi - if cmp -s "$tmpfile" "$i" 2> /dev/null ; then + # This regex needs to be ignored since it is dynamically created at + # every CA creation + if diff -q -I "tmpdir/cas/[[:digit:]]\+" "$tmpfile" "$i" 2> /dev/null ; then stat=0 echo "OK" cp $tmpfile "$builddir"/"$testid"/actual.out