summaryrefslogtreecommitdiffhomepage
path: root/ssh/tailssh/tailssh_integration_test.go
diff options
context:
space:
mode:
authorPercy Wegmann <percy@tailscale.com>2025-09-23 16:30:30 -0500
committerPercy Wegmann <percy@tailscale.com>2025-09-23 16:30:30 -0500
commit7bba8a65f384938d9df3c232b36a4eef4f64087f (patch)
treedc09b7e302133c8847c7854d8a2729bb0a242753 /ssh/tailssh/tailssh_integration_test.go
parent1791f878708ec31ef4622222a5858217e749e777 (diff)
downloadtailscale-percy/issue16983.tar.xz
tailscale-percy/issue16983.zip
Signed-off-by: Percy Wegmann <percy@tailscale.com>
Diffstat (limited to 'ssh/tailssh/tailssh_integration_test.go')
-rw-r--r--ssh/tailssh/tailssh_integration_test.go80
1 files changed, 45 insertions, 35 deletions
diff --git a/ssh/tailssh/tailssh_integration_test.go b/ssh/tailssh/tailssh_integration_test.go
index 9ab26e169..14c3e5e21 100644
--- a/ssh/tailssh/tailssh_integration_test.go
+++ b/ssh/tailssh/tailssh_integration_test.go
@@ -97,10 +97,10 @@ func TestIntegrationSSH(t *testing.T) {
debugTest.Store(false)
})
- homeDir := "/home/testuser"
- if runtime.GOOS == "darwin" {
- homeDir = "/Users/testuser"
- }
+ // homeDir := "/home/testuser"
+ // if runtime.GOOS == "darwin" {
+ // homeDir = "/Users/testuser"
+ // }
tests := []struct {
cmd string
@@ -108,40 +108,47 @@ func TestIntegrationSSH(t *testing.T) {
forceV1Behavior bool
skip bool
allowSendEnv bool
+ requiresShell bool
}{
+ // {
+ // cmd: "id",
+ // want: []string{"testuser", "groupone", "grouptwo"},
+ // forceV1Behavior: false,
+ // },
+ // {
+ // cmd: "id",
+ // want: []string{"testuser", "groupone", "grouptwo"},
+ // forceV1Behavior: true,
+ // },
+ // {
+ // cmd: "pwd",
+ // want: []string{homeDir},
+ // skip: os.Getenv("SKIP_FILE_OPS") == "1" || !fallbackToSUAvailable(),
+ // forceV1Behavior: false,
+ // },
+ // {
+ // cmd: "echo 'hello'",
+ // want: []string{"hello"},
+ // skip: os.Getenv("SKIP_FILE_OPS") == "1" || !fallbackToSUAvailable(),
+ // forceV1Behavior: false,
+ // },
+ // {
+ // cmd: `echo "${GIT_ENV_VAR:-unset1} ${EXACT_MATCH:-unset2} ${TESTING:-unset3} ${NOT_ALLOWED:-unset4}"`,
+ // want: []string{"working1 working2 working3 unset4"},
+ // forceV1Behavior: false,
+ // allowSendEnv: true,
+ // },
+ // {
+ // cmd: `echo "${GIT_ENV_VAR:-unset1} ${EXACT_MATCH:-unset2} ${TESTING:-unset3} ${NOT_ALLOWED:-unset4}"`,
+ // want: []string{"unset1 unset2 unset3 unset4"},
+ // forceV1Behavior: false,
+ // allowSendEnv: false,
+ // },
{
- cmd: "id",
- want: []string{"testuser", "groupone", "grouptwo"},
- forceV1Behavior: false,
- },
- {
- cmd: "id",
- want: []string{"testuser", "groupone", "grouptwo"},
+ cmd: `locale`,
+ want: []string{"UTF-8"},
forceV1Behavior: true,
- },
- {
- cmd: "pwd",
- want: []string{homeDir},
- skip: os.Getenv("SKIP_FILE_OPS") == "1" || !fallbackToSUAvailable(),
- forceV1Behavior: false,
- },
- {
- cmd: "echo 'hello'",
- want: []string{"hello"},
- skip: os.Getenv("SKIP_FILE_OPS") == "1" || !fallbackToSUAvailable(),
- forceV1Behavior: false,
- },
- {
- cmd: `echo "${GIT_ENV_VAR:-unset1} ${EXACT_MATCH:-unset2} ${TESTING:-unset3} ${NOT_ALLOWED:-unset4}"`,
- want: []string{"working1 working2 working3 unset4"},
- forceV1Behavior: false,
- allowSendEnv: true,
- },
- {
- cmd: `echo "${GIT_ENV_VAR:-unset1} ${EXACT_MATCH:-unset2} ${TESTING:-unset3} ${NOT_ALLOWED:-unset4}"`,
- want: []string{"unset1 unset2 unset3 unset4"},
- forceV1Behavior: false,
- allowSendEnv: false,
+ requiresShell: true,
},
}
@@ -152,6 +159,9 @@ func TestIntegrationSSH(t *testing.T) {
// run every test both without and with a shell
for _, shell := range []bool{false, true} {
+ if test.requiresShell && !shell {
+ continue
+ }
shellQualifier := "no_shell"
if shell {
shellQualifier = "shell"