mirror of
https://github.com/fsquillace/junest.git
synced 2026-07-25 03:47:03 +00:00
Issue #93: Add test for chroot
This commit is contained in:
parent
b7ad845771
commit
438eeafb63
2 changed files with 13 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue