containers / toolbox

Tool for interactive command line environments on Linux
https://containertoolbx.org/
Apache License 2.0
2.39k stars 208 forks source link

test/system: Don't assume that no container will have /etc/kernel #1409

Closed pennbauman closed 7 months ago

pennbauman commented 7 months ago

The test "run: Ensure that $HOME is used as a fallback working directory" assumes /etc/kernel will not be present in containers, but this is not the case for Ubuntu (and Debian) containers. This patch switches the test to using a temporary directory (under /var/tmp which is not mounted by toolboxes) to ensure fallback is activated.

softwarefactory-project-zuul[bot] commented 7 months ago

Build failed. https://softwarefactory-project.io/zuul/t/local/buildset/e3053c494f0046888d86eaab1ea0db4a

:heavy_check_mark: unit-test SUCCESS in 6m 58s :heavy_check_mark: unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 43s :x: unit-test-restricted POST_FAILURE in 6m 50s :heavy_check_mark: system-test-fedora-rawhide SUCCESS in 27m 21s :heavy_check_mark: system-test-fedora-39 SUCCESS in 27m 10s :heavy_check_mark: system-test-fedora-38 SUCCESS in 26m 36s :heavy_check_mark: system-test-fedora-37 SUCCESS in 26m 14s

debarshiray commented 7 months ago

I took the liberty to address the nits and updated the branch by rebasing against main. I am waiting for your response to my earlier question.

pennbauman commented 7 months ago

Ubuntu hosts do have the /etc/kernel directory, but so do Ubuntu containers. So when the test is run using an Ubuntu container it just enters the container at /etc/kernel without being forced to fallback.

You can simulate this on fedora if you temporarily add the following to /etc/os-release

ID=ubuntu
VERSION_ID="22.04"
softwarefactory-project-zuul[bot] commented 7 months ago

Build succeeded. https://softwarefactory-project.io/zuul/t/local/buildset/fc837885ff294b86a2d66e4ec050dc60

:heavy_check_mark: unit-test SUCCESS in 9m 11s :heavy_check_mark: unit-test-migration-path-for-coreos-toolbox SUCCESS in 4m 08s :heavy_check_mark: unit-test-restricted SUCCESS in 8m 50s :heavy_check_mark: system-test-fedora-rawhide SUCCESS in 29m 25s :heavy_check_mark: system-test-fedora-39 SUCCESS in 29m 17s :heavy_check_mark: system-test-fedora-38 SUCCESS in 31m 31s :heavy_check_mark: system-test-fedora-37 SUCCESS in 29m 35s

debarshiray commented 7 months ago

Ubuntu hosts do have the /etc/kernel directory, but so do Ubuntu containers. So when the test is run using an Ubuntu container it just enters the container at /etc/kernel without being forced to fallback.

Aha, okay, you are right. I didn't read your initial comment carefully.

You can simulate this on fedora if you temporarily add the following to /etc/os-release

ID=ubuntu
VERSION_ID="22.04"

Thanks for the detailed example. Let's merge this once the CI finishes.

debarshiray commented 7 months ago

@pennbauman Since you spent some time running the test on non-Fedora hosts, would you mind submitting a new PR that runs this "fallback working directory" test on other images, and not just the default one? eg., Arch Linux, RHEL, Ubuntu, etc. like we do elsewhere.

softwarefactory-project-zuul[bot] commented 7 months ago

Build succeeded. https://softwarefactory-project.io/zuul/t/local/buildset/7cf3ec79364a4633ab4e5ac87b0cc6b6

:heavy_check_mark: unit-test SUCCESS in 8m 54s :heavy_check_mark: unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 47s :heavy_check_mark: unit-test-restricted SUCCESS in 5m 33s :heavy_check_mark: system-test-fedora-rawhide SUCCESS in 33m 59s :heavy_check_mark: system-test-fedora-39 SUCCESS in 32m 14s :heavy_check_mark: system-test-fedora-38 SUCCESS in 32m 09s :heavy_check_mark: system-test-fedora-37 SUCCESS in 32m 34s

pennbauman commented 7 months ago

@debarshiray I was thinking that would be a good next step. I will look into that when I have some time.

debarshiray commented 6 months ago

@debarshiray I was thinking that would be a good next step. I will look into that when I have some time.

Thanks!