Skip to content

Commit

Permalink
test/system: Ensure that $HOME is used as a fallback working directory
Browse files Browse the repository at this point in the history
We need a directory that's going to be present on the host operating
system across various configurations of all supported distributions,
such as the hosts running the CI, but not inside the Toolbx containers.

It looks like /etc/kernel is present on both Debian and Fedora, but
absent from the fedora-toolbox images.  On a Debian 10 server, it's
owned by several packages:
  $ dpkg-query --search /etc/kernel
  dkms, systemd, grub2-common, initramfs-tools, apt: /etc/kernel

... while on Fedora 36 Workstation:
  $ rpm --file --query /etc/kernel
  systemd-udev-250.8-1.fc36.x86_64

#1153
  • Loading branch information
debarshiray committed Nov 9, 2022
1 parent 3326dda commit 45b409f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/system/104-run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,21 @@ teardown() {
assert_line --index $((${#lines[@]}-1)) "Hello World"
}

@test "run: Ensure that $HOME is used as a fallback working directory" {
local default_container_name="$(get_system_id)-toolbox-$(get_system_version)"
create_default_container

pushd /etc/kernel 2>/dev/null

output="$($TOOLBOX run pwd 2>/dev/null)"
status="$?"

popd 2>/dev/null

assert_success
assert_output "$HOME"
}

@test "run: Try to run a command in the default container with no containers created" {
local default_container_name="$(get_system_id)-toolbox-$(get_system_version)"

Expand Down

0 comments on commit 45b409f

Please sign in to comment.