]> git.hungrycats.org Git - bees/commitdiff
test: isolate integration cases from the host global config
authorZygo Blaxell <bees@furryterror.org>
Fri, 24 Jul 2026 16:10:10 +0000 (12:10 -0400)
committerZygo Blaxell <bees@furryterror.org>
Sat, 10 Oct 2026 19:00:04 +0000 (15:00 -0400)
bees loads config.global-config-filename (default /etc/bees/bees.conf)
and config.local-config-filename as fallback layers UNDER the per-run
--config, so any key a case does not set inherits the host value.  The
test host's /etc/bees/bees.conf had drifted to [state] persistent = no
(anonymous hash table -> no beeshash.dat / beespoint.ini) and [rewrite]
free-min = 128K (the "cap threshold at extent size" clause then demands
freeing 100% of any sub-128K extent).  Both silently changed the baseline
of every case that did not override them:

  - persistent = no: 02, 03, 04, 05, 20 (missing state files), and the
    delayed-verify tracker in 18/19 (no persisted verify batch)
  - free-min = 128K: 09, 10, 14 (partial-free rewrites rejected, so the
    expected hole / dedupe never happened)

Disable the fallback layers in each case's config with empty
config.global-config-filename / config.local-config-filename, so defaults
come from the build (persistent = yes, free-min = 50%).  The repl case
(05) cannot pass an empty token and reading /dev/null trips a size > 0
check, so it uses boot-layer overrides (set path.home, set
state.persistent yes) which outrank the fallback; it also fixes a stale
key (paths.home -> path.home) that only worked while /etc/bees supplied
[path] home.

No product code change.  Validated on the integration host: all listed
cases pass.

Assisted-by: Claude-Code:claude-opus-4-8
test/integration/cases/02-resume.sh
test/integration/cases/03-config-options.sh
test/integration/cases/04-beeshome-paths.sh
test/integration/cases/05-bees-repl.sh
test/integration/cases/09-scan-next-tempfile.sh
test/integration/cases/10-scan-next-prealloc-mix.sh
test/integration/cases/14-scan-next-copy-only.sh
test/integration/cases/18-verify-deleted-extents.sh
test/integration/cases/19-verify-failed-orphan.sh
test/integration/cases/20-state-persistence.sh
test/integration/cases/21-scan-first-transid.sh

index 2823744617d1418dc714c81b543429361ab8ab52..488da06ee63141d1f8e9b614cd081b4ed067e61a 100755 (executable)
@@ -81,6 +81,9 @@ echo "[pass] phase1 pre: orig and dup2 use different extents"
 echo "[phase1] running bees"
 mkdir -p '${BEESHOME}' '${TEST_LOG_DIR}'
 cat > '${BEESHOME}/bees.conf' <<'CONF'
+[config]
+global-config-filename =
+local-config-filename =
 [loop]
 exit-one-pass = yes
 
@@ -154,6 +157,9 @@ echo "[phase2] running bees (resume)"
 
 # Remove exit-one-pass for phase 2 — bees runs until we stop it.
 cat > '${BEESHOME}/bees.conf' <<'CONF'
+[config]
+global-config-filename =
+local-config-filename =
 [loop]
 poll-min = 5s
 
index a27232d0b8a20bc1ef02b215bf5a033ed9aa72a7..c3a68ad6369bbb41af24e118988a6276bf4d6c2c 100644 (file)
@@ -73,6 +73,9 @@ echo "[pass] pre-bees: files use different extents"
 echo "[phase1] testing inline config"
 mkdir -p '${BEESHOME}' '${TEST_LOG_DIR}'
 cat > '${BEESHOME}/bees.conf' <<'CONF'
+[config]
+global-config-filename =
+local-config-filename =
 [loop]
 exit-when-finished = yes
 CONF
index a89290c069db21d73d48dfc168729324d59e8c95..551a62ccf34d7973fb4647f234dab8cbab180975 100644 (file)
@@ -92,6 +92,9 @@ echo "[pass] pre-bees: files use different extents"
 # phase 1 so bees exits cleanly after completing deduplication).
 mkdir -p '${TEST_LOG_DIR}'
 cat > '${IT_BEES_CONF}' <<'CONF'
+[config]
+global-config-filename =
+local-config-filename =
 [loop]
 exit-when-finished = yes
 CONF
index ffbca664087fdbaddf712d2cc442e49969f789f7..89145daebef88282003577ce8d8978bc9c3ce1ec 100755 (executable)
@@ -681,7 +681,8 @@ TESTHASH=0xdeadbeefcafe0001
 TESTADDR=0x4000   # 16384: a valid btrfs-aligned address (multiple of 4096)
 
 it_repl "$BEESHOME" <<REPL
-set paths.home $BEESHOME
+set path.home $BEESHOME
+set state.persistent yes
 open-root $TEST_MOUNT
 apply-config
 open-home
index da3efe82ede0408b629fb6ffca8e40143bf648d7..dc29d3002e1018c9d7e81cccfbf8023bd3417bdc 100755 (executable)
@@ -89,6 +89,9 @@ echo "[pass] setup: mixedfile initially has no interior hole"
 # ── Write bees config ──────────────────────────────────────────────────────────
 mkdir -p '${BEESHOME}'
 cat > '${BEESHOME}/bees.conf' <<'CONF'
+[config]
+global-config-filename =
+local-config-filename =
 [log.plan]
 level = 8
 
