Claims cleanup R2: retire the two real-payload root-runner tests (review P2)
TestPlan14RealConsoleRootRunnerPayload and TestPlan14RealWoodstarRootRunnerPayload could only be fed by the embed files and the script R2 deleted, so they always failed. They go with their exclusive helpers: plan14WoodstarProgram (its file), plan14ConsoleBinaryProgram, the two executable vars and the binary: and woodstar: modes of plan14InstalledClaimLaunch. No J4 family names them. The census overlay is unchanged on regeneration.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 files changed,
+2
−140
internal/host/plan14_console_root_linux_test.go+0 −15internal/host/plan14_installed_launch_root_linux_test.go+2 −49internal/host/plan14_woodstar_root_linux_test.go+0 −76
CI passed — run details
diff --git a/internal/host/plan14_console_root_linux_test.go b/internal/host/plan14_console_root_linux_test.go| index a8ceb2394..99396de7a 100644 |
| --- a/internal/host/plan14_console_root_linux_test.go |
| +++ b/internal/host/plan14_console_root_linux_test.go |
| @@ -3,8 +3,6 @@ |
| package host |
| import ( |
| - "crypto/ed25519" |
| - "encoding/base64" |
| "encoding/json" |
| "fmt" |
| "io" |
| @@ -12,7 +10,6 @@ import ( |
| "net/http" |
| "net/url" |
| "os" |
| - "path/filepath" |
| "strings" |
| "sync/atomic" |
| "testing" |
| @@ -122,15 +119,3 @@ func plan14ConsoleProgram(t *testing.T, host, endpoint string) (claimUnitProgram |
| } |
| } |
| } |
| - |
| -func plan14ConsoleBinaryProgram(t *testing.T, p claimUnitProgram) claimUnitProgram { |
| - t.Helper() |
| - pub, _, err := ed25519.GenerateKey(nil) |
| - if err != nil { |
| - t.Fatal(err) |
| - } |
| - p.Args = []string{"serve"} |
| - p.Env = p.Env[1:] |
| - p.Env = append(p.Env, "CONSOLE_ORIGIN=http://tenant", "CARLOS_RELEASE_PUBKEY="+base64.StdEncoding.EncodeToString(pub), "CARLOS_DEPLOYMENT_DIR="+filepath.Join(provision.InstanceDir("/data", p.Host), "deployment"), "AWS_EC2_METADATA_DISABLED=true") |
| - return p |
| -} |
diff --git a/internal/host/plan14_installed_launch_root_linux_test.go b/internal/host/plan14_installed_launch_root_linux_test.go| index fced39421..b9c34042c 100644 |
| --- a/internal/host/plan14_installed_launch_root_linux_test.go |
| +++ b/internal/host/plan14_installed_launch_root_linux_test.go |
| @@ -120,22 +120,6 @@ func TestPlan14ConsoleLibraryRootRunner(t *testing.T) { |
| plan14InstalledClaimLaunch(t, "console:materialized:tcp") |
| } |
| -var plan14ConsoleExecutable, plan14WoodstarExecutable []byte |
| - |
| -func TestPlan14RealConsoleRootRunnerPayload(t *testing.T) { |
| - if len(plan14ConsoleExecutable) == 0 { |
| - t.Fatal("build the real executable with scripts/plan14-console-root-runner.sh") |
| - } |
| - plan14InstalledClaimLaunch(t, "binary:console:materialized:tcp") |
| -} |
| - |
| -func TestPlan14RealWoodstarRootRunnerPayload(t *testing.T) { |
| - if len(plan14WoodstarExecutable) == 0 { |
| - t.Fatal("set PLAN14_WOODSTAR_SOURCE when running scripts/plan14-console-root-runner.sh") |
| - } |
| - plan14InstalledClaimLaunch(t, "woodstar:materialized:tcp") |
| -} |
| - |
| func TestPlan14NamedStartupDefersReplacementRootRunner(t *testing.T) { |
| for _, mode := range []string{"tcp", "socket-program", "backing-program"} { |
| t.Run(mode, func(t *testing.T) { plan14InstalledClaimLaunch(t, "defer:migrated:materialized:"+mode) }) |
| @@ -151,12 +135,8 @@ func plan14InstalledClaimLaunch(t *testing.T, boundUnit string, runtimeUpdate .. |
| if verifiedOrdinary { |
| boundUnit = "" |
| } |
| - woodstar := strings.HasPrefix(boundUnit, "woodstar:") |
| - boundUnit = strings.TrimPrefix(boundUnit, "woodstar:") |
| deferReplacement := strings.HasPrefix(boundUnit, "defer:") |
| boundUnit = strings.TrimPrefix(boundUnit, "defer:") |
| - consoleBinary := strings.HasPrefix(boundUnit, "binary:") |
| - boundUnit = strings.TrimPrefix(boundUnit, "binary:") |
| realConsole := strings.HasPrefix(boundUnit, "console:") |
| boundUnit = strings.TrimPrefix(boundUnit, "console:") |
| isolation := strings.HasPrefix(boundUnit, "isolation:") |
| @@ -239,23 +219,8 @@ func plan14InstalledClaimLaunch(t *testing.T, boundUnit string, runtimeUpdate .. |
| var checkService func(*http.Client) |
| if realConsole { |
| program, checkService = plan14ConsoleProgram(t, host, endpoint) |
| - if consoleBinary { |
| - if len(plan14ConsoleExecutable) == 0 { |
| - t.Fatal("real console executable missing") |
| - } |
| - program = plan14ConsoleBinaryProgram(t, program) |
| - } |
| - } |
| - if woodstar { |
| - if len(plan14WoodstarExecutable) == 0 { |
| - t.Fatal("real Woodstar executable missing") |
| - } |
| - program, checkService = plan14WoodstarProgram(t, host, endpoint) |
| } |
| healthURL := "http://tenant/" |
| - if woodstar { |
| - healthURL += "healthz" |
| - } |
| programRaw, _ := json.Marshal(program) |
| programSum := sha256.Sum256(programRaw) |
| if boundUnit == "backing" { |
| @@ -606,12 +571,6 @@ func plan14InstalledClaimLaunch(t *testing.T, boundUnit string, runtimeUpdate .. |
| t.Fatal(err) |
| } |
| runnerBody := body |
| - if consoleBinary { |
| - body = plan14ConsoleExecutable |
| - } |
| - if woodstar { |
| - body = plan14WoodstarExecutable |
| - } |
| for _, v := range []string{"v1", "v3"} { |
| if err := release.StageArtifact("/opt/carlos", rec.Account, v, rec.App, body); err != nil { |
| t.Fatal(err) |
| @@ -743,7 +702,7 @@ func plan14InstalledClaimLaunch(t *testing.T, boundUnit string, runtimeUpdate .. |
| if checkService != nil { |
| checkService(client) |
| } |
| - if isolation || realConsole || woodstar { |
| + if isolation || realConsole { |
| if tcpMode { |
| siblingTransport := &http.Transport{DialContext: func(ctx context.Context, _, _ string) (net.Conn, error) { |
| return (&net.Dialer{}).DialContext(ctx, "unix", filepath.Join(provision.InstanceRunDir("sibling.example"), "app.sock")) |
| @@ -760,7 +719,7 @@ func plan14InstalledClaimLaunch(t *testing.T, boundUnit string, runtimeUpdate .. |
| } |
| } |
| for _, name := range func() []string { |
| - if realConsole || woodstar { |
| + if realConsole { |
| return nil |
| } |
| return []string{"console", "sibling"} |
| @@ -831,12 +790,6 @@ func plan14InstalledClaimLaunch(t *testing.T, boundUnit string, runtimeUpdate .. |
| t.Fatal(records, err) |
| } |
| v1 := records[0] |
| - if consoleBinary || woodstar { |
| - running, err := os.ReadFile(fmt.Sprintf("/proc/%d/exe", v1.Process.TenantPID)) |
| - if err != nil || sha256.Sum256(running) != sha256.Sum256(body) { |
| - t.Fatal("running service is not the built executable", err) |
| - } |
| - } |
| if v1.Process.PID != response.Grant.PID || v1.Process.Containment != 1 || v1.Process.TenantPID == 0 { |
| t.Fatal("missing production process evidence", v1) |
| } |
diff --git a/internal/host/plan14_woodstar_root_linux_test.go b/internal/host/plan14_woodstar_root_linux_test.go| deleted file mode 100644 |
| index 7131e7279..000000000 |
| --- a/internal/host/plan14_woodstar_root_linux_test.go |
| +++ /dev/null |
| @@ -1,76 +0,0 @@ |
| -//go:build linux && rootrunner |
| - |
| -package host |
| - |
| -import ( |
| - "database/sql" |
| - "encoding/json" |
| - "io" |
| - "net" |
| - "net/http" |
| - "net/url" |
| - "sync/atomic" |
| - "testing" |
| - "time" |
| - |
| - "github.com/carlosframework/platform/internal/provision" |
| -) |
| - |
| -func plan14WoodstarProgram(t *testing.T, host, endpoint string) (claimUnitProgram, func(*http.Client)) { |
| - t.Helper() |
| - ln, err := net.Listen("tcp", "127.0.0.1:0") |
| - if err != nil { |
| - t.Fatal(err) |
| - } |
| - var contacted atomic.Int64 |
| - srv := &http.Server{Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| - contacted.Add(1) |
| - io.WriteString(w, `<html><head><title>runner upstream</title></head></html>`) |
| - })} |
| - go srv.Serve(ln) |
| - t.Cleanup(func() { srv.Close() }) |
| - upstream := "http://" + ln.Addr().String() |
| - dbPath := provision.NestedDBPath("/data", host) |
| - p := claimUnitProgram{Schema: 1, Host: host, Args: []string{"-addr", endpoint, "-db", dbPath, "-allow-private"}} |
| - var savedKey string |
| - var savedFetch int64 |
| - return p, func(c *http.Client) { |
| - t.Helper() |
| - resp, err := c.Get("http://tenant/unfurl?url=" + url.QueryEscape(upstream)) |
| - if err != nil { |
| - t.Fatal(err) |
| - } |
| - var card map[string]any |
| - err = json.NewDecoder(resp.Body).Decode(&card) |
| - resp.Body.Close() |
| - if err != nil || resp.StatusCode != http.StatusOK || card["ok"] != false || contacted.Load() != 0 { |
| - t.Fatal("Woodstar containment allowed sibling fetch", resp.Status, card, contacted.Load(), err) |
| - } |
| - db, err := sql.Open("sqlite", dbPath) |
| - if err != nil { |
| - t.Fatal(err) |
| - } |
| - defer db.Close() |
| - var key string |
| - if err := db.QueryRow("SELECT value FROM config WHERE key = 'img_sign_key'").Scan(&key); err != nil || len(key) != 64 { |
| - t.Fatal("Woodstar did not persist its signing key", err) |
| - } |
| - var fetched int64 |
| - if err := db.QueryRow("SELECT fetched_at FROM cards WHERE url = ? AND ok = 0", upstream).Scan(&fetched); err != nil || fetched <= 0 { |
| - t.Fatal("Woodstar did not persist its cache", err, fetched) |
| - } |
| - if savedKey != "" && (savedKey != key || savedFetch != fetched) { |
| - t.Fatal("Woodstar restart lost persistent state") |
| - } |
| - savedKey, savedFetch = key, fetched |
| - control := &http.Client{Timeout: time.Second} |
| - resp, err = control.Get(upstream) |
| - if err != nil { |
| - t.Fatal(err) |
| - } |
| - resp.Body.Close() |
| - if contacted.Swap(0) != 1 { |
| - t.Fatal("upstream control did not connect") |
| - } |
| - } |
| -} |