dnscrypttest

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2026 License: Unlicense Imports: 9 Imported by: 0

Documentation

Overview

Package dnscrypttest contains common testing constants and utilities.

Index

Constants

View Source
const (
	// Timeout is a common timeout for tests.
	Timeout = time.Second

	// TTL is a common DNS record TTL value that is used for testing.
	TTL = 5 * time.Minute

	// Hostname is a common hostname for tests.
	Hostname = "test.example"

	// FQDN is a common FQDN value for tests.  It is FQDN for [Hostname].
	FQDN = Hostname + "."
)

Variables

View Source
var (
	// Logger is a common logger for tests.
	Logger = slogutil.NewDiscardLogger()

	// testIPv4 is a common IPv4 address that is used for testing.
	IPv4 = netip.MustParseAddr("192.0.2.0")
)

Functions

func AssertDefaultDNSMessageResponse

func AssertDefaultDNSMessageResponse(tb testing.TB, reply *dns.Msg)

AssertDefaultDNSMessageResponse is a helper that verifies that the reply matches the default expectations.

func NewDNSMessage

func NewDNSMessage() (msg *dns.Msg)

NewDNSMessage is a helper that returns DNS message with default parameters.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL