# BST-TIMEOUT: 3600 # measured 1256 s on target 2026-08-12 (224 entries, one # # shell + one augparse each). Set at ~2.9x the measurement # # rather than just above it: this runs on a shared build # # host, and the three biggest lenses abort early here # # (see the known-red list below), so a future toolchain # # that lets them RUN makes the suite longer, not shorter. . "$BST_LIB" # augeas 1.12.0 -- the lens half of the package's own upstream suite. See # 81-augeas.test for what augeas is, what the port adds, and why the suite is # split across two files; this file is the second half and repeats none of it. # # --------------------------------------------------------------------------- # WHAT RUNS HERE, AND WHY IT IS THE MOST INFORMATIVE HALF # # $(lens_tests) -- 224 entries, one per lenses/tests/test_.aug, which is # one per lens augeas ships. Each is a symlink to lens-test-1, a six-line wrapper # that execs `augparse --nostdinc -I test_.aug`, and each .aug # file is a set of `test Lens.lns get "sample text" = { tree }` and # `test Lens.lns put ... after ... = "text"` assertions written by upstream # against real configuration-file syntax. # # So this is not 224 smoke tests. It is augeas's entire regression corpus for # bidirectional parsing: every lens compiled from source on this arm, run # forwards over sample text, and -- for the put cases -- run backwards to check # the text comes out again. It exercises the finite-automaton engine, the regexp # compiler, the typechecker and the tree/text round trip, which between them are # most of what the library does. # # THEY PARSE THE LENSES THE IMAGE ACTUALLY SHIPS. ${PTEST_PATH}/lenses is a # symlink at ${datadir}/augeas/lenses/dist -- the augeas-lenses package -- so a # lens that failed to install, or installed corrupt, is a red here rather than a # case that quietly reads a private copy. 81-augeas.test asserts both halves of # that directory are present and full-length before this file runs. # # --------------------------------------------------------------------------- # ONE CASE PER LENS, NOT ONE CASE FOR THE SET # # Each entry gets its own BST case, named for its lens, so a red says which # format broke rather than that "the lens suite" did. That matters more here than # in a small suite: a toolchain change that miscompiles one regexp construct # typically takes down a handful of related lenses and leaves 200 green, which is # a signature you can act on -- and which a single aggregate case would hide # behind a number. ptestdir=/usr/lib/augeas/ptest # Upstream's own count, staged by do_install_ptest from the generated # tests/Makefile rather than typed. Upstream keeps $(lens_tests) in step with # lenses/tests/*.aug through its own `check-lens-tests` rule, so this number # moves on a version bump and is asserted rather than assumed. want_lens=224 tmp=${TMPDIR:-/tmp}/bst-augeas-lenses.$$ mkdir -p "$tmp" 2>/dev/null || tmp=/tmp check_rc augeas-lenses/ptest-dir 0 test -d "$ptestdir" check_rc augeas-lenses/lensdir 0 test -d "$ptestdir/lenses" # THE THREE EXPECTED REDS, AND WHY THEY ARE NOT A PORT DEFECT. # # augeas compiles each lens into a finite automaton before it can parse anything, # and for its three largest lenses that compiler is extravagant -- measured peak # RSS of the SAME augparse on the SAME files, x86-64 native: # # hosts 4 MB openvpn 1.94 GB # keepalived 404 MB sysconfig 749 MB # dns_zone 624 MB # # A wasm32 guest process cannot hold that. The ceiling is bracketed by this very # suite: keepalived at 404 MB is the largest lens that passes, dns_zone at 624 MB # the smallest that fails, and all three failures are augeas's own allocator # saying so ("exception: not enough memory") on a guest with ~900 MB free. # Raising the per-process budget does not reach them either -- the host refuses # the Worker outright at --user-ram 512 (host_spawn_process_worker failed: -12). # Measurement and bracket recorded on brintos/hardwarejs#7. # # So these three are a resource ceiling, not a regression: 221 of 224 lenses -- # every lens anyone would plausibly edit on this target -- parse and put back # correctly. Listed by name so the assertion below can tell them from a real one. KNOWN_RED='dns_zone openvpn sysconfig' red_why() { case " $KNOWN_RED " in *" $1 "*) echo "lens too large for a wasm32 process (needs 0.6-1.9 GB natively; brintos/hardwarejs#7)" ;; *) echo "upstream lens test failed" ;; esac } # One run, one capture, then a `while read` that spawns nothing per case. out=$tmp/lens.out sh "$ptestdir/run-ptest" lens > "$out" 2>&1 npass=0 nfail=0 nskip=0 failed= while read -r verdict name _rest; do # lens-.sh -> , so the case reads augeas-lenses/hosts rather than # augeas-lenses/lens-hosts.sh. Done with ${} substring operators, which ash # implements as builtins; a `sed` per case would be 224 extra execs and the # spawn budget is the whole reason this file exists separately. short=${name#lens-}; short=${short%.sh} case "$verdict" in PASS:) bst_ok "augeas-lenses/$short"; npass=$((npass + 1)) ;; FAIL:) bst_notok "augeas-lenses/$short" "$(red_why "$short")"; nfail=$((nfail + 1)) failed="$failed $short" ;; SKIP:) bst_skip "augeas-lenses/$short" "upstream self-skip (exit 77)"; nskip=$((nskip + 1)) ;; esac done < "$out" # A short total means entries never ran -- a killed run, a truncated capture, a # missing payload -- and without this assertion that reads as a shorter green # suite. The native reference passes all 224 with no skips. check_eq augeas-lenses/suite-total "$want_lens" "$((npass + nfail + nskip))" # THE RED SET, NOT THE RED COUNT. Three lenses cannot compile in a wasm32 # process and are expected red (see KNOWN_RED above); asserting `nfail == 3` # would stay green if one of them started passing while a fourth broke. So # compare the SORTED SET of failing names against the expected set: a new red, # a fixed red, or a swap all move it. `tr`+`sort` is two execs for the whole # suite, not per case. got=$(printf '%s\n' $failed | sort | tr '\n' ' ') want=$(printf '%s\n' $KNOWN_RED | sort | tr '\n' ' ') check_eq augeas-lenses/known-red-set "$want" "$got" rm -rf "$tmp"