Permalink
Browse files

Minor tweaks; add some more tests; update MANIFEST

  • Loading branch information...
1 parent 8f859ee commit 1fd91cc82db8004af46bb8995db1dd5e8b70712d @abh committed Aug 9, 2010
Showing with 33 additions and 3 deletions.
  1. +6 −1 MANIFEST
  2. +1 −1 Makefile.PL
  3. +7 −0 t/json_config_missing.conf
  4. +18 −0 t/reply_mx.t
  5. +1 −1 t/version.t
View
@@ -14,11 +14,13 @@ lib/GeoDNS.pm
LICENSE
Makefile.PL
MANIFEST
+pgeodns
pgeodns.conf
pgeodns.pl
+README
sync_config.sh
-t/countries.t
t/config_error.t
+t/countries.t
t/default_serial.t
t/example.com.json
t/find_base.conf
@@ -28,6 +30,7 @@ t/get_ns_records.t
t/get_soa_record.t
t/json_config.conf
t/json_config.t
+t/json_config_missing.conf
t/pick_groups.conf
t/pick_groups.t
t/pick_hosts.t
@@ -40,5 +43,7 @@ t/recursive_include.t
t/replies.conf
t/replies_weight.t
t/reply_a.t
+t/reply_alias.t
t/reply_cname.t
+t/reply_mx.t
t/version.t
View
@@ -9,7 +9,7 @@ WriteMakefile
VERSION_FROM => 'lib/GeoDNS.pm',
ABSTRACT => "Perl Geographic DNS Server",
PL_FILES => { },
- EXE_FILES => [ 'pgeodns.pl' ],
+ EXE_FILES => [ 'pgeodns' ],
# PM => {
# 'GeoDNS.pm' => '$(INST_LIBDIR)/App/HWD.pm',
# },
@@ -0,0 +1,7 @@
+
+base example.com t/example.com.json
+
+# this is to test that the functionality of preserving the old config
+# when an invalid config is present
+base nothere.example.org t/notfound.json
+
View
@@ -0,0 +1,18 @@
+use Test::More qw(no_plan);
+use strict;
+
+my @ans;
+
+use_ok('GeoDNS');
+ok(my $g = GeoDNS->new, "new");
+ok($g->load_config('t/json_config.conf'), "load_config");
+
+#ok(@ans = $g->reply_handler("example.com", "IN", "MX", "192.168.0.10"), "example.com MX");
+#warn Data::Dumper->Dump([\@ans], [qw(ans)]);
+
+#ok(@{$ans[1]} == 2, 'got two records');
+#is($ans[1]->[0] && $ans[1]->[0]->type, 'MX', 'got MX record');
+
+#is($ans[1]->[0]->address, '192.168.1.2', 'got sane a data');
+#is($ans[1]->[0]->ttl, '601', 'got ttl of target record');
+
View
@@ -8,7 +8,7 @@ my $time = time;
ok(my $g = GeoDNS->new, "new");
ok($g->load_config('t/replies.conf'), "load_config");
-ok(my $g2 = GeoDNS->new(interface => '127.0.0.10'), "new");
+ok(my $g2 = GeoDNS->new(server_id => '127.0.0.10'), "new");
ok($g2->load_config('t/replies.conf'), "load_config");
like($g2->version_full, qr/^127.0.0.10, v1\.\d+/, 'full version method');

0 comments on commit 1fd91cc

Please sign in to comment.