allow passing keyserver via environment.
authorDavid Bremner <bremner@unb.ca>
Sat, 19 Mar 2011 13:09:01 +0000 (10:09 -0300)
committerDavid Bremner <bremner@unb.ca>
Thu, 24 Mar 2011 22:57:35 +0000 (19:57 -0300)
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).

unit-tests/10.keyserver/20.fetch_fpr.t
unit-tests/10.keyserver/20.fetch_uid.t
unit-tests/20.validator/20.remote.t

index cbdef5e81a6a0b62f8b7810d4c5d71c716394a66..e3fa853f954c768bf31759c7bbfdd0814f3b5955 100644 (file)
@@ -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');
index 248cbdac735f63fd736088985fc8aab74ab0bcba..3b8ccf30025bdb1cf507b72bd898dfd6a1031574 100644 (file)
@@ -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 <david@tethera.net>';
 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');
index ecbf91c7407ba7c2a88a043a62a8fdc9bfd14d0f..21b55beea211e90c8a047931bdbe4a5ccdcd1d46 100644 (file)
@@ -11,6 +11,7 @@ use strict;
 my $uid='David Bremner <david@tethera.net>';
 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');