fixed the cname change bug (reported by m.f.)
authorHeiko Schlittermann (JUMPER) <hs@schlittermann.de>
Wed, 21 Jan 2015 23:08:37 +0100
changeset 67 760a2752983c
parent 66 04e08079f218
child 68 4c155b4e305d
fixed the cname change bug (reported by m.f.)
lib/DNS/Vi.pm
t/10-dnsvi.t
t/samples/frey-1
--- a/lib/DNS/Vi.pm	Wed Jan 21 23:07:59 2015 +0100
+++ b/lib/DNS/Vi.pm	Wed Jan 21 23:08:37 2015 +0100
@@ -97,7 +97,7 @@
                           unless substr($rrset{data}, -1) eq '.';
                     }
                 }
-                my $id = sha512_hex(join "\0", sort %rrset);
+                my $id = sha512_hex(join "\0", map { $_ => $rrset{$_} } sort keys %rrset);
                 push @zone, { id => $id, rrset => \%rrset };
 		### x: $zone[-1]
             }
--- a/t/10-dnsvi.t	Wed Jan 21 23:07:59 2015 +0100
+++ b/t/10-dnsvi.t	Wed Jan 21 23:08:37 2015 +0100
@@ -84,9 +84,9 @@
         MX     => 2,
     },
     'frey-1' => {
-	RRSETS => 5,
+	RRSETS => 6,
 	SOA => { 'example.com.' => ['p.example.com. hostmaster.example.com. 47 3600 900 604800 300'] },
-	A => { 'p.example.com.' => ['1.1.1.1'] },
+	A => { 'p.example.com.' => ['1.1.1.1', '2.2.2.2'] },
 	NS => { 'example.com.' => ['p.example.com.'] },
 	CNAME => {
 	    'proxy.mm.frey.example.com.' => ['uxa.frey.example.com.'],
--- a/t/samples/frey-1	Wed Jan 21 23:07:59 2015 +0100
+++ b/t/samples/frey-1	Wed Jan 21 23:08:37 2015 +0100
@@ -10,6 +10,7 @@
 
 	NS  p
 p	A   1.1.1.1
+p	A   2.2.2.2
 
 proxy.mm.frey     CNAME	uxa.frey
 portal.mm.frey    CNAME	uxb.frey