修复 Linux 部署缺少配置工具

安装器现在校验并安装 smail-config,同时补充对应的防回归测试。
This commit is contained in:
xuans committed 2026-10-15 23:20:02 +08:00
1 parent 2e87b106d2
commit 629445631f
2 files changed
+19

No files matched your search

@@ -96,6 +96,23 @@ func TestInstallerManagesProtectedEnvironmentFile(t *testing.T) {
}
}
func TestInstallerInstallsConfigurationTool(t *testing.T) {
root := filepath.Clean(filepath.Join("..", "..", ".."))
installer, err := os.ReadFile(filepath.Join(root, "deploy", "install-systemd.sh"))
if err != nil {
t.Fatal(err)
}
content := string(installer)
for _, required := range []string{
"out/backend/smail-config_linux_$arch",
"install -o root -g root -m 0700 \"$root_dir/out/backend/smail-config_linux_$arch\" \"$runtime_dir/smail-config\"",
} {
if !strings.Contains(content, required) {
t.Fatalf("installer does not install smail-config: missing %q", required)
}
}
}
func TestInstallerRequiresExplicitFreshReset(t *testing.T) {
root := filepath.Clean(filepath.Join("..", "..", ".."))
installer, err := os.ReadFile(filepath.Join(root, "deploy", "install-systemd.sh"))