summaryrefslogtreecommitdiffstats
path: root/test/test-execute/exec-environment-empty.service (follow)
Commit message (Collapse)AuthorAgeFilesLines
* tests: use relative paths in ExecStart= and friendsZbigniew Jędrzejewski-Szmek2024-01-091-1/+1
| | | | | | We want to retain *some* of the full paths in order to test more code paths. But the default should be to use the command name only. This makes the tests less visually cluttered.
* tests: add spdx license header to test unit/link/network/conf filesZbigniew Jędrzejewski-Szmek2021-10-181-0/+1
| | | | | | | | Those are all consumed by our parser, so they all support comments. I was considering whether they should have a license header at all, but in the end I decided to add it because those files are often created by copying parts of real unit files. And if the real ones have a license, then those might as well. It's easier to add it than to make an exception.
* test-execute: Fix systemd escaping and shell issuesFilipe Brandenburger2015-11-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In most cases, systemd requires escaping $ (for systemd variable substitution) and % (for specifiers) by doubling them. This was somewhat of an issue in tests like exec-environment*.service where systemd was doing the substitutions and we were not really checking that those were available in the actual environment of the command. Fix that. Expressions such as `exit $(test ...)` are incorrect. They only work because $(test ...) will produce no output, so the command will become a bare "exit" which will exit with the status of the latest executed command which turns out to be the test... The direct approach is simply calling "test" as the last command, for which the shell will propagate the exit status. One situation where this was breaking tests was on `exit $(test ...) && $(test ...) && $(test ...)` where the second and third tests were not really executing, since the first command is actually `exit` so && was doing nothing there. Fixed it by just using `test ... && test ... && test ...` as it was initially intended. Pass -x to all shell executions for them to produce useful debugging output to stderr. Consequently, removed most of the explicit `echo`s that are no longer needed. Mark all units as Type=oneshot explicitly. Also made sure all shell variables are properly quoted. v2: Added an explicit LC_ALL=C to ionice invocations since some locales (such as French) will add a space before the colon in the output. Tested by running `sudo ./test-execute` and confirming all tests enabled on my system (essentially all of them except for the s390 one) passed. Tweaked the variables or options or expected values and confirmed the tests do indeed fail when the values are not exactly the expected ones. v2: Also tested with `LANG=fr_FR.UTF-8 sudo ./test-execute` to confirm it still works in a different locale.
* test-execute: move all files related to a specific directoryRonny Chevalier2015-10-311-0/+7
To avoid polluting test/