Commit ec813c62 authored by Valo's avatar Valo

Tryies to make tests work

parent 91082154
......@@ -16,13 +16,15 @@ source=(http://archive.monkeysphere.info/debian/pool/${pkgname}/m/${pkgname}/${p
binmerge.patch
ms.patch
mshost.patch
msauth.patch)
msauth.patch
tests.patch)
sha256sums=('b510b8a414fb400356e80f1f882488785df72ac54078410b54d4c50a84686e59'
'e49a1097296b06090010ce5344588f5e4917aeb06a118de920fc58411d2a7cf7'
'ce490eebfbf92b9a9abaf77d43489b0cdd7ebab427262e9eb7fbefdb67cdf289'
'4ddad85f6a9998f8f8869cef4f2f6d7bf9f04171fb3b5ae6c6621bfc8dc2bcbe'
'bcad168603c2afd4db6b54edd61c8c9cdd1e08bcea7de3b936a3269f271e3de6')
'bcad168603c2afd4db6b54edd61c8c9cdd1e08bcea7de3b936a3269f271e3de6'
'26534fdf2ddbad6553f198198681940918d685e1ec8ad89806de8000b89b8f4e')
install=monkeysphere.install
......@@ -33,6 +35,7 @@ prepare() {
patch -p1 -Ni "${srcdir}/ms.patch"
patch -p1 -Ni "${srcdir}/msauth.patch"
patch -p1 -Ni "${srcdir}/mshost.patch"
patch -p1 -Ni "${srcdir}/tests.patch"
}
# Checks fail
......
diff -uar monkeysphere-0.37.clean/tests/basic monkeysphere-0.37.new/tests/basic
--- monkeysphere-0.37.clean/tests/basic 2016-06-18 18:57:52.423333331 +0200
+++ monkeysphere-0.37.new/tests/basic 2016-06-18 19:19:36.783333327 +0200
@@ -45,10 +45,10 @@
######################################################################
### FUNCTIONS
-# gpg command for test admin user
+# gpg1 command for test admin user
gpgadmin() {
chmod 0700 "$TEMPDIR"/admin "$TEMPDIR"/admin/.gnupg
- GNUPGHOME="$TEMPDIR"/admin/.gnupg gpg --no-tty "$@"
+ GNUPGHOME="$TEMPDIR"/admin/.gnupg gpg1 --no-tty "$@"
}
# test ssh connection
@@ -328,13 +328,13 @@
echo
echo "##################################################"
echo "### export server key to testuser..."
-gpgadmin --armor --export "$SSHHOSTKEYID" | gpg --import
+gpgadmin --armor --export "$SSHHOSTKEYID" | gpg1 --import
# teach the "server" about the testuser's key
echo
echo "##################################################"
echo "### export testuser key to server..."
-gpg --export testuser | monkeysphere-authentication gpg-cmd --import
+gpg1 --export testuser | monkeysphere-authentication gpg-cmd --import
# update authorized_keys for user
echo
@@ -547,23 +547,23 @@
echo
echo "##################################################"
echo "### ssh connection test with hostname 'testhost2.example' added..."
-gpgadmin --export "$SSHHOSTKEYID" | gpg --import
-gpg --check-trustdb
+gpgadmin --export "$SSHHOSTKEYID" | gpg1 --import
+gpg1 --check-trustdb
ssh_test true
echo
echo "##################################################"
echo "### ssh connection test directly to 'testhost2.example' ..."
-gpg --import <"$HOST_KEY_FILE"
-gpg --check-trustdb
+gpg1 --import <"$HOST_KEY_FILE"
+gpg1 --check-trustdb
target_hostname=testhost2.example ssh_test true
echo
echo "##################################################"
echo "### ssh connection test for failure with 'testhost2.example' revoked..."
monkeysphere-host revoke-servicename ssh://testhost2.example
-gpg --import <"$HOST_KEY_FILE"
-gpg --check-trustdb
+gpg1 --import <"$HOST_KEY_FILE"
+gpg1 --check-trustdb
target_hostname=testhost2.example ssh_test true 255
# FIXME: addtest: remove admin as id-certifier and check ssh failure
@@ -604,7 +604,7 @@
echo "### revoking ssh host key..."
# generate the revocation certificate and feed it directly to the test
# user's keyring (we're not publishing to the keyservers)
-monkeysphere-host revoke-key "$SSHHOSTKEYID" | gpg --import
+monkeysphere-host revoke-key "$SSHHOSTKEYID" | gpg1 --import
echo
echo "##################################################"
echo "### ssh connection test for failure..."
diff -uar monkeysphere-0.37.clean/tests/common monkeysphere-0.37.new/tests/common
--- monkeysphere-0.37.clean/tests/common 2016-06-18 18:57:52.423333331 +0200
+++ monkeysphere-0.37.new/tests/common 2016-06-18 19:17:37.233333334 +0200
@@ -17,9 +17,9 @@
}
get_gpg_prng_arg() {
- if (gpg --quick-random --version >/dev/null 2>&1) ; then
+ if ( gpg1 --quick-random --version >/dev/null 2>&1) ; then
echo quick-random
- elif (gpg --debug-quick-random --version >/dev/null 2>&1) ; then
+ elif ( gpg1 --debug-quick-random --version >/dev/null 2>&1) ; then
echo debug-quick-random
fi
}
diff -uar monkeysphere-0.37.clean/tests/keytrans monkeysphere-0.37.new/tests/keytrans
--- monkeysphere-0.37.clean/tests/keytrans 2016-06-18 18:57:52.423333331 +0200
+++ monkeysphere-0.37.new/tests/keytrans 2016-06-18 19:28:57.713333334 +0200
@@ -70,7 +70,7 @@
EOF
# generate a key
-gpg --batch --$(get_gpg_prng_arg) --gen-key <<EOF
+gpg1 --batch --$(get_gpg_prng_arg) --gen-key <<EOF
Key-Type: RSA
Key-Length: 1024
Key-Usage: sign
@@ -83,39 +83,39 @@
echo "##################################################"
echo "### retrieving key timestamp..."
-timestamp=$(gpg --list-key --with-colons | \
+timestamp=$(gpg1 --list-key --with-colons | \
grep ^pub: | cut -d: -f6)
echo "##################################################"
echo "### exporting key to ssh file..."
-gpg --export-secret-key | openpgp2ssh > \
+gpg1 --export-secret-key | openpgp2ssh > \
"$TEMPDIR"/test.pem
-gpg --export-secret-key > "$TEMPDIR"/secret.key
+gpg1 --export-secret-key > "$TEMPDIR"/secret.key
PEM2OPENPGP_USAGE_FLAGS=sign,certify \
PEM2OPENPGP_TIMESTAMP="$timestamp" pem2openpgp testtest \
< "$TEMPDIR"/test.pem > "$TEMPDIR"/converted.secret.key
echo "##################################################"
-echo "### reconvert key, and compare to key in gpg keyring..."
+echo "### reconvert key, and compare to key in gpg1 keyring..."
diff -u \
- <(gpg --list-packets < "$TEMPDIR"/secret.key) \
- <(gpg --list-packets < "$TEMPDIR"/converted.secret.key)
+ <(gpg1 --list-packets < "$TEMPDIR"/secret.key) \
+ <(gpg1 --list-packets < "$TEMPDIR"/converted.secret.key)
diff -u \
<(hd "$TEMPDIR"/secret.key) \
<(hd "$TEMPDIR"/converted.secret.key)
-KEYFPR=$(gpg --fingerprint --with-colons --list-keys | grep ^fpr | cut -f10 -d:)
+KEYFPR=$(gpg1 --fingerprint --with-colons --list-keys | grep ^fpr | cut -f10 -d:)
KEYID=$(printf "%s" "$KEYFPR" | cut -b25-40)
echo "conversions look good!"
echo "Now working with key $KEYID at time $timestamp"
-gpg --check-trustdb
-gpg --list-keys
+gpg1 --check-trustdb
+gpg1 --list-keys
echo "##################################################"
@@ -123,10 +123,10 @@
< "$TEMPDIR"/secring.gpg \
PEM2OPENPGP_TIMESTAMP="$timestamp" \
PEM2OPENPGP_USAGE_FLAGS=sign,certify \
- keytrans adduserid "$KEYID" "monkeymonkey" | gpg --import
+ keytrans adduserid "$KEYID" "monkeymonkey" | gpg1 --import
-gpg --check-trustdb
-gpg --list-keys
+gpg1 --check-trustdb
+gpg1 --list-keys
cat >"$TEMPDIR"/expectedout <<EOF
pub:u:1024:1:$KEYID:$timestamp:::u:::scSC:
@@ -136,7 +136,7 @@
sig:!::1:$KEYID:$timestamp::::monkeymonkey:13x:::::8:
EOF
-diff -u "$TEMPDIR"/expectedout <(gpg --check-sigs --with-colons | grep -v ^tru)
+diff -u "$TEMPDIR"/expectedout <(gpg1 --check-sigs --with-colons | grep -v ^tru)
echo "##################################################"
echo "### sleeping to avoid test suite breakage on fast"
@@ -151,10 +151,10 @@
< "$TEMPDIR"/secring.gpg \
PEM2OPENPGP_TIMESTAMP="$revtime" \
- keytrans revokeuserid "$KEYID" "testtest" | gpg --import
+ keytrans revokeuserid "$KEYID" "testtest" | gpg1 --import
-gpg --check-trustdb
-gpg --list-keys
+gpg1 --check-trustdb
+gpg1 --list-keys
cat >"$TEMPDIR"/expectedout <<EOF
pub:u:1024:1:$KEYID:$timestamp:::u:::scSC:
@@ -166,7 +166,7 @@
EOF
-diff -u "$TEMPDIR"/expectedout <(gpg --check-sigs --with-colons | grep -v ^tru)
+diff -u "$TEMPDIR"/expectedout <(gpg1 --check-sigs --with-colons | grep -v ^tru)
echo "##################################################"
@@ -181,11 +181,11 @@
NEWKEYFPR=$(< "$TEMPDIR"/newkey.gpg keytrans listfprs)
NEWKEYID=$( printf "%s" "$NEWKEYFPR" | cut -b25-40)
-< "$TEMPDIR"/newkey.gpg gpg --import
+< "$TEMPDIR"/newkey.gpg gpg1 --import
< "$TEMPDIR"/secring.gpg \
PEM2OPENPGP_TIMESTAMP="$timestamp" \
- keytrans adduserid "$KEYID" "baz" | gpg --import
+ keytrans adduserid "$KEYID" "baz" | gpg1 --import
cat >"$TEMPDIR"/expectedout <<EOF
pub:u:1024:1:$KEYID:$timestamp:::u:::scSC:
@@ -201,8 +201,8 @@
sig:!::1:$NEWKEYID:$(($timestamp + 1))::::fubar:13x:::::8:
EOF
-echo "test: diff expected gpg list output"
-diff -u "$TEMPDIR"/expectedout <(gpg --check-sigs --with-colons | grep -v ^tru)
+echo "test: diff expected gpg1 list output"
+diff -u "$TEMPDIR"/expectedout <(gpg1 --check-sigs --with-colons | grep -v ^tru)
sort >"$TEMPDIR"/expectedout <<EOF
$KEYFPR
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment