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.
This commit is contained in:
Sanaei
2026-11-29 17:55:28 +03:30
parent 1eba41cb99
commit 26e1cd0f3e
+8 -6
View File
@@ -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)
}
}
}