fix keytrans test to handle possible permuted output of keytrans listfprs from expect...
authorJameson Rollins <jrollins@finestructure.net>
Mon, 18 Jan 2010 15:53:27 +0000 (10:53 -0500)
committerJameson Rollins <jrollins@finestructure.net>
Mon, 18 Jan 2010 15:53:27 +0000 (10:53 -0500)
Makefile
tests/keytrans

index 7d13c32dbb028ba7d3ac03d7381a2575e26e400c..9381b033f4e5cc9991d34ceda0c46d3bc70c41e7 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -83,8 +83,12 @@ installman:
 releasenote:
        ./utils/build-releasenote
 
-test:
-       MONKEYSPHERE_TEST_NO_EXAMINE=true ./tests/keytrans
+test: test-keytrans test-basic
+
+test-basic:
        MONKEYSPHERE_TEST_NO_EXAMINE=true ./tests/basic
 
+test-keytrans:
+       MONKEYSPHERE_TEST_NO_EXAMINE=true ./tests/keytrans
+
 .PHONY: all tarball debian-package freebsd-distinfo clean install installman releasenote test
index e70751d99a5f6eaca6c3d7cbd36c65b868ab5fbe..62aa4f262012544758a3e4fd4ba9d29438cd5e0a 100755 (executable)
@@ -196,6 +196,7 @@ uid:-::::$(($timestamp + 1))::A0D708F51CC257DEFC01AEDE1E0A5F329DFD8F16::fubar:
 sig:!::1:$NEWKEYID:$(($timestamp + 1))::::fubar:13x:
 EOF
 
+echo "test: diff expected gpg list output"
 diff -u "$TEMPDIR"/expectedout <(gpg --check-sigs --with-colons --fixed-list-mode | grep -v ^tru)
 
 cat >"$TEMPDIR"/expectedout <<EOF
@@ -203,7 +204,16 @@ $KEYFPR
 $NEWKEYFPR
 EOF
 
-diff -u "$TEMPDIR"/expectedout <( < "$TEMPDIR"/secring.gpg keytrans listfprs)
+echo "test: diff expected keytrans listfpr output"
+if ! diff -u "$TEMPDIR"/expectedout <( < "$TEMPDIR"/secring.gpg keytrans listfprs) ; then
+    # test reverse order
+    echo "test: diff test again with permuted order"
+    cat >"$TEMPDIR"/expectedout <<EOF
+$NEWKEYFPR
+$KEYFPR
+EOF
+    diff -u "$TEMPDIR"/expectedout <( < "$TEMPDIR"/secring.gpg keytrans listfprs)
+fi
 
 ## FIXME: addtest: not testing subkeys at the moment.