Run guest updates outside agent sandbox
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user