fix: make agent install command proxy independent (#50)

This commit is contained in:
Wu Qing
2026-04-25 13:43:30 +08:00
committed by GitHub
parent bc8742977e
commit 67a42b09ba
13 changed files with 232 additions and 35 deletions

View File

@@ -36,3 +36,20 @@ func TestRenderScriptBashBootstrap(t *testing.T) {
t.Errorf("script missing exec bash fallback:\n%s", got)
}
}
func TestRenderScriptCreatesBackupXUserAndGroup(t *testing.T) {
got, err := RenderScript(testCtx)
if err != nil {
t.Fatalf("render err: %v", err)
}
for _, want := range []string{
"getent group backupx",
"groupadd --system backupx",
"useradd --system --gid backupx",
"Group=backupx",
} {
if !strings.Contains(got, want) {
t.Errorf("script missing %q:\n%s", want, got)
}
}
}