carlos / platform Public

Bootstrap service directories before opening the runner registry

Create the cold fixture data and runtime trees with the service ownership and private modes used by bootstrap and the lifecycle fixture. The service-user SQLite child must be able to create its database before staging performs the later ownership walk.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev e848535f717ae4bd6edf04cda5ae668461cdcd29 parent 1cace98
1 file changed, +8 −0
  • internal/host/haplacement_root_linux_test.go +8 −0
diff --git a/internal/host/haplacement_root_linux_test.go b/internal/host/haplacement_root_linux_test.go
index dfa681a7c..a54ee8611 100644
--- a/internal/host/haplacement_root_linux_test.go
+++ b/internal/host/haplacement_root_linux_test.go
@@ -563,6 +563,14 @@ func newColdRootHarness(t *testing.T, mode string) *coldRootHarness {
for _, path := range []string{lifecycleHome + "/deployment", "/data/.instances", "/data/instances", "/run/carlos/.instances", "/run/carlos/instances", "/run/carlos/.logs", "/run/carlos/logs", "/opt/carlos/versions"} {
lifecycleCheck(t, "tree", os.MkdirAll(path, 0755))
}
+ // openServiceRegistry creates the database as carlos. Match bootstrap and
+ // the lifecycle fixture before that first open, not only after staging.
+ for _, path := range []string{lifecycleHome, lifecycleHome + "/deployment", "/data", "/data/.instances", "/data/instances", "/run/carlos", "/run/carlos/.instances", "/run/carlos/instances", "/run/carlos/.logs", "/run/carlos/logs"} {
+ lifecycleCheck(t, "bootstrap service owner "+path, os.Chown(path, uid, gid))
+ }
+ for _, path := range []string{"/data/.instances", "/data/instances", "/run/carlos/.logs", "/run/carlos/logs"} {
+ lifecycleCheck(t, "private instance tree "+path, os.Chmod(path, 0700))
+ }
model := leasetest.NewVersionedBucket()
model.AddBucket("data")
s3, _ := leasetest.NewS3Server(model)