summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/miekg/dns/issue_test.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2017-03-24 23:31:34 -0700
committerenahum <nahumhbl@gmail.com>2017-03-25 03:31:34 -0300
commit54d3d47daf9190275bbdaf8703b84969a4593451 (patch)
tree05899b296d0186c1a0da8a540bc486e34ad8eec9 /vendor/github.com/miekg/dns/issue_test.go
parent7460302dec7796e01c98264e84bece8169cb6ed9 (diff)
downloadchat-54d3d47daf9190275bbdaf8703b84969a4593451.tar.gz
chat-54d3d47daf9190275bbdaf8703b84969a4593451.tar.bz2
chat-54d3d47daf9190275bbdaf8703b84969a4593451.zip
PLT-6076 Adding viper libs for config file changes (#5871)
* Adding viper libs for config file changes * Removing the old fsnotify lib * updating some missing libs
Diffstat (limited to 'vendor/github.com/miekg/dns/issue_test.go')
-rw-r--r--vendor/github.com/miekg/dns/issue_test.go47
1 files changed, 46 insertions, 1 deletions
diff --git a/vendor/github.com/miekg/dns/issue_test.go b/vendor/github.com/miekg/dns/issue_test.go
index 3025fc98c..265ad56c0 100644
--- a/vendor/github.com/miekg/dns/issue_test.go
+++ b/vendor/github.com/miekg/dns/issue_test.go
@@ -2,7 +2,10 @@ package dns
// Tests that solve that an specific issue.
-import "testing"
+import (
+ "strings"
+ "testing"
+)
func TestTCPRtt(t *testing.T) {
m := new(Msg)
@@ -21,3 +24,45 @@ func TestTCPRtt(t *testing.T) {
}
}
}
+
+func TestNSEC3MissingSalt(t *testing.T) {
+ rr, err := NewRR("ji6neoaepv8b5o6k4ev33abha8ht9fgc.example. NSEC3 1 1 12 aabbccdd K8UDEMVP1J2F7EG6JEBPS17VP3N8I58H")
+ if err != nil {
+ t.Fatalf("failed to parse example rr: %s", err)
+ }
+ m := new(Msg)
+ m.Answer = []RR{rr}
+ mb, err := m.Pack()
+ if err != nil {
+ t.Fatalf("expected to pack message. err: %s", err)
+ }
+ if err := m.Unpack(mb); err != nil {
+ t.Fatalf("expected to unpack message. missing salt? err: %s", err)
+ }
+ in := rr.(*NSEC3).Salt
+ out := m.Answer[0].(*NSEC3).Salt
+ if in != out {
+ t.Fatalf("expected salts to match. packed: `%s`. returned: `%s`", in, out)
+ }
+}
+
+func TestNSEC3MixedNextDomain(t *testing.T) {
+ rr, err := NewRR("ji6neoaepv8b5o6k4ev33abha8ht9fgc.example. NSEC3 1 1 12 - k8udemvp1j2f7eg6jebps17vp3n8i58h")
+ if err != nil {
+ t.Fatalf("failed to parse example rr: %s", err)
+ }
+ m := new(Msg)
+ m.Answer = []RR{rr}
+ mb, err := m.Pack()
+ if err != nil {
+ t.Fatalf("expected to pack message. err: %s", err)
+ }
+ if err := m.Unpack(mb); err != nil {
+ t.Fatalf("expected to unpack message. err: %s", err)
+ }
+ in := strings.ToUpper(rr.(*NSEC3).NextDomain)
+ out := m.Answer[0].(*NSEC3).NextDomain
+ if in != out {
+ t.Fatalf("expected round trip to produce NextDomain `%s`, instead `%s`", in, out)
+ }
+}