Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pam/integration-tests/ssh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ Wait@%dms`, sshDefaultFinalWaitTimeout),
td := newTapeData(tc.tape, append(defaultTapeSettings, tc.tapeSettings...)...)
td.Command = tapeCommand
td.Env[pam_test.RunnerEnvSupportsConversation] = "1"
td.Env["HOME"] = t.TempDir()
td.Env[pamSSHUserEnv] = user
td.Env["AUTHD_PAM_SSH_ARGS"] = strings.Join([]string{
"-p", sshdPort,
Expand Down
13 changes: 11 additions & 2 deletions pam/integration-tests/vhs-helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,24 @@ func (td tapeData) RunVhs(t *testing.T, testType vhsTestType, outDir string, cli
cmd.Env = append(testutils.AppendCovEnv(cmd.Env), cliEnv...)
cmd.Dir = outDir

// If vhs is installed with "go install", we need to add GOPATH to PATH.
cmd.Env = append(cmd.Env, prependBinToPath(t))
cmd.Env = append(cmd.Env,
// If vhs is installed with "go install", we need to add GOPATH to PATH.
prependBinToPath(t),
// vhs uses rod, which downloads chromium to $HOME/.cache/rod,
// so $HOME needs to be set to avoid that it downloads it every time.
// TODO: Set XDG_CACHE_HOME instead once https://github.com/go-rod/rod/pull/1213 was merged
"HOME="+os.Getenv("HOME"),
)

u, err := user.Current()
require.NoError(t, err, "Setup: getting current user")
if u.Name == "root" || os.Getenv("SCHROOT_CHROOT_NAME") != "" {
cmd.Env = append(cmd.Env, "VHS_NO_SANDBOX=1")
}

// Set a temporary HOME directory to avoid interference with the user's home directory.
td.Env["HOME"] = t.TempDir()

// Move some of the environment specific-variables from the tape to the launched process
if e, ok := td.Env[pam_test.RunnerEnvLogFile]; ok {
delete(td.Env, pam_test.RunnerEnvLogFile)
Expand Down
Loading