ec1a8ae12a
* [no ci] deps: update docker to 23.0.3 This PR brings our docker/docker dependency (which is hosted at github.com/moby/moby) up to 23.0.3 (forward about 2 years). Refactored our use of docker/libnetwork to reference the package in its new home, which is docker/docker/libnetwork (it is no longer an independent repository). Some minor nearby test case cleanup as well. * add cl
30 lines
603 B
Go
30 lines
603 B
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
//go:build !windows
|
|
|
|
package resolvconf
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
"testing"
|
|
|
|
"github.com/docker/docker/libnetwork/resolvconf"
|
|
"github.com/shoenig/test/must"
|
|
)
|
|
|
|
func Test_copySystemDNS(t *testing.T) {
|
|
data, err := os.ReadFile(resolvconf.Path())
|
|
must.NoError(t, err)
|
|
|
|
resolvConfFile := filepath.Join(t.TempDir(), "resolv.conf")
|
|
|
|
must.NoError(t, copySystemDNS(resolvConfFile))
|
|
must.FileExists(t, resolvConfFile)
|
|
|
|
tmpResolv, readErr := os.ReadFile(resolvConfFile)
|
|
must.NoError(t, readErr)
|
|
must.Eq(t, data, tmpResolv)
|
|
}
|