package config import ( "path/filepath" "testing" ) // R-492 — the global paths.hdd_path was deleted (it was empty on every box and every reader already // fell back to the storage registry). The consequence that matters is the OLD box: a controller.yaml // written before the deletion that still carries `hdd_path` (empty or not) must keep loading, with // every other field intact — a config that fails to parse is a controller that does not start. // RED-PROOF (REPORT): switch loadAndParse to a strict decoder (yaml KnownFields) and this fails. func TestR492_OldConfigWithHDDPathStillLoads(t *testing.T) { for _, v := range []string{`""`, `/mnt/legacy_hdd`} { y := minimalYAML(bcryptHash) + "paths:\n stacks_dir: /opt/stacks\n hdd_path: " + v + "\n" cfg, err := LoadFromBytes([]byte(y)) if err != nil { t.Fatalf("hdd_path=%s: an old config no longer loads: %v", v, err) } if cfg.Paths.StacksDir != filepath.FromSlash("/opt/stacks") && cfg.Paths.StacksDir != "/opt/stacks" { t.Errorf("hdd_path=%s: neighbouring field lost: stacks_dir=%q", v, cfg.Paths.StacksDir) } if cfg.Customer.ID != "demo" { t.Errorf("hdd_path=%s: customer.id lost: %q", v, cfg.Customer.ID) } } }