Run guest updates outside agent sandbox

This commit is contained in:
Maxim
2026-08-21 22:09:35 +03:00
parent f764195ba5
commit 1296d052a5
3 changed files with 67 additions and 18 deletions

View File

@@ -2,6 +2,7 @@ package main
import (
"encoding/json"
"strings"
"testing"
"time"
)
@@ -42,6 +43,12 @@ func TestAgentActionAllowlistAndLifecycle(t *testing.T) {
if err != nil || len(items) != 3 || items[0].Status != "completed" {
t.Fatalf("items=%#v err=%v", items, err)
}
if _, err = store.QueueAgentAction("a", "system-reboot", ""); err != nil {
t.Fatalf("system reboot rejected: %v", err)
}
if _, err = store.QueueAgentAction("a", "system-reboot", "now"); err == nil {
t.Fatal("system reboot with unexpected target accepted")
}
}
func TestManualServiceLinkGroupsOfflineAlerts(t *testing.T) {
@@ -61,3 +68,10 @@ func TestManualServiceLinkGroupsOfflineAlerts(t *testing.T) {
t.Fatalf("group alert missing: %#v", grouped)
}
}
func TestExplainReadOnlySystemUpdateError(t *testing.T) {
message := explainSystemUpdateError("ERROR: apt failed: Read-only file system")
if !strings.Contains(message, "v0.19.2") {
t.Fatalf("read-only failure is not actionable: %s", message)
}
}