summaryrefslogtreecommitdiff
path: root/test/TEST-22-TMPFILES
Commit message (Collapse)AuthorAgeFilesLines
* tests: add spdx headers to scripts and MakefilesZbigniew Jędrzejewski-Szmek2021-10-181-0/+1
|
* test: unify handling of boolean valuesFrantisek Sumsal2021-07-041-1/+1
| | | | | | | Let's unify handling of the boolean values throughout the test-functions code, since we use 0/1, true/false, and yes/no almost randomly in many places, so picking the right values during CI configuration can be a real pain.
* test: "detect" the test number automagicallyFrantisek Sumsal2021-04-261-1/+1
| | | | | | Specifying the test number manually is tedious and prone to errors (as recently proven). Since we have all the necessary data to work out the test number, let's do it automagically.
* test: make the test entrypoint scripts shellcheck-compliantFrantisek Sumsal2021-04-201-3/+6
|
* test: disable nss-systemd for TEST-22 under ASanFrantisek Sumsal2021-03-101-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | When running TEST-22 under ASan, there's a chain of events which causes `stat` to output an extraneous ASan error message, causing following fail: ``` + test -d /tmp/d/1 ++ stat -c %U:%G:%a /tmp/d/1 ==82==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD. + test = daemon:daemon:755 .//usr/lib/systemd/tests/testdata/units/testsuite-22.02.sh: line 24: test: =: unary operator expected ``` This is caused by `stat` calling nss which in Arch's configuration calls the nss-systemd module, that pulls in libasan which causes the $LD_PRELOAD error message, since `stat` is an uninstrumented binary. The $LD_PRELOAD variable is explicitly unset for all testsuite-* services since it causes various issues when calling uninstrumented libraries, so setting it globally is not an option. Another option would be to set $LD_PRELOAD for each `stat` call, but that would unnecessarily clutter the test code.
* test: de-duplicate test_setup() functionsZbigniew Jędrzejewski-Szmek2020-03-281-10/+0
| | | | Now we will run setup_nspawn_root() in some case where do don't need to.
* test: move TEST-22-TMPFILES setup to static filesZbigniew Jędrzejewski-Szmek2020-03-2812-660/+1
|
* treewide: more portable bash shebangsJörg Thalheim2020-03-053-3/+3
| | | | | | | | | | | | | | | | As in 2a5fcfae024ffc370bb780572279f45a1da3f946 and in 3e67e5c9928f8b1e1c5a63def88d53ed1fed12eb using /usr/bin/env allows bash to be looked up in PATH rather than being hard-coded. As with the previous changes the same arguments apply - distributions have scripts to rewrite shebangs on installation and they know what locations to rely on. - For tests/compilation we should rather rely on the user to have setup there PATH correctly. In particular this makes testing from git easier on NixOS where do not provide /bin/bash to improve compose-ability.
* test: make sure our tests get exclusive TTY accessLennart Poettering2019-11-201-0/+2
| | | | | | | | | | | | | | | | | This sould make our test suite a bit more robust if it is slow running. A few of our test services use StandardOutput=tty or StandardError=tty in the tests in order to connect test services to the container console. This gets into conflict with the container getty which wants exclusive access to the console. Since the container getty is started with Type=idle it typically gets started after a timeout only if the TTY is already used, which hence introduces a race: if the test finishes earlier all is good, if not, then the test gets kicked off the TTY which then causes bash to abort since it cannot write any error messages anymore. Let's fix this hence: all tests that connect to the tty are now synchronized to getty-pre.target, so they finish before any getty is started.
* test: add function to reduce copied setup boilerplateZbigniew Jędrzejewski-Szmek2019-10-081-8/+1
| | | | | | Many tests were also masking systemd-machined.service. But machined should only start when activated, so having it not masked shouldn't be noticable. TEST-25-IMPORT needs it.
* tests: add test for suid/sgid handling in tmpfilesLennart Poettering2019-04-301-0/+59
|
* codespell: fix spelling errorsBen Boeckel2019-04-291-1/+1
|
* scripts: use 4 space indentationZbigniew Jędrzejewski-Szmek2019-04-121-2/+0
| | | | | | | | | | | | | | | | | | We had all kinds of indentation: 2 sp, 3 sp, 4 sp, 8 sp, and mixed. 4 sp was the most common, in particular the majority of scripts under test/ used that. Let's standarize on 4 sp, because many commandlines are long and there's a lot of nesting, and with 8sp indentation less stuff fits. 4 sp also seems to be the default indentation, so this will make it less likely that people will mess up if they don't load the editor config. (I think people often use vi, and vi has no support to load project-wide configuration automatically. We distribute a .vimrc file, but it is not loaded by default, and even the instructions in it seem to discourage its use for security reasons.) Also remove the few vim config lines that were left. We should either have them on all files, or none. Also remove some strange stuff like '#!/bin/env bash', yikes.
* TEST-22: add test for unprivileged dirs in root prefixesDavid Michael2019-02-281-0/+32
| | | | | This verifies the fix for the issue described in: https://github.com/systemd/systemd/pull/11820
* test: Add tests for tmpfiles C behaviorRyan Gonzalez2019-01-081-2/+29
|
* tmpfiles: also order glob child/parent relationshipsLennart Poettering2018-11-201-0/+31
| | | | | | | This is necessary so that "r" can be nested and are always executed in the same order. Fixes: #10191
* TEST-22: extend test suite a bitLennart Poettering2018-11-081-0/+38
| | | | Let's add a test based on #9508
* test: drop 'After=multi-user.target' from most of testsuite.serviceYu Watanabe2018-11-031-1/+1
|
* test: replace duplicated Makefile by symbolic linkYu Watanabe2018-10-091-4/+1
|
* tmpfiles: use fd_get_path() even less excessivelyFranck Bui2018-08-211-0/+45
| | | | | | | | | | | | | | | | A follow-up for commit 9d874aec451b591401d9b14cf8743b9d179159b2. This patch makes "path" parameter mandatory in fd_set_*() helpers removing the need to use fd_get_path() when NULL was passed. The caller is supposed to pass the fd anyway so assuming that it also knows the path should be safe. Actually, the only case where this was useful (or used) was when we were walking through directory trees (in item_do()). But even in those cases the paths could be constructed trivially, which is still better than relying on fd_get_path() (which is an ugly API). A very succinct test case is also added for 'z/Z' operators so the code dealing with recursive operators is tested minimally.
* test: make TEST-22 easier to debug, by outputting to /dev/consoleLennart Poettering2018-08-081-0/+2
|
* test: don't use "nobody:nogroup" for testsLennart Poettering2018-08-082-30/+30
| | | | | | | This user/group doesn't apply to Fedora. Let's use daemon:daemon instead like the other tests, as it actually tends to exist everywhere.
* tmpfiles: add more testsFranck Bui2018-07-304-0/+377
|
* test: don't send image building output to /dev/null (#8886)Lennart Poettering2018-05-031-1/+1
| | | | | | | | Yes, the output is sometimes annyoing, but /dev/null is not the right place... I figure this redirection was left in from some debugging session, let's fix it, and make the setup_basic_environment invocation like in all other test scripts.
* test: add tests for systemd-tmpfilesFranck Bui2018-03-055-0/+76