index f4eb940a00fa1297f6d60775c6d8dd31a02fb293..ede8ed7819cdc23b27a719ec117828801b7a41d3 100755 (executable)
@@ -74,6 +74,9 @@ echo "[pass] setup: preallocmix has a disk_bytenr"
 # ── Write bees config ──────────────────────────────────────────────────────────
 mkdir -p '${BEESHOME}'
 cat > '${BEESHOME}/bees.conf' <<'CONF'
+[config]
+global-config-filename =
+local-config-filename =
 [log.plan]
 level = 8
 
index 1558bbddc7defb1acd8f6bc61a4e6f617dd5fea1..49a950d24e3a48e82bf3406096d42ca2c916d55f 100755 (executable)
@@ -117,6 +117,9 @@ btrfs filesystem sync '${TEST_MOUNT}'
 # ── Write bees config ──────────────────────────────────────────────────────────
 mkdir -p '${BEESHOME}'
 cat > '${BEESHOME}/bees.conf' <<'CONF'
+[config]
+global-config-filename =
+local-config-filename =
 [log.plan]
 level = 8
 
index 0fe6960794c37c37e5dac8b4bfe58c395636e118..e7eafccd816f81a7635b81cec020f467db4e93ed 100755 (executable)
@@ -66,6 +66,9 @@ echo "[pass] setup: orig and dup1 use different extents"
 # ── Write bees config ──────────────────────────────────────────────────────────
 mkdir -p '${BEESHOME}' '${TEST_LOG_DIR}'
 cat > '${BEESHOME}/bees.conf' <<'CONF'
+[config]
+global-config-filename =
+local-config-filename =
 [thread]
 thread-max = 1
 
index e569ee2e114804d066cf17a33fe5fac2e5b8dbf6..51564349c1c19b4a39f28d513b91bea46eb593fb 100755 (executable)
@@ -76,6 +76,9 @@ echo "[setup] orphan inodes created (fds 8 and 9 held open)"
 # Run bees.
 mkdir -p '$BEESHOME' '$TEST_LOG_DIR'
 cat > '$BEESHOME/bees.conf' <<'CONF'
+[config]
+global-config-filename =
+local-config-filename =
 [loop]
 poll-min = 5s
 
index 28d979e0ec7af2472f4df65a77d374ad4d60e143..747a89d408b82e250e6b349d4d1665bb5cb2ce73 100755 (executable)
@@ -103,6 +103,9 @@ echo "[pass] phase1 pre: files use different extents"
 
 P1_CONF="\$P1_HOME/bees.conf"
 cat > "\$P1_CONF" <<'CONF'
+[config]
+global-config-filename =
+local-config-filename =
 [loop]
 exit-when-finished = yes
 
@@ -143,6 +146,9 @@ P1B_HOME='${TEST_MOUNT}/.beeshome-p1b-does-not-exist'
 [[ ! -e "\$P1B_HOME" ]] || rm -rf "\$P1B_HOME"
 
 cat > "\$P1B_CONF" <<'CONF'
+[config]
+global-config-filename =
+local-config-filename =
 [loop]
 exit-when-finished = yes
 
@@ -202,6 +208,9 @@ btrfs filesystem sync '${TEST_MOUNT}'
 # Short interval forces at least one checkpoint write during the run.
 P2_CONF="\$P2_HOME/bees.conf"
 cat > "\$P2_CONF" <<'CONF'
+[config]
+global-config-filename =
+local-config-filename =
 [loop]
 exit-when-finished = yes
 
@@ -244,6 +253,9 @@ btrfs filesystem sync '${TEST_MOUNT}'
 
 P3A_CONF="\$P3_HOME/bees-16m.conf"
 cat > "\$P3A_CONF" <<'CONF'
+[config]
+global-config-filename =
+local-config-filename =
 [loop]
 exit-when-finished = yes
 
@@ -268,6 +280,9 @@ echo "[pass] phase3a: beeshash.dat created at 16 MiB (\$SIZE_16M bytes)"
 echo "[phase3b] resizing hash table to 32M with state.hash.resize=yes"
 P3B_CONF="\$P3_HOME/bees-32m.conf"
 cat > "\$P3B_CONF" <<'CONF'
+[config]
+global-config-filename =
+local-config-filename =
 [loop]
 exit-when-finished = yes
 
index 98e51cac4657d1f52f227df60a8a010269ee1a2d..a43bc2df61060486eff8445e41087f7cae89a604 100755 (executable)
@@ -117,6 +117,9 @@ P1_HOME='${TEST_MOUNT}/.beeshome-p1'
 mkdir -p "\$P1_HOME"
 P1_CONF="\$P1_HOME/bees.conf"
 cat > "\$P1_CONF" <<'CONF'
+[config]
+global-config-filename =
+local-config-filename =
 [loop]
 exit-when-finished = yes
 
@@ -158,6 +161,9 @@ P2_HOME='${TEST_MOUNT}/.beeshome-p2'
 mkdir -p "\$P2_HOME"
 P2_CONF="\$P2_HOME/bees.conf"
 cat > "\$P2_CONF" <<'CONF'
+[config]
+global-config-filename =
+local-config-filename =
 [loop]
 exit-when-finished = yes
 
@@ -209,6 +215,9 @@ bump_transid
 
 P3_CONF="\$P2_HOME/bees-p3.conf"
 cat > "\$P3_CONF" <<'CONF'
+[config]
+global-config-filename =
+local-config-filename =
 [loop]
 exit-when-finished = yes