Implement self-update recovery (T-403)

This commit is contained in:
ila
2026-07-19 22:00:38 +08:00
parent 2900deba4f
commit 13004218cf
35 changed files with 1754 additions and 16 deletions
@@ -9,6 +9,7 @@ import (
"time"
"softbox.local/core/application/launch"
"softbox.local/core/updater"
)
func TestPlatformStubFailsClosed(t *testing.T) {
@@ -25,4 +26,13 @@ func TestPlatformStubFailsClosed(t *testing.T) {
if _, err := platform.Start(launch.Command{}); !errors.Is(err, ErrUnsupported) {
t.Fatalf("Start() error = %v, want ErrUnsupported", err)
}
if err := platform.WaitForProcessExit(context.Background(), 1, time.Second); !errors.Is(err, ErrUnsupported) {
t.Fatalf("WaitForProcessExit() error = %v, want ErrUnsupported", err)
}
if _, err := platform.StartSelfUpdate(updater.StartCommand{}); !errors.Is(err, ErrUnsupported) {
t.Fatalf("StartSelfUpdate() error = %v, want ErrUnsupported", err)
}
if err := platform.SyncDirectory("/tmp"); !errors.Is(err, ErrUnsupported) {
t.Fatalf("SyncDirectory() error = %v, want ErrUnsupported", err)
}
}