Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/interplane-forge/blob/main/quiet/tests/mutants.sh # interplane-forge INTERPLANE Forge Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `interplane-forge / quiet / tests / mutants.sh` 27 lines ยท 1753 bytes Raw Blame History 1 #!/bin/bash 2 # ORACLE: negative controls for quiet/tests/check.sh. Not product code. 3 # Each mutant is one sed expression that takes one bound fix back out of the test build 4 # (QUIET_MUTANT); check.sh must then FAIL, and its log must hold the line named here. A mutant that 5 # does not build, or a run that fails for another reason only, counts as SURVIVED. 6 # QUIET_LOCK= QUIET_PORT= FORGED_CPUS= bash quiet/tests/mutants.sh [LOGDIR] 7 # About one check.sh run per mutant. 8 set -u 9 H=$(cd "$(dirname "$0")" && pwd) 10 D=${1:-$(mktemp -d /tmp/quiet-mutants.XXXXXX)} 11 mkdir -p "$D" 12 K=0; S=0 13 run() { # run NAME SED WANT: WANT is a fixed string that the failing log must contain 14 QUIET_MUTANT=$2 bash "$H/check.sh" > "$D/$1.log" 2>&1; rc=$? 15 if [ "$rc" != 0 ] && grep -q '^MUTANT ' "$D/$1.log" && grep -q -F "$3" "$D/$1.log"; then 16 K=$((K+1)); echo "KILLED $1: exit $rc; $(grep -F "$3" "$D/$1.log" | head -1)" 17 else 18 S=$((S+1)); echo "SURVIVED $1: exit $rc; $(tail -1 "$D/$1.log")" 19 fi 20 } 21 run agent-len 's/^if gt al 39$/if gt al 4096/' 'FAIL after agent of 41 bytes: server exited rc=104' 22 run repo-len 's/^if gt rl 39$/if gt rl 4096/' 'FAIL after repo of 41 bytes: server exited rc=104' 23 run canon-bound '/^fn qncanh /,/^end$/s/^for i ulong n bound 200$/for i ulong n bound 64/' 'FAIL after the .receipt of the planted 65-byte cmd: server exited rc=104' 24 run subs-line 's/^for i ulong sub e p bound 8192$/for i ulong sub e p bound 256/' 'FAIL after the 300-byte subscription line: server exited rc=104' 25 run subs-word 's/^if or gt get qnfn 0 39 gt get qnrn 0 39$/if or gt get qnfn 0 255 gt get qnrn 0 255/' 'FAIL after the 100-byte filter word: server exited rc=104' 26 echo "quiet mutants: $K killed, $S survived (logs in $D)" 27 [ "$S" = 0 ]