diff --git a/src/cmd/run.go b/src/cmd/run.go index 25a8f7305..a5722e9d8 100644 --- a/src/cmd/run.go +++ b/src/cmd/run.go @@ -333,6 +333,7 @@ func runCommandWithFallbacks(container string, runFallbackCommandsIndex := 0 runFallbackWorkDirsIndex := 0 workDir := workingDirectory + runFallbackWorkDirs := append([]string{"/run/host" + workDir}, runFallbackWorkDirs...) for { execArgs := constructExecArgs(container, @@ -585,7 +586,7 @@ func isPathPresent(container, path string) (bool, error) { "exec", "--user", currentUser.Username, container, - "sh", "-c", "test -d \"$1\"", "sh", path, + "sh", "-c", "test -d \"$1\" -a \"$1\" -ef \"/run/host/$1\"", "sh", path, } if err := shell.Run("podman", nil, nil, nil, args...); err != nil { diff --git a/test/system/104-run.bats b/test/system/104-run.bats index a7080de56..f2e989565 100644 --- a/test/system/104-run.bats +++ b/test/system/104-run.bats @@ -163,7 +163,7 @@ teardown() { assert_output "other-container" } -@test "run: Ensure that $HOME is used as a fallback working directory" { +@test "run: Ensure that /run/host is used as a fallback working directory" { local default_container_name="$(get_system_id)-toolbox-$(get_system_version)" create_default_container @@ -172,11 +172,11 @@ teardown() { popd assert_success - assert_line --index 0 "$HOME" + assert_line --index 0 "/run/host/etc/kernel" assert [ ${#lines[@]} -eq 1 ] lines=("${stderr_lines[@]}") assert_line --index $((${#stderr_lines[@]}-2)) "Error: directory /etc/kernel not found in container $default_container_name" - assert_line --index $((${#stderr_lines[@]}-1)) "Using $HOME instead." + assert_line --index $((${#stderr_lines[@]}-1)) "Using /run/host/etc/kernel instead." assert [ ${#stderr_lines[@]} -gt 2 ] } diff --git a/test/system/libs/bats-assert b/test/system/libs/bats-assert index d750c5a1b..78fa631d1 160000 --- a/test/system/libs/bats-assert +++ b/test/system/libs/bats-assert @@ -1 +1 @@ -Subproject commit d750c5a1b44bf6fc96726aea76f4621db5fd602f +Subproject commit 78fa631d1370562d2cd4a1390989e706158e7bf0 diff --git a/test/system/libs/bats-support b/test/system/libs/bats-support index 24a72e143..3c8fadc50 160000 --- a/test/system/libs/bats-support +++ b/test/system/libs/bats-support @@ -1 +1 @@ -Subproject commit 24a72e14349690bcbf7c151b9d2d1cdd32d36eb1 +Subproject commit 3c8fadc5097c9acfc96d836dced2bb598e48b009