Documentation ¶
Overview ¶
Package dnssvctest contains common constants and utilities for the internal DNS-service packages.
Index ¶
Constants ¶
const ( DeviceIDStr = "dev1234" ProfileIDStr = "prof1234" )
String representations of the common IDs for tests.
const ( FilterListID1Str = "flt_1" FilterListID2Str = "flt_2" )
String representations for the common filtering-rule list ID for tests.
const ( FilterListID1 agd.FilterListID = FilterListID1Str FilterListID2 agd.FilterListID = FilterListID2Str )
Common filtering-rule list ID for tests.
const ( Domain = "test.example" DomainAllowed = "allowed.example" DomainBlocked = "blocked.example" DomainRewritten = "rewritten.example" DomainRewrittenCNAME = "rewritten-cname.example" DomainFQDN = Domain + "." DomainAllowedFQDN = DomainAllowed + "." DomainBlockedFQDN = DomainBlocked + "." DomainRewrittenFQDN = DomainRewritten + "." DomainRewrittenCNAMEFQDN = DomainRewrittenCNAME + "." )
Common domains and FQDNs for tests.
const DeviceID agd.DeviceID = DeviceIDStr
DeviceID is the common device ID for tests.
const DeviceIDWildcard = "*.dns.example.com"
DeviceIDWildcard is the common wildcard domain for retrieving agd.DeviceID in tests. Use strings.ReplaceAll to replace the "*" symbol with the actual agd.DeviceID.
const ProfileID agd.ProfileID = ProfileIDStr
ProfileID is the common profile ID for tests.
const ServerName agd.ServerName = "test_server_dns_tls"
ServerName is the common server name for tests.
const Timeout time.Duration = 1 * time.Second
Timeout is the common timeout for tests.
Variables ¶
var ( ClientIP = net.IP{1, 2, 3, 4} RemoteAddr = &net.TCPAddr{ IP: ClientIP, Port: 12345, } ClientAddrPort = RemoteAddr.AddrPort() ClientAddr = ClientAddrPort.Addr() LocalAddr = &net.TCPAddr{ IP: net.IP{5, 6, 7, 8}, Port: 54321, } ServerAddrPort = LocalAddr.AddrPort() ServerAddr = ServerAddrPort.Addr() )
Common addresses for tests.
Functions ¶
func NewServer ¶
func NewServer( name agd.ServerName, proto agd.Protocol, bindData ...*agd.ServerBindData, ) (srv *agd.Server)
NewServer is a helper that returns a new *agd.Server for tests.
Types ¶
This section is empty.