1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#!/bin/bash
set -e
$PREPARE_DEFAULT > /dev/null
$INCLUDE_FUNCS
cd $WC
logfile=$LOGDIR/063.chroot
if [[ $UID -eq 0 ]]
then
export FSVS_CHROOT_CWD=17
export FSVS_CHROOT_ROOT=84
export FSVS_CHROOT_LIBS=libm.so.6
mkdir dir
echo gurgle > empty-file
date > dir/new-chroot
# The shell doesn't do $X</ - the $X is taken as parameter for the
# binary, not as file number. So we call a sub-shell.
bash -c "$BINdflt st .. -o dir_sort=yes > $logfile $FSVS_CHROOT_CWD<dir $FSVS_CHROOT_ROOT</"
if [[ `cat $logfile` != ".mC."*"dir .."*"N..."*"dir ../dir"*"N..."*"../dir/new-chroot"*".mC."*"../empty-file" ]]
then
cat $logfile
$ERROR "Wrong status output?"
fi
$SUCCESS "Chroot execution seems ok."
else
$WARN "Cannot test chroot as user."
fi
|