# HG changeset patch # User Brendan Cully # Date 1245011539 25200 # Node ID 6fce36336e4261415666b4353a2250ea1552860d # Parent 38305de95f1dace2ae8f3dbea95a7180a74818ca gpg: add test diff -r 38305de95f1d -r 6fce36336e42 tests/gpg/pubring.gpg Binary file tests/gpg/pubring.gpg has changed diff -r 38305de95f1d -r 6fce36336e42 tests/gpg/random_seed Binary file tests/gpg/random_seed has changed diff -r 38305de95f1d -r 6fce36336e42 tests/gpg/secring.gpg Binary file tests/gpg/secring.gpg has changed diff -r 38305de95f1d -r 6fce36336e42 tests/gpg/trustdb.gpg Binary file tests/gpg/trustdb.gpg has changed diff -r 38305de95f1d -r 6fce36336e42 tests/hghave --- a/tests/hghave Sun Jun 14 12:18:46 2009 -0700 +++ b/tests/hghave Sun Jun 14 13:32:19 2009 -0700 @@ -146,6 +146,9 @@ def has_tla(): return matchoutput('tla --version 2>&1', r'The GNU Arch Revision') +def has_gpg(): + return matchoutput('gpg --version 2>&1', r'GnuPG') + def has_unix_permissions(): d = tempfile.mkdtemp(prefix=tempprefix, dir=".") try: @@ -183,6 +186,7 @@ "execbit": (has_executablebit, "executable bit"), "fifo": (has_fifo, "named pipes"), "git": (has_git, "git command line client"), + "gpg": (has_gpg, "gpg client"), "hotshot": (has_hotshot, "python hotshot module"), "icasefs": (has_icasefs, "case insensitive file system"), "inotify": (has_inotify, "inotify extension support"), diff -r 38305de95f1d -r 6fce36336e42 tests/test-gpg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-gpg Sun Jun 14 13:32:19 2009 -0700 @@ -0,0 +1,28 @@ +#!/bin/sh + +"$TESTDIR/hghave" gpg || exit 80 + +cat <> $HGRCPATH +[extensions] +gpg= + +[gpg] +cmd=gpg --no-permission-warning --homedir $TESTDIR/gpg +EOF + +hg init r +cd r +echo foo > foo +hg ci -Amfoo + +echo '% no signatures' +hg sigs + +echo '% hg sign 0' +hg sign 0 + +echo '% hg sigs' +hg sigs + +echo '% hg sigcheck 0' +hg sigcheck 0 diff -r 38305de95f1d -r 6fce36336e42 tests/test-gpg.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-gpg.out Sun Jun 14 13:32:19 2009 -0700 @@ -0,0 +1,9 @@ +adding foo +% no signatures +% hg sign 0 +Signing 0:e63c23eaa88a +% hg sigs +hgtest 0:e63c23eaa88ae77967edcf4ea194d31167c478b0 +% hg sigcheck 0 +e63c23eaa88a is signed by: + hgtest