mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-22 07:38:45 +05:00
Correctly dnsAgent integration test for suppliers
This commit is contained in:
committed by
Dan Christian Bogos
parent
613b03d4f7
commit
5f506e08d6
@@ -177,24 +177,25 @@ func testDNSitClntNAPTRSuppliers(t *testing.T) {
|
||||
if err := dnsClnt.WriteMsg(m); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if rply, err := dnsClnt.ReadMsg(); err != nil {
|
||||
rply, err := dnsClnt.ReadMsg()
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
} else if len(rply.Answer) != 2 {
|
||||
t.Errorf("wrong number of records: %s", utils.ToIJSON(rply.Answer))
|
||||
if rply.Rcode != dns.RcodeSuccess {
|
||||
t.Errorf("failed to get an valid answer\n%v", rply)
|
||||
}
|
||||
answr := rply.Answer[0].(*dns.NAPTR)
|
||||
if answr.Order != 100 {
|
||||
t.Errorf("received: <%v>", answr.Order)
|
||||
}
|
||||
if answr.Regexp != "!^(.*)$!sip:1@172.16.1.11!" {
|
||||
t.Errorf("received: <%q>", answr.Regexp)
|
||||
}
|
||||
answr2 := rply.Answer[1].(*dns.NAPTR)
|
||||
if answr2.Regexp != "!^(.*)$!sip:\\1@172.16.1.12!" {
|
||||
t.Errorf("received: <%q>", answr.Regexp)
|
||||
}
|
||||
}
|
||||
if rply.Rcode != dns.RcodeSuccess {
|
||||
t.Errorf("failed to get an valid answer\n%v", rply)
|
||||
}
|
||||
answr := rply.Answer[0].(*dns.NAPTR)
|
||||
if answr.Order != 100 {
|
||||
t.Errorf("received: <%v>", answr.Order)
|
||||
}
|
||||
if answr.Regexp != "!^(.*)$!sip:1@172.16.1.11!" {
|
||||
t.Errorf("received: <%q>", answr.Regexp)
|
||||
}
|
||||
answr2 := rply.Answer[1].(*dns.NAPTR)
|
||||
if answr2.Regexp != "!^(.*)$!sip:\\1@172.16.1.12!" {
|
||||
t.Errorf("received: <%q>", answr.Regexp)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user