summaryrefslogtreecommitdiff
path: root/9ns/test/adv_bridge_semantics.sh
diff options
context:
space:
mode:
Diffstat (limited to '9ns/test/adv_bridge_semantics.sh')
-rwxr-xr-x9ns/test/adv_bridge_semantics.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/9ns/test/adv_bridge_semantics.sh b/9ns/test/adv_bridge_semantics.sh
index b38ce9c..526ebc8 100755
--- a/9ns/test/adv_bridge_semantics.sh
+++ b/9ns/test/adv_bridge_semantics.sh
@@ -24,7 +24,7 @@ SOCK=$TMP/i.sock
SRVPID=$!
for _ in $(seq 1 100); do [ -S "$SOCK" ] && break; sleep 0.02; done
# Each run is a fresh session; state persists in the server, so tests clean up after themselves.
-run() { OUT=$(timeout 120 "$NS" --unix "$SOCK" "${EXTRA[@]}" -- sh -c "$1" 2>"$TMP/stderr"); RC=$?; STDERR=$(cat "$TMP/stderr"); }
+run() { OUT=$(timeout 120 "$NS" --unix "$SOCK" --mount "$M" "${EXTRA[@]}" -- sh -c "$1" 2>"$TMP/stderr"); RC=$?; STDERR=$(cat "$TMP/stderr"); }
EXTRA=()
py() { run "python3 - <<'PYEOF'
$1
@@ -141,8 +141,9 @@ for n in os.listdir(d): os.unlink(f'{d}/{n}')
os.rmdir(d)
"
expect_eq "readdir of a directory that changes mid-iteration" "a True True" "$OUT"
-run "ls $M/.. > /dev/null && echo ok; stat -c %i $M $M/. $M/scratch/..; cd $M/scratch && ls .. | grep -c scratch"
-expect_eq ".. of the root and of a subdir" $'ok\n1\n1\n1\n1' "$OUT"
+# The root's inode number is its 9P qid.path (not a fixed 1): all three views must agree.
+run "ls $M/.. > /dev/null && echo ok; stat -c %i $M $M/. $M/scratch/.. | sort -u | wc -l; cd $M/scratch && ls .. | grep -c scratch"
+expect_eq ".. of the root and of a subdir" $'ok\n1\n1' "$OUT"
run "cd $M && find . -type d | wc -l && find . -type f | head -1 && find $S -type f | wc -l"
expect_contains "find -type works" "./README" "$OUT"
run "stat -f -c '%T %S %l' $M; df -P $M | tail -1 | awk '{print \$1}'; sync -f $M && echo synced; sync && echo synced2"