From 26e1cd0f3ed397f2b58059a808401bb1d23f2337 Mon Sep 17 00:00:00 2001 From: Sanaei Date: Sun, 29 Nov 2026 17:55:28 +0330 Subject: [PATCH] test(install): expect the installer to finish after a failed certificate The Go regression still asserted that a failed SSL setup stops the install before the service is set up, the behaviour this branch no longer has. --- scripts_base_path_test.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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) } } }