From: David Bremner Date: Sat, 19 Mar 2011 13:09:01 +0000 (-0300) Subject: allow passing keyserver via environment. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=30999dcfc62c93464e251eaea7da19d97b15652d;p=monkeysphere-validation-agent.git allow passing keyserver via environment. I decided to use MSTEST_KEYSERVER to allow both setting the fallback keyserver and testing the user environment settings (although this is not done now). --- diff --git a/unit-tests/10.keyserver/20.fetch_fpr.t b/unit-tests/10.keyserver/20.fetch_fpr.t index cbdef5e..e3fa853 100644 --- a/unit-tests/10.keyserver/20.fetch_fpr.t +++ b/unit-tests/10.keyserver/20.fetch_fpr.t @@ -5,6 +5,8 @@ use Crypt::Monkeysphere::Keyserver; use GnuPG::Interface; use File::Temp qw(tempdir); +my $keyserver= $ENV{MSTEST_KEYSERVER} || 'hkp://pool.sks-keyservers.net'; + my $fpr='762B57BB784206AD'; plan tests =>2; @@ -13,6 +15,7 @@ my $gnupg = new GnuPG::Interface(); $gnupg->options->hash_init(homedir=>$tempdir); my $ks=new Crypt::Monkeysphere::Keyserver(gnupg=>$gnupg, + keyserver=>$keyserver, loglevel=>'debug'); isa_ok($ks,'Crypt::Monkeysphere::Keyserver'); diff --git a/unit-tests/10.keyserver/20.fetch_uid.t b/unit-tests/10.keyserver/20.fetch_uid.t index 248cbda..3b8ccf3 100644 --- a/unit-tests/10.keyserver/20.fetch_uid.t +++ b/unit-tests/10.keyserver/20.fetch_uid.t @@ -7,6 +7,8 @@ use File::Temp qw(tempdir); use strict; +my $keyserver= $ENV{MSTEST_KEYSERVER} || 'hkp://pool.sks-keyservers.net'; + my $uid='David Bremner '; plan tests =>2; @@ -15,6 +17,7 @@ my $gnupg = new GnuPG::Interface(); $gnupg->options->hash_init(homedir=>$tempdir); my $ks=new Crypt::Monkeysphere::Keyserver(gnupg=>$gnupg, + keyserver=>$keyserver, loglevel=>'debug'); isa_ok($ks,'Crypt::Monkeysphere::Keyserver'); diff --git a/unit-tests/20.validator/20.remote.t b/unit-tests/20.validator/20.remote.t index ecbf91c..21b55be 100644 --- a/unit-tests/20.validator/20.remote.t +++ b/unit-tests/20.validator/20.remote.t @@ -11,6 +11,7 @@ use strict; my $uid='David Bremner '; plan tests =>2; +my $keyserver= $ENV{MSTEST_KEYSERVER} || 'hkp://pool.sks-keyservers.net'; my $tempdir = tempdir("unitXXXXX", CLEANUP=> 1); my $gnupg = new GnuPG::Interface(); $gnupg->options->hash_init(homedir=>$tempdir, @@ -18,7 +19,8 @@ $gnupg->options->hash_init(homedir=>$tempdir, ); my $validator=new Crypt::Monkeysphere::Validator(gnupg=>$gnupg, - loglevel=>'debug'); + keyserver=>$keyserver, + loglevel=>'debug'); isa_ok($validator,'Crypt::Monkeysphere::Validator');