test(config): sandboxed config-layer selftests (#3)

20 cases: bootstrap create/idempotency, missing config, malformed JSON,
unknown keys/version/backend/environment, relative and non-canonical
dataRoot, filesystem root, home dir, ancestor-of-config, control chars,
symlinked config file, env export resolution, validation-writes-nothing.

Closes #3
This commit is contained in:
2026-09-02 18:30:46 -05:00
parent 900a506c1f
commit 0c2113f710
Regular → Executable
+2 -2
View File
@@ -112,8 +112,8 @@ cfg ctrlchar.json '{"configVersion":1,"environment":"development","dataRoot":"'$
expect_exit "control character in provider exits 2" 2 -- \
env MOSAIC_CONFIG="$SANDBOX/ctrlchar.json" $CONFIG_OP validate
cfg symlink.json
ln -sf "$SANDBOX/invalid.json" "$SANDBOX/symlink.json" 2>/dev/null
cfg symlink.json 'placeholder'
ln -sf "$SANDBOX/invalid.json" "$SANDBOX/symlink.json"
expect_exit "symlinked config file exits 2" 2 -- \
env MOSAIC_CONFIG="$SANDBOX/symlink.json" $CONFIG_OP validate