diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2021-06-22 12:30:24 +0200 |
---|---|---|
committer | Frantisek Sumsal <frantisek@sumsal.cz> | 2021-06-22 12:34:31 +0200 |
commit | 179ca4d2b1b5579014773a128462475f99b7a91b (patch) | |
tree | d31ed92303f332ecbd24cf877b13c77ed85d1169 /test/TEST-01-BASIC | |
parent | test: ignore the "freezing" & "thawing" intermediate states (diff) | |
download | systemd-179ca4d2b1b5579014773a128462475f99b7a91b.tar.xz systemd-179ca4d2b1b5579014773a128462475f99b7a91b.zip |
test: correctly mask supporting services in tests
It turns out the "supporting services" were run in _all_ tests if
TEST-01-BASIC was run as the first test (which is usually the case),
since with the original condition in test_create_image() we would skip
the masking and then propagate the change to the default image used by
other tests. This has been causing multiple bogus test timeouts
(especially when the hwdb was being rebuilt in tests with short
timeouts, like TEST-52-HONORFIRSTSHUTDOWN).
Let's "fix" this by making the call to mask_supporting_services()
uncoditional and override the test_create_image() function in
TEST-01-BASIC to avoid the masking in this single case.
Diffstat (limited to 'test/TEST-01-BASIC')
-rwxr-xr-x | test/TEST-01-BASIC/test.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh index d42c0df9a0..5a6156d770 100755 --- a/test/TEST-01-BASIC/test.sh +++ b/test/TEST-01-BASIC/test.sh @@ -9,6 +9,18 @@ TEST_REQUIRE_INSTALL_TESTS=0 # shellcheck source=test/test-functions . "${TEST_BASE_DIR:?}/test-functions" +# Explicitly override the default test_create_image() function to avoid the +# call to mask_supporting_services(), since we want to run them in TEST-01-BASIC +test_create_image() { + create_empty_image_rootdir + + # Create what will eventually be our root filesystem onto an overlay + ( + LOG_LEVEL=5 + setup_basic_environment + ) +} + test_append_files() { # install tests manually so the test is functional even when -Dinstall-tests=false local dst="${1:?}/usr/lib/systemd/tests/testdata/units/" |