Documentation
¶
Index ¶
- func CleanupPostgres(_ *testing.T)
- func CleanupSqlite(t *testing.T)
- func CreateDefaultOrgAndTenant(t *testing.T, ctx context.Context)
- func CreateHost(t *testing.T, ctx context.Context, name string) *schema.Host
- func CreateIPv4Network(t *testing.T, ctx context.Context, name string) *schema.Network
- func CreateIPv6Network(t *testing.T, ctx context.Context, name string) *schema.Network
- func CreateIPv10Network(t *testing.T, ctx context.Context, name string) *schema.Network
- func CreateTag(t *testing.T, ctx context.Context, tagID, network string) *models.Tag
- func DeleteHost(t *testing.T, ctx context.Context, host *schema.Host)
- func DeleteNetwork(t *testing.T, ctx context.Context, network *schema.Network)
- func DeleteNode(t *testing.T, ctx context.Context, node *schema.Node)
- func DeleteTag(t *testing.T, ctx context.Context, tag *models.Tag)
- func InitPostgres(t *testing.T)
- func InitSqlite(t *testing.T)
- func RandomIPInCIDR(network *net.IPNet) (net.IP, error)
- func RandomPrivateCIDRv4(prefixLen int) (*net.IPNet, error)
- func RandomPrivateCIDRv6(prefixLen int) (*net.IPNet, error)
- func RandomPublicIPv4() (net.IP, error)
- func RandomPublicIPv6() (net.IP, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupPostgres ¶
func CleanupSqlite ¶
func CreateDefaultOrgAndTenant ¶ added in v1.7.0
CreateDefaultOrgAndTenant creates the default org/tenant, or loads them if a prior test run against the same (persistent) database already created them.
func CreateIPv4Network ¶
func CreateIPv6Network ¶
func CreateIPv10Network ¶
func InitPostgres ¶
func InitSqlite ¶
func RandomIPInCIDR ¶
RandomIPInCIDR returns a random host address within the given network. It works for both IPv4 and IPv6 CIDRs.
For IPv4 /31 and /32 (and IPv6 /127, /128) all addresses are returned as-is without filtering network/broadcast addresses, which is consistent with modern point-to-point link behaviour (RFC 3021).
func RandomPrivateCIDRv4 ¶
RandomPrivateCIDRv4 returns a random prefix within the RFC 6598 shared address space 100.64.0.0/10, with given prefix length.
func RandomPrivateCIDRv6 ¶
RandomPrivateCIDRv6 returns a random prefix within the RFC 4193 unique-local range fd00::/8 (the locally-assigned half of fc00::/7), with given prefix length.
func RandomPublicIPv4 ¶
RandomPublicIPv4 returns a random, globally-routable IPv4 address. It rejects any address that falls in a reserved/private range.
func RandomPublicIPv6 ¶
RandomPublicIPv6 returns a random, globally-routable IPv6 address. It rejects any address that falls in a reserved/private range.
Types ¶
This section is empty.