mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-09 13:45:26 +02:00
Port bootstrap script length limit
This commit is contained in:
@@ -27,12 +27,12 @@ func TestSSHConfigParsing(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
actual := c.final_env_instructions(for_python, func(key string) (string, bool) {
|
||||
actual := final_env_instructions(for_python, func(key string) (string, bool) {
|
||||
if key == "LOCAL_ENV" {
|
||||
return "LOCAL_VAL", true
|
||||
}
|
||||
return "", false
|
||||
})
|
||||
}, c.Env...)
|
||||
if expected_env == nil {
|
||||
expected_env = []string{}
|
||||
}
|
||||
|
||||
@@ -37,3 +37,25 @@ func TestCloneEnv(t *testing.T) {
|
||||
t.Fatalf("Failed to deserialize env\n%s", diff)
|
||||
}
|
||||
}
|
||||
|
||||
func basic_connection_data() *connection_data {
|
||||
return &connection_data{
|
||||
script_type: "sh", request_id: "123-123", remote_args: []string{}, host_opts: NewConfig(),
|
||||
username: "testuser", hostname_for_match: "host.test",
|
||||
}
|
||||
}
|
||||
|
||||
func TestSSHBootstrapScriptLimit(t *testing.T) {
|
||||
cd := basic_connection_data()
|
||||
err := get_remote_command(cd)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
total := 0
|
||||
for _, x := range cd.rcmd {
|
||||
total += len(x)
|
||||
}
|
||||
if total > 9000 {
|
||||
t.Fatalf("Bootstrap script too large: %d bytes", total)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user