mirror of
https://github.com/fsquillace/junest.git
synced 2026-01-23 18:45:53 +00:00
commit
dca66197d8
1 changed files with 20 additions and 3 deletions
|
|
@ -55,10 +55,13 @@ function test_setup_juju(){
|
|||
[ -e $JUJU_HOME/run/lock ] || return 1
|
||||
|
||||
export -f setup_juju
|
||||
export -f die
|
||||
JUJU_ENV=1 bash -ic "setup_juju" &> /dev/null
|
||||
is_equal $? 1 || return 1
|
||||
export -n setup_juju
|
||||
unset setup_juju
|
||||
export -n die
|
||||
unset die
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -70,6 +73,7 @@ function test_setup_from_file_juju(){
|
|||
[ -e $JUJU_HOME/run/lock ] || return 1
|
||||
|
||||
export -f setup_from_file_juju
|
||||
export -f die
|
||||
bash -ic "setup_from_file_juju noexist.tar.gz" &> /dev/null
|
||||
is_equal $? 1 || return 1
|
||||
|
||||
|
|
@ -77,6 +81,8 @@ function test_setup_from_file_juju(){
|
|||
is_equal $? 1 || return 1
|
||||
export -n setup_from_file_juju
|
||||
unset setup_from_file_juju
|
||||
export -n die
|
||||
unset die
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -93,10 +99,13 @@ function test_run_juju_as_root(){
|
|||
[ -e $JUJU_HOME/${HOME} ] || return 1
|
||||
|
||||
export -f run_juju_as_root
|
||||
export -f die
|
||||
JUJU_ENV=1 bash -ic "run_juju_as_root" &> /dev/null
|
||||
is_equal $? 1 || return 1
|
||||
export -n run_juju_as_root
|
||||
unset run_juju_as_root
|
||||
export -n die
|
||||
unset die
|
||||
}
|
||||
|
||||
function test_run_juju_as_user(){
|
||||
|
|
@ -126,19 +135,24 @@ function test_run_juju_as_user_proot_args(){
|
|||
is_equal $? 0 || return 1
|
||||
|
||||
export -f _run_juju_with_proot
|
||||
export PROOT
|
||||
export TRUE
|
||||
ID="/usr/bin/echo 0" bash -ic "_run_juju_with_proot" &> /dev/null
|
||||
is_equal $? 1 || return 1
|
||||
export -n _run_juju_with_proot
|
||||
unset _run_juju_with_proot
|
||||
export -n PROOT
|
||||
export -n TRUE
|
||||
}
|
||||
|
||||
function test_run_juju_as_user_seccomp(){
|
||||
install_mini_juju
|
||||
local output=$(run_juju_as_user "" "env" | grep "PROOT_NO_SECCOMP")
|
||||
PROOT=""
|
||||
local output=$(_run_juju_with_proot "" "env" | grep "PROOT_NO_SECCOMP")
|
||||
is_equal $output "" || return 1
|
||||
|
||||
TRUE="/usr/bin/false"
|
||||
local output=$(run_juju_as_user "" "env" | grep "PROOT_NO_SECCOMP")
|
||||
local output=$(_run_juju_with_proot "" "env" | grep "PROOT_NO_SECCOMP")
|
||||
is_equal $output "PROOT_NO_SECCOMP=1" || return 1
|
||||
}
|
||||
|
||||
|
|
@ -158,10 +172,13 @@ function test_delete_juju(){
|
|||
is_equal $? 1 || return 1
|
||||
|
||||
export -f delete_juju
|
||||
export -f die
|
||||
JUJU_ENV=1 bash -ic "delete_juju" &> /dev/null
|
||||
is_equal $? 1 || return 1
|
||||
export -n delete_juju
|
||||
unset delete_juju
|
||||
unset delete_juju
|
||||
export -n die
|
||||
unset die
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue