From 806bc1c0fef408a090981e5b69a134cce770a089 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Mon, 6 Jun 2016 16:08:53 -0400 Subject: [PATCH] Dust off tests. --- test-dns.rkt | 94 ++++++++++++++++++++++++++-------------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/test-dns.rkt b/test-dns.rkt index 75ce542..c4291ad 100644 --- a/test-dns.rkt +++ b/test-dns.rkt @@ -156,30 +156,30 @@ 'no-error (list (question (domain '(#"google" #"com")) '* 'in #f)) (list - (rr (domain '(#"google" #"com")) 'txt 'in 3119 '(#"v=spf1 include:_netblocks.google.com ip4:216.73.93.70/31 ip4:216.73.93.72/31 ~all")) - (rr (domain '(#"google" #"com")) 'a 'in 285 '#(74 125 226 146)) - (rr (domain '(#"google" #"com")) 'a 'in 285 '#(74 125 226 148)) - (rr (domain '(#"google" #"com")) 'a 'in 285 '#(74 125 226 145)) - (rr (domain '(#"google" #"com")) 'a 'in 285 '#(74 125 226 147)) - (rr (domain '(#"google" #"com")) 'a 'in 285 '#(74 125 226 144)) - (rr (domain '(#"google" #"com")) 'ns 'in 238877 (domain '(#"ns2" #"google" #"com"))) - (rr (domain '(#"google" #"com")) 'ns 'in 238877 (domain '(#"ns3" #"google" #"com"))) - (rr (domain '(#"google" #"com")) 'ns 'in 238877 (domain '(#"ns1" #"google" #"com"))) - (rr (domain '(#"google" #"com")) 'ns 'in 238877 (domain '(#"ns4" #"google" #"com"))) - (rr (domain '(#"google" #"com")) 'mx 'in 42 (mx 20 (domain '(#"alt1" #"aspmx" #"l" #"google" #"com")))) - (rr (domain '(#"google" #"com")) 'mx 'in 42 (mx 30 (domain '(#"alt2" #"aspmx" #"l" #"google" #"com")))) - (rr (domain '(#"google" #"com")) 'mx 'in 42 (mx 10 (domain '(#"aspmx" #"l" #"google" #"com")))) - (rr (domain '(#"google" #"com")) 'mx 'in 42 (mx 40 (domain '(#"alt3" #"aspmx" #"l" #"google" #"com")))) - (rr (domain '(#"google" #"com")) 'mx 'in 42 (mx 50 (domain '(#"alt4" #"aspmx" #"l" #"google" #"com"))))) + (rr (domain '(#"google" #"com")) 'in 3119 (rdata-txt 'txt '(#"v=spf1 include:_netblocks.google.com ip4:216.73.93.70/31 ip4:216.73.93.72/31 ~all"))) + (rr (domain '(#"google" #"com")) 'in 285 (rdata-ipv4 'a '#(74 125 226 146))) + (rr (domain '(#"google" #"com")) 'in 285 (rdata-ipv4 'a '#(74 125 226 148))) + (rr (domain '(#"google" #"com")) 'in 285 (rdata-ipv4 'a '#(74 125 226 145))) + (rr (domain '(#"google" #"com")) 'in 285 (rdata-ipv4 'a '#(74 125 226 147))) + (rr (domain '(#"google" #"com")) 'in 285 (rdata-ipv4 'a '#(74 125 226 144))) + (rr (domain '(#"google" #"com")) 'in 238877 (rdata-domain 'ns (domain '(#"ns2" #"google" #"com")))) + (rr (domain '(#"google" #"com")) 'in 238877 (rdata-domain 'ns (domain '(#"ns3" #"google" #"com")))) + (rr (domain '(#"google" #"com")) 'in 238877 (rdata-domain 'ns (domain '(#"ns1" #"google" #"com")))) + (rr (domain '(#"google" #"com")) 'in 238877 (rdata-domain 'ns (domain '(#"ns4" #"google" #"com")))) + (rr (domain '(#"google" #"com")) 'in 42 (rdata-mx 'mx 20 (domain '(#"alt1" #"aspmx" #"l" #"google" #"com")))) + (rr (domain '(#"google" #"com")) 'in 42 (rdata-mx 'mx 30 (domain '(#"alt2" #"aspmx" #"l" #"google" #"com")))) + (rr (domain '(#"google" #"com")) 'in 42 (rdata-mx 'mx 10 (domain '(#"aspmx" #"l" #"google" #"com")))) + (rr (domain '(#"google" #"com")) 'in 42 (rdata-mx 'mx 40 (domain '(#"alt3" #"aspmx" #"l" #"google" #"com")))) + (rr (domain '(#"google" #"com")) 'in 42 (rdata-mx 'mx 50 (domain '(#"alt4" #"aspmx" #"l" #"google" #"com"))))) '() (list - (rr (domain '(#"ns3" #"google" #"com")) 'a 'in 238287 '#(216 239 36 10)) - (rr (domain '(#"ns1" #"google" #"com")) 'a 'in 238287 '#(216 239 32 10)) - (rr (domain '(#"ns4" #"google" #"com")) 'a 'in 238287 '#(216 239 38 10)) - (rr (domain '(#"ns2" #"google" #"com")) 'a 'in 238287 '#(216 239 34 10)) - (rr (domain '(#"alt2" #"aspmx" #"l" #"google" #"com")) 'a 'in 240 '#(74 125 39 27)) - (rr (domain '(#"aspmx" #"l" #"google" #"com")) 'a 'in 246 '#(74 125 115 27)) - (rr (domain '(#"alt1" #"aspmx" #"l" #"google" #"com")) 'a 'in 33 '#(74 125 77 27))))) + (rr (domain '(#"ns3" #"google" #"com")) 'in 238287 (rdata-ipv4 'a '#(216 239 36 10))) + (rr (domain '(#"ns1" #"google" #"com")) 'in 238287 (rdata-ipv4 'a '#(216 239 32 10))) + (rr (domain '(#"ns4" #"google" #"com")) 'in 238287 (rdata-ipv4 'a '#(216 239 38 10))) + (rr (domain '(#"ns2" #"google" #"com")) 'in 238287 (rdata-ipv4 'a '#(216 239 34 10))) + (rr (domain '(#"alt2" #"aspmx" #"l" #"google" #"com")) 'in 240 (rdata-ipv4 'a '#(74 125 39 27))) + (rr (domain '(#"aspmx" #"l" #"google" #"com")) 'in 246 (rdata-ipv4 'a '#(74 125 115 27))) + (rr (domain '(#"alt1" #"aspmx" #"l" #"google" #"com")) 'in 33 (rdata-ipv4 'a '#(74 125 77 27)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Roundtrip tests @@ -271,7 +271,7 @@ 'no-error (list (question (domain '(#"google" #"com")) 'aaaa 'in #f)) '() - (list (rr (domain '(#"google" #"com")) 'soa 'in 594 (soa (domain '(#"ns1" #"google" #"com")) (domain '(#"dns-admin" #"google" #"com")) 1454883 7200 1800 1209600 300))) + (list (rr (domain '(#"google" #"com")) 'in 594 (rdata-soa 'soa (domain '(#"ns1" #"google" #"com")) (domain '(#"dns-admin" #"google" #"com")) 1454883 7200 1800 1209600 300))) '())) ;; Wed Jun 29 21:05:03 2011 (4e0bcbbf): UDP: localhost sent 32 bytes: @@ -318,7 +318,7 @@ 'no-recursion-available 'no-error (list (question (domain '(#"www" #"google" #"com")) 'aaaa 'in #f)) - (list (rr (domain '(#"www" #"google" #"com")) 'cname 'in 604800 (domain '(#"www" #"l" #"google" #"com")))) + (list (rr (domain '(#"www" #"google" #"com")) 'in 604800 (rdata-domain 'cname (domain '(#"www" #"l" #"google" #"com"))))) '() '())) @@ -348,8 +348,8 @@ 'no-recursion-available 'no-error (list (question (domain '(#"ipv6" #"google" #"com")) 'aaaa 'in #f)) - (list (rr (domain '(#"ipv6" #"google" #"com")) 'cname 'in 604800 (domain '(#"ipv6" #"l" #"google" #"com"))) - (rr (domain '(#"ipv6" #"l" #"google" #"com")) 'aaaa 'in 300 '#(32 1 72 96 128 15 0 0 0 0 0 0 0 0 0 104))) + (list (rr (domain '(#"ipv6" #"google" #"com")) 'in 604800 (rdata-domain 'cname (domain '(#"ipv6" #"l" #"google" #"com")))) + (rr (domain '(#"ipv6" #"l" #"google" #"com")) 'in 300 (rdata-ipv6 'aaaa '#(32 1 72 96 128 15 0 0 0 0 0 0 0 0 0 104)))) '() '())) @@ -440,24 +440,24 @@ 'recursion-available 'no-error (list (question X 'srv 'in #f)) - (list (rr X 'srv 'in 882 (srv 20 0 5269 (domain '(#"xmpp-server4" #"l" #"google" #"com")))) - (rr X 'srv 'in 882 (srv 5 0 5269 (domain '(#"xmpp-server" #"l" #"google" #"com")))) - (rr X 'srv 'in 882 (srv 20 0 5269 (domain '(#"xmpp-server1" #"l" #"google" #"com")))) - (rr X 'srv 'in 882 (srv 20 0 5269 (domain '(#"xmpp-server2" #"l" #"google" #"com")))) - (rr X 'srv 'in 882 (srv 20 0 5269 (domain '(#"xmpp-server3" #"l" #"google" #"com"))))) - (list (rr (domain '(#"google" #"com")) 'ns 'in 87076 (domain '(#"ns3" #"google" #"com"))) - (rr (domain '(#"google" #"com")) 'ns 'in 87076 (domain '(#"ns4" #"google" #"com"))) - (rr (domain '(#"google" #"com")) 'ns 'in 87076 (domain '(#"ns2" #"google" #"com"))) - (rr (domain '(#"google" #"com")) 'ns 'in 87076 (domain '(#"ns1" #"google" #"com")))) - (list (rr (domain '(#"xmpp-server" #"l" #"google" #"com")) 'a 'in 282 '#(74 125 153 125)) - (rr (domain '(#"xmpp-server1" #"l" #"google" #"com")) 'a 'in 1782 '#(74 125 53 125)) - (rr (domain '(#"xmpp-server2" #"l" #"google" #"com")) 'a 'in 1782 '#(74 125 47 125)) - (rr (domain '(#"xmpp-server3" #"l" #"google" #"com")) 'a 'in 1782 '#(74 125 45 125)) - (rr (domain '(#"xmpp-server4" #"l" #"google" #"com")) 'a 'in 1782 '#(74 125 45 125)) - (rr (domain '(#"ns1" #"google" #"com")) 'a 'in 2737 '#(216 239 32 10)) - (rr (domain '(#"ns2" #"google" #"com")) 'a 'in 2737 '#(216 239 34 10)) - (rr (domain '(#"ns3" #"google" #"com")) 'a 'in 2737 '#(216 239 36 10)) - (rr (domain '(#"ns4" #"google" #"com")) 'a 'in 2737 '#(216 239 38 10)))))) + (list (rr X 'in 882 (rdata-srv 'srv 20 0 5269 (domain '(#"xmpp-server4" #"l" #"google" #"com")))) + (rr X 'in 882 (rdata-srv 'srv 5 0 5269 (domain '(#"xmpp-server" #"l" #"google" #"com")))) + (rr X 'in 882 (rdata-srv 'srv 20 0 5269 (domain '(#"xmpp-server1" #"l" #"google" #"com")))) + (rr X 'in 882 (rdata-srv 'srv 20 0 5269 (domain '(#"xmpp-server2" #"l" #"google" #"com")))) + (rr X 'in 882 (rdata-srv 'srv 20 0 5269 (domain '(#"xmpp-server3" #"l" #"google" #"com"))))) + (list (rr (domain '(#"google" #"com")) 'in 87076 (rdata-domain 'ns (domain '(#"ns3" #"google" #"com")))) + (rr (domain '(#"google" #"com")) 'in 87076 (rdata-domain 'ns (domain '(#"ns4" #"google" #"com")))) + (rr (domain '(#"google" #"com")) 'in 87076 (rdata-domain 'ns (domain '(#"ns2" #"google" #"com")))) + (rr (domain '(#"google" #"com")) 'in 87076 (rdata-domain 'ns (domain '(#"ns1" #"google" #"com"))))) + (list (rr (domain '(#"xmpp-server" #"l" #"google" #"com")) 'in 282 (rdata-ipv4 'a '#(74 125 153 125))) + (rr (domain '(#"xmpp-server1" #"l" #"google" #"com")) 'in 1782 (rdata-ipv4 'a '#(74 125 53 125))) + (rr (domain '(#"xmpp-server2" #"l" #"google" #"com")) 'in 1782 (rdata-ipv4 'a '#(74 125 47 125))) + (rr (domain '(#"xmpp-server3" #"l" #"google" #"com")) 'in 1782 (rdata-ipv4 'a '#(74 125 45 125))) + (rr (domain '(#"xmpp-server4" #"l" #"google" #"com")) 'in 1782 (rdata-ipv4 'a '#(74 125 45 125))) + (rr (domain '(#"ns1" #"google" #"com")) 'in 2737 (rdata-ipv4 'a '#(216 239 32 10))) + (rr (domain '(#"ns2" #"google" #"com")) 'in 2737 (rdata-ipv4 'a '#(216 239 34 10))) + (rr (domain '(#"ns3" #"google" #"com")) 'in 2737 (rdata-ipv4 'a '#(216 239 36 10))) + (rr (domain '(#"ns4" #"google" #"com")) 'in 2737 (rdata-ipv4 'a '#(216 239 38 10))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Zone saving/loading. @@ -473,9 +473,9 @@ (let () (define rrs - (list (rr (domain '(#"a")) 'cname 'in 30 (domain '(#"b"))) - (rr (domain '(#"b")) 'cname 'in 30 (domain '(#"c"))) - (rr (domain '(#"c")) 'cname 'in 30 (domain '(#"d"))))) + (list (rr (domain '(#"a")) 'in 30 (rdata-domain 'cname (domain '(#"b")))) + (rr (domain '(#"b")) 'in 30 (rdata-domain 'cname (domain '(#"c")))) + (rr (domain '(#"c")) 'in 30 (rdata-domain 'cname (domain '(#"d")))))) (define (check-transpose ns) (define permuted (map (lambda (i) (list-ref rrs i)) ns)) (check-equal? (cname-sort permuted) rrs))