Merge pull request #45813 from thaJeztah/24.0_backport_no_homedir

[24.0 backport] integration-cli: don't use pkg/homedir in test
This commit is contained in:
Sebastiaan van Stijn 2023-06-26 15:11:21 +02:00 committed by GitHub
commit 5899e935d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,6 +12,7 @@ import (
"os/exec"
"path/filepath"
"regexp"
"runtime"
"strconv"
"strings"
"syscall"
@ -22,7 +23,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"
@ -251,7 +251,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"
@ -331,7 +335,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"