Issue #93: Add test for chroot

This commit is contained in:
Filippo Squillace 2015-07-05 11:46:35 +00:00
parent b7ad845771
commit 438eeafb63
2 changed files with 13 additions and 0 deletions

View file

@ -205,6 +205,10 @@ function setup_env_from_file(){
}
function run_env_as_root(){
source ${JUNEST_HOME}/etc/junest/info
[ "$JUNEST_ARCH" != "$ARCH" ] && \
die "The host system architecture is not correct: $ARCH != $JUNEST_ARCH"
local uid=$UID
# SUDO_USER is more reliable compared to SUDO_UID
[ -z $SUDO_USER ] || uid=$SUDO_USER:$SUDO_GID

View file

@ -207,6 +207,15 @@ function test_run_env_as_root(){
assertEquals 0 $?
}
function test_run_env_as_root_different_arch(){
[ $SKIP_ROOT_TESTS -eq 1 ] && return
install_mini_env
echo "JUNEST_ARCH=XXX" > ${JUNEST_HOME}/etc/junest/info
$(run_env_as_root pwd 2> /dev/null)
assertEquals 1 $?
}
function test_run_env_as_classic_root(){
[ $SKIP_ROOT_TESTS -eq 1 ] && return