Files
ddns-updater-qdm12-3/pkg/publicip/dns/integration_test.go
Quentin McGaw 320d91d8e3 change(publicip/dns): use DNS over TLS only
- Fix critical issue #492
- Remove `google` dns provider since it does not support DNS over TLS
2023-06-17 13:57:41 +00:00

34 lines
616 B
Go

//go:build integration
// +build integration
package dns
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func Test_integration(t *testing.T) {
t.Parallel()
fetcher, err := New(SetProviders(Cloudflare, OpenDNS))
require.NoError(t, err)
ctx := context.Background()
publicIP1, err := fetcher.IP4(ctx)
require.NoError(t, err)
assert.NotNil(t, publicIP1)
publicIP2, err := fetcher.IP4(ctx)
require.NoError(t, err)
assert.NotNil(t, publicIP2)
assert.Equal(t, publicIP1.String(), publicIP2.String())
t.Logf("Public IP is %s", publicIP1)
}