mirror of
https://github.com/fsquillace/junest.git
synced 2026-01-23 02:34:30 +00:00
Enable all capabilities in ns fakeroot mode
This commit is contained in:
parent
9ecabcd524
commit
38ab252f98
2 changed files with 7 additions and 7 deletions
|
|
@ -99,7 +99,7 @@ function run_env_as_bwrap_fakeroot(){
|
|||
local args=()
|
||||
[[ "$1" != "" ]] && args=("-c" "$(insert_quotes_on_spaces "${@}")")
|
||||
|
||||
JUNEST_ENV=1 "$backend_command" $COMMON_BWRAP_OPTION --uid 0 --gid 0 $backend_args sudo "${DEFAULT_SH[@]}" "${args[@]}"
|
||||
JUNEST_ENV=1 "$backend_command" $COMMON_BWRAP_OPTION --cap-add ALL --uid 0 --gid 0 $backend_args sudo "${DEFAULT_SH[@]}" "${args[@]}"
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -104,14 +104,14 @@ function test_is_user_namespace_enabled_with_userns_clone_file_enabled(){
|
|||
|
||||
function test_run_env_as_bwrap_fakeroot() {
|
||||
assertCommandSuccess run_env_as_bwrap_fakeroot "" "" "false"
|
||||
assertEquals "bwrap $COMMON_BWRAP_OPTION --uid 0 --gid 0 sudo /bin/sh --login" "$(cat $STDOUTF)"
|
||||
assertEquals "bwrap $COMMON_BWRAP_OPTION --cap-add ALL --uid 0 --gid 0 sudo /bin/sh --login" "$(cat $STDOUTF)"
|
||||
|
||||
_test_copy_common_files
|
||||
}
|
||||
|
||||
function test_run_env_as_bwrap_fakeroot_with_backend_command() {
|
||||
assertCommandSuccess run_env_as_bwrap_fakeroot "mybwrap" "" "false"
|
||||
assertEquals "mybwrap $COMMON_BWRAP_OPTION --uid 0 --gid 0 sudo /bin/sh --login" "$(cat $STDOUTF)"
|
||||
assertEquals "mybwrap $COMMON_BWRAP_OPTION --cap-add ALL --uid 0 --gid 0 sudo /bin/sh --login" "$(cat $STDOUTF)"
|
||||
|
||||
_test_copy_common_files
|
||||
}
|
||||
|
|
@ -134,7 +134,7 @@ function test_run_env_as_bwrap_user_with_backend_command() {
|
|||
|
||||
function test_run_env_as_bwrap_fakeroot_no_copy() {
|
||||
assertCommandSuccess run_env_as_bwrap_fakeroot "" "" "true" ""
|
||||
assertEquals "bwrap $COMMON_BWRAP_OPTION --uid 0 --gid 0 sudo /bin/sh --login" "$(cat $STDOUTF)"
|
||||
assertEquals "bwrap $COMMON_BWRAP_OPTION --cap-add ALL --uid 0 --gid 0 sudo /bin/sh --login" "$(cat $STDOUTF)"
|
||||
|
||||
[[ ! -e ${JUNEST_HOME}/etc/hosts ]]
|
||||
assertEquals 0 $?
|
||||
|
|
@ -186,7 +186,7 @@ function test_run_env_as_bwrap_user_no_copy() {
|
|||
|
||||
function test_run_env_as_bwrap_fakeroot_with_backend_args() {
|
||||
assertCommandSuccess run_env_as_bwrap_fakeroot "" "--bind /usr /usr" "false"
|
||||
assertEquals "bwrap $COMMON_BWRAP_OPTION --uid 0 --gid 0 --bind /usr /usr sudo /bin/sh --login" "$(cat $STDOUTF)"
|
||||
assertEquals "bwrap $COMMON_BWRAP_OPTION --cap-add ALL --uid 0 --gid 0 --bind /usr /usr sudo /bin/sh --login" "$(cat $STDOUTF)"
|
||||
|
||||
_test_copy_common_files
|
||||
}
|
||||
|
|
@ -201,7 +201,7 @@ function test_run_env_as_bwrap_user_with_backend_args() {
|
|||
|
||||
function test_run_env_as_bwrap_fakeroot_with_command() {
|
||||
assertCommandSuccess run_env_as_bwrap_fakeroot "" "" "false" "ls -la"
|
||||
assertEquals "bwrap $COMMON_BWRAP_OPTION --uid 0 --gid 0 sudo /bin/sh --login -c \"ls -la\"" "$(cat $STDOUTF)"
|
||||
assertEquals "bwrap $COMMON_BWRAP_OPTION --cap-add ALL --uid 0 --gid 0 sudo /bin/sh --login -c \"ls -la\"" "$(cat $STDOUTF)"
|
||||
|
||||
_test_copy_common_files
|
||||
}
|
||||
|
|
@ -216,7 +216,7 @@ function test_run_env_as_bwrap_user_with_command() {
|
|||
|
||||
function test_run_env_as_bwrap_fakeroot_with_backend_args_and_command() {
|
||||
assertCommandSuccess run_env_as_bwrap_fakeroot "" "--bind /usr /usr" "false" "ls -la"
|
||||
assertEquals "bwrap $COMMON_BWRAP_OPTION --uid 0 --gid 0 --bind /usr /usr sudo /bin/sh --login -c \"ls -la\"" "$(cat $STDOUTF)"
|
||||
assertEquals "bwrap $COMMON_BWRAP_OPTION --cap-add ALL --uid 0 --gid 0 --bind /usr /usr sudo /bin/sh --login -c \"ls -la\"" "$(cat $STDOUTF)"
|
||||
|
||||
_test_copy_common_files
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue