#!/bin/bash

set -e -o pipefail

r1=$RANDOM
r2=$(( $r1 + 1))

f1=/tmp/test-isolation-$r1
f2=/tmp/test-isolation-$r2

touch $f1

xchpst --user-ns --private-tmp sh -c "ls $f1 2>/dev/null; touch $f2" >&2
stat $f1 && ! stat $f2 2>/dev/null
