Copy the Windows VM helper before the test hides /home
The mount-boundary test tmpfs-mounts over /home before sourcing $ROOT/bin/omarchy-windows-vm, so a checkout living under /home vanished mid-test and set -e aborted with no output. Take a mount-safe copy of the helper into the test tmpdir before the mounts land.
This commit is contained in:
@@ -15,6 +15,10 @@ fi
|
|||||||
test_tmp=$(mktemp -d)
|
test_tmp=$(mktemp -d)
|
||||||
trap 'rm -rf "$test_tmp"' EXIT
|
trap 'rm -rf "$test_tmp"' EXIT
|
||||||
|
|
||||||
|
# The checkout may live under /home, which the tmpfs below hides, so take a
|
||||||
|
# mount-safe copy of the helper before the mounts land.
|
||||||
|
cp "$ROOT/bin/omarchy-windows-vm" "$test_tmp/omarchy-windows-vm"
|
||||||
|
|
||||||
# Hide host state before creating the production paths used by the root helper.
|
# Hide host state before creating the production paths used by the root helper.
|
||||||
mount -t tmpfs -o mode=0755,size=8m run-test /run
|
mount -t tmpfs -o mode=0755,size=8m run-test /run
|
||||||
mkdir -p /run/lock
|
mkdir -p /run/lock
|
||||||
@@ -27,7 +31,7 @@ mount -t tmpfs -o uid=0,gid=0,mode=0710,size=1g home-alice /home/alice
|
|||||||
export HOME=/home/alice
|
export HOME=/home/alice
|
||||||
unset OMARCHY_WINDOWS_DIR
|
unset OMARCHY_WINDOWS_DIR
|
||||||
set -- help
|
set -- help
|
||||||
source "$ROOT/bin/omarchy-windows-vm" >/dev/null 2>&1
|
source "$test_tmp/omarchy-windows-vm" >/dev/null 2>&1
|
||||||
|
|
||||||
# The namespace maps the host filesystem's uid 0 to nobody. Only / remains on
|
# The namespace maps the host filesystem's uid 0 to nobody. Only / remains on
|
||||||
# that filesystem; all paths the helper mutates are isolated tmpfs mounts.
|
# that filesystem; all paths the helper mutates are isolated tmpfs mounts.
|
||||||
|
|||||||
Reference in New Issue
Block a user