mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-05 11:11:13 +00:00
- Run the Weave integrations regardless of if weave is detected. - Make everything backoff and not spam the logs. - Add miekg dns to vendor. - Have the app periodically register with weaveDNS, and the probe do lookups there. - Decide what the local networks are at runtime, not once at startup. - Correctly resolve app ids, fixes #825
49 lines
540 B
Go
49 lines
540 B
Go
package dns
|
|
|
|
import "testing"
|
|
|
|
func TestOPTTtl(t *testing.T) {
|
|
e := &OPT{}
|
|
e.Hdr.Name = "."
|
|
e.Hdr.Rrtype = TypeOPT
|
|
|
|
if e.Do() {
|
|
t.Fail()
|
|
}
|
|
|
|
e.SetDo()
|
|
if !e.Do() {
|
|
t.Fail()
|
|
}
|
|
|
|
oldTtl := e.Hdr.Ttl
|
|
|
|
if e.Version() != 0 {
|
|
t.Fail()
|
|
}
|
|
|
|
e.SetVersion(42)
|
|
if e.Version() != 42 {
|
|
t.Fail()
|
|
}
|
|
|
|
e.SetVersion(0)
|
|
if e.Hdr.Ttl != oldTtl {
|
|
t.Fail()
|
|
}
|
|
|
|
if e.ExtendedRcode() != 0 {
|
|
t.Fail()
|
|
}
|
|
|
|
e.SetExtendedRcode(42)
|
|
if e.ExtendedRcode() != 42 {
|
|
t.Fail()
|
|
}
|
|
|
|
e.SetExtendedRcode(0)
|
|
if e.Hdr.Ttl != oldTtl {
|
|
t.Fail()
|
|
}
|
|
}
|