diff --git a/scripts_base_path_test.go b/scripts_base_path_test.go index 516971147..13910021b 100644 --- a/scripts_base_path_test.go +++ b/scripts_base_path_test.go @@ -299,17 +299,19 @@ func TestScriptConfigReadFailureKeepsServiceSetup(t *testing.T) { } } -func TestInstallerSSLFailureStopsServiceSetup(t *testing.T) { +func TestInstallerSSLFailureKeepsServiceSetup(t *testing.T) { dir, out, err := runScriptConfig(t, "install.sh", "/a/", true, "ssl_failure", 1, true) - if err == nil { - t.Fatalf("SSL failure should abort installation before service setup:\n%s", out) + if err != nil { + t.Fatalf("a failed certificate must not abort the install: %v\n%s", err, out) } if _, err := os.Stat(filepath.Join(dir, "ssl")); err != nil { t.Fatalf("SSL setup was not attempted: %v\n%s", err, out) } - for _, name := range []string{"lifecycle", "restarts"} { - if actual := readScriptState(t, dir, name); actual != "" { - t.Errorf("failed SSL setup continued %s: %q", name, actual) + for name, want := range map[string]string{ + "lifecycle": "fail2ban\nunit\n", "restarts": "daemon-reload\nenable x-ui\nrestart x-ui\n", + } { + if actual := readScriptState(t, dir, name); actual != want { + t.Errorf("%s after a failed certificate = %q, want %q: the panel must still be installed and started", name, actual, want) } } }