integration-cli: don't use pkg/homedir in test

I'm considering deprecating the "Key()" utility, as it was only
used in tests.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-06-26 13:39:43 +02:00
parent 56261fabcb
commit 0215a62d5b
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -11,6 +11,7 @@ import (
"os/exec"
"path/filepath"
"regexp"
"runtime"
"strconv"
"strings"
"syscall"
@ -21,7 +22,6 @@ import (
"github.com/docker/docker/client"
"github.com/docker/docker/integration-cli/cli"
"github.com/docker/docker/integration-cli/cli/build"
"github.com/docker/docker/pkg/homedir"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/pkg/sysinfo"
"github.com/moby/sys/mount"
@ -250,7 +250,11 @@ func (s *DockerCLIRunSuite) TestRunAttachDetachFromConfig(c *testing.T) {
os.Mkdir(dotDocker, 0600)
tmpCfg := filepath.Join(dotDocker, "config.json")
c.Setenv(homedir.Key(), tmpDir)
if runtime.GOOS == "windows" {
c.Setenv("USERPROFILE", tmpDir)
} else {
c.Setenv("HOME", tmpDir)
}
data := `{
"detachKeys": "ctrl-a,a"
@ -330,7 +334,11 @@ func (s *DockerCLIRunSuite) TestRunAttachDetachKeysOverrideConfig(c *testing.T)
os.Mkdir(dotDocker, 0600)
tmpCfg := filepath.Join(dotDocker, "config.json")
c.Setenv(homedir.Key(), tmpDir)
if runtime.GOOS == "windows" {
c.Setenv("USERPROFILE", tmpDir)
} else {
c.Setenv("HOME", tmpDir)
}
data := `{
"detachKeys": "ctrl-e,e"