Blame SOURCES/0024-Updated-tests.patch

fff44d
From 151699403803230e6d420b422cca13380b36e2a8 Mon Sep 17 00:00:00 2001
fff44d
From: Trevor Vaughan <tvaughan@onyxpoint.com>
fff44d
Date: Tue, 27 Mar 2018 18:04:34 -0400
fff44d
Subject: [PATCH 24/25] Updated tests
fff44d
fff44d
Worked around the fact that data under the 'cas' directory is
fff44d
dynamically provisioned by moving from `cmp` to `diff -q -I` in
fff44d
run-tests.sh and excluding everything in the dynamically generated
fff44d
space.
fff44d
fff44d
Ref #89
fff44d
---
fff44d
 tests/028-dbus/expected.out | 42 +++++++++++++++++++++++++++++++++++++++++-
fff44d
 tests/033-scep/run.sh       |  6 +++---
fff44d
 tests/run-tests.sh          |  4 +++-
fff44d
 3 files changed, 47 insertions(+), 5 deletions(-)
fff44d
fff44d
diff --git a/tests/028-dbus/expected.out b/tests/028-dbus/expected.out
fff44d
index 4c33e9a..dd9cac1 100644
fff44d
--- a/tests/028-dbus/expected.out
fff44d
+++ b/tests/028-dbus/expected.out
fff44d
@@ -536,6 +536,9 @@ After setting template-eku to 1.2.3.4.5.6.7.8.9.10, we got dbus.Array([dbus.Stri
fff44d
   </signal>
fff44d
  </interface>
fff44d
  <interface name="org.fedorahosted.certmonger.ca">
fff44d
+  <method name="get_config_file_path">
fff44d
+   <arg name="path" type="s" direction="out"/>
fff44d
+  </method>
fff44d
   <method name="get_nickname">
fff44d
    <arg name="nickname" type="s" direction="out"/>
fff44d
   </method>
fff44d
@@ -580,6 +583,8 @@ After setting template-eku to 1.2.3.4.5.6.7.8.9.10, we got dbus.Array([dbus.Stri
fff44d
   <property name="ca-presave-uid" type="s" access="read"/>
fff44d
   <property name="ca-postsave-command" type="s" access="read"/>
fff44d
   <property name="ca-postsave-uid" type="s" access="read"/>
fff44d
+  <property name="scep-cipher" type="s" access="readwrite"/>
fff44d
+  <property name="scep-digest" type="s" access="readwrite"/>
fff44d
   <property name="scep-ca-identifier" type="s" access="readwrite"/>
fff44d
   <property name="scep-ca-capabilities" type="as" access="read"/>
fff44d
   <property name="scep-ra-cert" type="s" access="read"/>
fff44d
@@ -588,6 +593,9 @@ After setting template-eku to 1.2.3.4.5.6.7.8.9.10, we got dbus.Array([dbus.Stri
fff44d
  </interface>
fff44d
 </node>
fff44d
 
fff44d
+[ /org/fedorahosted/certmonger/cas/CA1: org.fedorahosted.certmonger.ca.get_config_file_path ]
fff44d
+$tmpdir/cas/local
fff44d
+
fff44d
 [ /org/fedorahosted/certmonger/cas/CA1: org.fedorahosted.certmonger.ca.get_nickname ]
fff44d
 local
fff44d
 
fff44d
@@ -641,6 +649,9 @@ dbus.Array([], signature=dbus.Signature('s'))
fff44d
   </signal>
fff44d
  </interface>
fff44d
  <interface name="org.fedorahosted.certmonger.ca">
fff44d
+  <method name="get_config_file_path">
fff44d
+   <arg name="path" type="s" direction="out"/>
fff44d
+  </method>
fff44d
   <method name="get_nickname">
fff44d
    <arg name="nickname" type="s" direction="out"/>
fff44d
   </method>
fff44d
@@ -685,6 +696,8 @@ dbus.Array([], signature=dbus.Signature('s'))
fff44d
   <property name="ca-presave-uid" type="s" access="read"/>
fff44d
   <property name="ca-postsave-command" type="s" access="read"/>
fff44d
   <property name="ca-postsave-uid" type="s" access="read"/>
fff44d
+  <property name="scep-cipher" type="s" access="readwrite"/>
fff44d
+  <property name="scep-digest" type="s" access="readwrite"/>
fff44d
   <property name="scep-ca-identifier" type="s" access="readwrite"/>
fff44d
   <property name="scep-ca-capabilities" type="as" access="read"/>
fff44d
   <property name="scep-ra-cert" type="s" access="read"/>
fff44d
@@ -693,6 +706,9 @@ dbus.Array([], signature=dbus.Signature('s'))
fff44d
  </interface>
fff44d
 </node>
fff44d
 
fff44d
+[ /org/fedorahosted/certmonger/cas/CA2: org.fedorahosted.certmonger.ca.get_config_file_path ]
fff44d
+$tmpdir/cas/20180327134236
fff44d
+
fff44d
 [ /org/fedorahosted/certmonger/cas/CA2: org.fedorahosted.certmonger.ca.get_nickname ]
fff44d
 SelfSign
fff44d
 
fff44d
@@ -715,7 +731,7 @@ dbus.Array([], signature=dbus.Signature('s'))
fff44d
 [ /org/fedorahosted/certmonger/cas/CA2: org.fedorahosted.certmonger.ca.refresh ]
fff44d
 1
fff44d
 
fff44d
-/org/fedorahosted/certmonger/cas/CA2: warning: property org.fedorahosted.certmonger.ca.scep-ca-identifier not settable on this object
fff44d
+/org/fedorahosted/certmonger/cas/CA2: property org.fedorahosted.certmonger.ca.scep-cipher not set: (, x)
fff44d
 [ /org/fedorahosted/certmonger/cas/CA3: org.freedesktop.DBus.Introspectable.Introspect ]
fff44d
 
fff44d
 "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
fff44d
@@ -748,6 +764,9 @@ dbus.Array([], signature=dbus.Signature('s'))
fff44d
   </signal>
fff44d
  </interface>
fff44d
  <interface name="org.fedorahosted.certmonger.ca">
fff44d
+  <method name="get_config_file_path">
fff44d
+   <arg name="path" type="s" direction="out"/>
fff44d
+  </method>
fff44d
   <method name="get_nickname">
fff44d
    <arg name="nickname" type="s" direction="out"/>
fff44d
   </method>
fff44d
@@ -792,6 +811,8 @@ dbus.Array([], signature=dbus.Signature('s'))
fff44d
   <property name="ca-presave-uid" type="s" access="read"/>
fff44d
   <property name="ca-postsave-command" type="s" access="read"/>
fff44d
   <property name="ca-postsave-uid" type="s" access="read"/>
fff44d
+  <property name="scep-cipher" type="s" access="readwrite"/>
fff44d
+  <property name="scep-digest" type="s" access="readwrite"/>
fff44d
   <property name="scep-ca-identifier" type="s" access="readwrite"/>
fff44d
   <property name="scep-ca-capabilities" type="as" access="read"/>
fff44d
   <property name="scep-ra-cert" type="s" access="read"/>
fff44d
@@ -800,6 +821,9 @@ dbus.Array([], signature=dbus.Signature('s'))
fff44d
  </interface>
fff44d
 </node>
fff44d
 
fff44d
+[ /org/fedorahosted/certmonger/cas/CA3: org.fedorahosted.certmonger.ca.get_config_file_path ]
fff44d
+$tmpdir/cas/20180327134236-1
fff44d
+
fff44d
 [ /org/fedorahosted/certmonger/cas/CA3: org.fedorahosted.certmonger.ca.get_nickname ]
fff44d
 IPA
fff44d
 
fff44d
@@ -853,6 +877,9 @@ dbus.Array([], signature=dbus.Signature('s'))
fff44d
   </signal>
fff44d
  </interface>
fff44d
  <interface name="org.fedorahosted.certmonger.ca">
fff44d
+  <method name="get_config_file_path">
fff44d
+   <arg name="path" type="s" direction="out"/>
fff44d
+  </method>
fff44d
   <method name="get_nickname">
fff44d
    <arg name="nickname" type="s" direction="out"/>
fff44d
   </method>
fff44d
@@ -897,6 +924,8 @@ dbus.Array([], signature=dbus.Signature('s'))
fff44d
   <property name="ca-presave-uid" type="s" access="read"/>
fff44d
   <property name="ca-postsave-command" type="s" access="read"/>
fff44d
   <property name="ca-postsave-uid" type="s" access="read"/>
fff44d
+  <property name="scep-cipher" type="s" access="readwrite"/>
fff44d
+  <property name="scep-digest" type="s" access="readwrite"/>
fff44d
   <property name="scep-ca-identifier" type="s" access="readwrite"/>
fff44d
   <property name="scep-ca-capabilities" type="as" access="read"/>
fff44d
   <property name="scep-ra-cert" type="s" access="read"/>
fff44d
@@ -905,6 +934,9 @@ dbus.Array([], signature=dbus.Signature('s'))
fff44d
  </interface>
fff44d
 </node>
fff44d
 
fff44d
+[ /org/fedorahosted/certmonger/cas/CA4: org.fedorahosted.certmonger.ca.get_config_file_path ]
fff44d
+$tmpdir/cas/20180327134236-2
fff44d
+
fff44d
 [ /org/fedorahosted/certmonger/cas/CA4: org.fedorahosted.certmonger.ca.get_nickname ]
fff44d
 certmaster
fff44d
 
fff44d
@@ -958,6 +990,9 @@ dbus.Array([], signature=dbus.Signature('s'))
fff44d
   </signal>
fff44d
  </interface>
fff44d
  <interface name="org.fedorahosted.certmonger.ca">
fff44d
+  <method name="get_config_file_path">
fff44d
+   <arg name="path" type="s" direction="out"/>
fff44d
+  </method>
fff44d
   <method name="get_nickname">
fff44d
    <arg name="nickname" type="s" direction="out"/>
fff44d
   </method>
fff44d
@@ -1002,6 +1037,8 @@ dbus.Array([], signature=dbus.Signature('s'))
fff44d
   <property name="ca-presave-uid" type="s" access="read"/>
fff44d
   <property name="ca-postsave-command" type="s" access="read"/>
fff44d
   <property name="ca-postsave-uid" type="s" access="read"/>
fff44d
+  <property name="scep-cipher" type="s" access="readwrite"/>
fff44d
+  <property name="scep-digest" type="s" access="readwrite"/>
fff44d
   <property name="scep-ca-identifier" type="s" access="readwrite"/>
fff44d
   <property name="scep-ca-capabilities" type="as" access="read"/>
fff44d
   <property name="scep-ra-cert" type="s" access="read"/>
fff44d
@@ -1010,6 +1047,9 @@ dbus.Array([], signature=dbus.Signature('s'))
fff44d
  </interface>
fff44d
 </node>
fff44d
 
fff44d
+[ /org/fedorahosted/certmonger/cas/CA5: org.fedorahosted.certmonger.ca.get_config_file_path ]
fff44d
+$tmpdir/cas/20180327134236-3
fff44d
+
fff44d
 [ /org/fedorahosted/certmonger/cas/CA5: org.fedorahosted.certmonger.ca.get_nickname ]
fff44d
 dogtag-ipa-renew-agent
fff44d
 
fff44d
diff --git a/tests/033-scep/run.sh b/tests/033-scep/run.sh
fff44d
index 15480ac..f270a49 100755
fff44d
--- a/tests/033-scep/run.sh
fff44d
+++ b/tests/033-scep/run.sh
fff44d
@@ -103,7 +103,7 @@ check_nonce() {
fff44d
 	fi
fff44d
 }
fff44d
 
fff44d
-set_digest md5
fff44d
+set_digest sha256
fff44d
 $toolsdir/scepgen ca entry > scepdata
fff44d
 
fff44d
 echo "[req, no trust root]"
fff44d
@@ -135,7 +135,7 @@ grep ^gic: scepdata | cut -f2- -d: | base64 -i -d | $toolsdir/pk7verify -r mini.
fff44d
 check_failed
fff44d
 echo OK
fff44d
 echo "[req, old root]"
fff44d
-set_digest md5
fff44d
+set_digest sha256
fff44d
 $toolsdir/scepgen ca entry > scepdata
fff44d
 if test x`grep ^req: scepdata | cut -f2- -d:` = x ; then
fff44d
 	echo missing req
fff44d
@@ -145,7 +145,7 @@ check_verified
fff44d
 check_msgtype $SCEP_MSGTYPE_PKCSREQ
fff44d
 check_txid
fff44d
 check_nonce
fff44d
-check_digest md5
fff44d
+check_digest sha256
fff44d
 echo OK
fff44d
 echo "[gic, old trust root]"
fff44d
 set_digest sha1
fff44d
diff --git a/tests/run-tests.sh b/tests/run-tests.sh
fff44d
index a0f7c2d..266ddc6 100755
fff44d
--- a/tests/run-tests.sh
fff44d
+++ b/tests/run-tests.sh
fff44d
@@ -77,7 +77,9 @@ for testid in "$@" $subdirs ; do
fff44d
 				if ! test -s "$i" ; then
fff44d
 					break
fff44d
 				fi
fff44d
-				if cmp -s "$tmpfile" "$i" 2> /dev/null ; then
fff44d
+				# This regex needs to be ignored since it is dynamically created at
fff44d
+				# every CA creation
fff44d
+				if diff -q -I "tmpdir/cas/[[:digit:]]\+" "$tmpfile" "$i" 2> /dev/null ; then
fff44d
 					stat=0
fff44d
 					echo "OK"
fff44d
 					cp $tmpfile "$builddir"/"$testid"/actual.out
fff44d
-- 
fff44d
1.8.3.1
fff44d