Files
dev/codex-rs/vendor/bubblewrap/tests/test-specifying-pidns.sh
zeekay ccff317bae build: vendor bubblewrap source in-tree for reproducible linux-sandbox builds
linux-sandbox/build.rs compiles bubblewrap from codex-rs/vendor/bubblewrap on
Linux. Vendor it in-tree (LGPL-2.0+) so local and CI release builds are
self-contained (CI already installs libcap-dev + node22). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-16 19:00:24 -07:00

29 lines
863 B
Bash
Executable File

#!/usr/bin/env bash
set -xeuo pipefail
srcd=$(cd $(dirname "$0") && pwd)
. "${srcd}/libtest.sh"
echo "1..1"
# This test needs user namespaces
if test -n "${bwrap_is_suid:-}"; then
echo "ok - # SKIP no setuid support for --unshare-user"
else
mkfifo donepipe
$RUN --info-fd 42 --unshare-user --unshare-pid sh -c 'readlink /proc/self/ns/pid > sandbox-pidns; cat < donepipe' >/dev/null 42>info.json &
while ! test -f sandbox-pidns; do sleep 1; done
SANDBOX1PID=$(extract_child_pid info.json)
ASAN_OPTIONS=detect_leaks=0 LSAN_OPTIONS=detect_leaks=0 \
$RUN --userns 11 --pidns 12 readlink /proc/self/ns/pid > sandbox2-pidns 11< /proc/$SANDBOX1PID/ns/user 12< /proc/$SANDBOX1PID/ns/pid
echo foo > donepipe
assert_files_equal sandbox-pidns sandbox2-pidns
rm donepipe info.json sandbox-pidns
echo "ok - Test --pidns"
fi