package hostfloor import ( "os" "path/filepath" "testing" ) func TestParticipationPreservesFloorAndLegacyDirectoryRules(t *testing.T) { t.Setenv("CARLOS_HOST_CLAIM", "") d := Disk{Participation: floorParticipationFixture(t)} if err := d.Participation.State.Remove("census.json"); err != nil { t.Fatal(err) } data := t.TempDir() if err := d.CheckParticipation(t.Context(), data, false); err != nil { t.Fatal(err) } if err := d.ControllersIdle(t.Context(), data); err == nil { t.Fatal("floor accepted a missing controller directory") } if err := os.Symlink(t.TempDir(), filepath.Join(data, ".hostexec")); err != nil { t.Skip(err) } for _, strict := range []bool{false, true} { if err := d.CheckParticipation(t.Context(), data, strict); err == nil { t.Fatalf("symlink accepted with requireDirectory=%v", strict) } } }