summaryrefslogtreecommitdiffstats
path: root/test/test-execute (follow)
Commit message (Collapse)AuthorAgeFilesLines
* test: add tests for DynamicUser= with static User= whose UID and GID are ↵Yu Watanabe2018-07-262-0/+22
| | | | different
* Add support for opening files for appendingZsolt Dollenstein2018-07-202-0/+26
| | | | Addresses part of #8983
* test: add test for specifier of configuration directory rootYu Watanabe2018-06-202-0/+2
|
* test: add test for trailing dot in WorkingDirectory= and RuntimeDirectory=Yu Watanabe2018-06-032-0/+9
|
* core: introduce specifiers for /tmp and /var/tmpLennart Poettering2018-05-291-0/+2
| | | | | | | | | | | This corresponds nicely with the specifiers we already pass for /var/lib, /var/cache, /run and so on. This is particular useful to update the test-path service files to operate without guessable files, thus allowing multiple parallel test-path invocations to pass without issues (the idea is to set $TMPDIR early on in the test to some private directory, and then only use the new %T or %V specifier to refer to it).
* Merge pull request #8817 from yuwata/cleanup-nsflagsLennart Poettering2018-05-243-0/+26
|\ | | | | core: allow to specify RestrictNamespaces= multiple times
| * test: add tests for merging RestrictNamespaces=Yu Watanabe2018-05-053-0/+26
| |
* | test-execute: remove state directories before running testsYu Watanabe2018-05-111-1/+1
| | | | | | | | Fixes #8679.
* | test: add testcase for environment file variables with backslashesJoost Heitbrink2018-05-115-8/+9
|/ | | | | systemd silently strips out backslashes in variables from environment files. Add a testcase that explicitly tests for this behaviour.
* test: fix descriptionsYu Watanabe2018-05-012-2/+2
|
* test: add tests for PrivateDevices= with '+' prefixYu Watanabe2018-05-011-0/+8
|
* test: add tests for %j and %J specifier in test-execute (#8838)Yu Watanabe2018-04-272-0/+4
| | | Follow-up for 250e9fadbcc0ca90e697d7efb40855b054ed3b8f.
* tests: compare with correct shellLennart Poettering2018-04-192-2/+2
| | | | | We synthesize the passwd record for UID 0, hence we need to compare with our synthesized data and not with the data stored in /etc/passwd
* test-execute: make find invocation a bit more efficent, increase timeoutZbigniew Jędrzejewski-Szmek2018-04-161-1/+1
| | | | | | | | | We go through the whole file system, so this test can take arbitrary time. But this test is still quite useful, so let's at least try to make it more efficent by not descending at all into the directories we would filter out later on anyway. Also increase the timeout, in case the previous step doesn't help enough.
* test: drop the use of /bin/sh in various test servicesZbigniew Jędrzejewski-Szmek2018-04-1611-87/+87
| | | | | This is not meant to be comprehensive, just the few cases where the /bin/sh -c wrapper is obviously superfluous.
* systemd: do not require absolute paths in ExecStartZbigniew Jędrzejewski-Szmek2018-04-161-0/+13
| | | | | | | | | | | | | Absolute paths make everything simple and quick, but sometimes this requirement can be annoying. A good example is calling 'test', which will be located in /usr/bin/ or /bin depending on the distro. The need the provide the full path makes it harder a portable unit file in such cases. This patch uses a fixed search path (DEFAULT_PATH which was already used as the default value of $PATH), and if a non-absolute file name is found, it is immediately resolved to a full path using this search path when the unit is loaded. After that, everything behaves as if an absolute path was specified. In particular, the executable must exist when the unit is loaded.
* test-execute/exec-specifier.service: fix quotingZbigniew Jędrzejewski-Szmek2018-04-122-4/+4
| | | | The lines would cause the whole service to fail to be loaded.
* fix missed bracket of exec-personality-ppc64le.service (#8650)Feng Sun2018-04-041-1/+1
| | | Signed-off-by: Neil Sun <neilsun@yunify.com>
* test-execute: skip exec-specifier-interpolation if perl is missingZbigniew Jędrzejewski-Szmek2018-03-221-1/+1
|
* test-execute: allow sit0@ to exist in private network namespaceZbigniew Jędrzejewski-Szmek2018-03-221-1/+1
| | | | | | | | | | | It's always visible: $ sudo modprobe sit $ sudo unshare -n ip l 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default qlen 1000 ... 2: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1000 ...
* test-execute: simplify checks if grep output is emptyZbigniew Jędrzejewski-Szmek2018-03-222-2/+2
| | | | | | grep already indicates if it matched anything by return value. Additional advantage is then that if the test fails, the unexpected matching lines are visible in the log output.
* test-execute: Introduce tests for environment values containing newlinesFilipe Brandenburger2018-03-175-8/+9
| | | | | | | Also fix one case where the presence of a newline was used to generate an invalid environment assignment. Tested: with mkosi, which builds the local tree and run ninja tests.
* test-execute: use CAP_CHOWN instead of CAP_NET_ADMINYu Watanabe2018-03-046-12/+12
| | | | | | CAP_NET_ADMIN is somtrimes dropped by container runtime. This changes to use CAP_CHOWN instead of CAP_NET_ADMIN, as it is less likely to be dropped.
* test-execute: rename tests for AmbientCapabilities=Yu Watanabe2018-03-046-0/+0
| | | | | | | | The unit files for test-execute are named like `exec-(setting-name-in-lower-character)-(optional-text).service`. However, test units for AmbientCapabilities= are not following this. So, let's rename them for the consistency. This does not change anything in the functionality of the test.
* test-execute: add tests with user/group daemonYu Watanabe2018-03-0212-15/+66
| | | | | | The nobody user/group may not synthesized by systemd. To run tests the functionalities in such situation, this adds tests by user/group by daemon, as it is expected to exists all environments.
* test-execute: add a test for the case that NOBODY_GROUP_NAME is nogroupYu Watanabe2018-03-011-0/+9
|
* test: use "$$" to pass a literal dollar signYu Watanabe2018-02-261-5/+5
| | | | Follow-up for 932329865741054f52dee2e7fc9bd6159b791fee.
* test: use setup_fake_runtime_dir() in test-executeYu Watanabe2018-02-264-4/+4
|
* test: don't complain if bpffs is world-writableLennart Poettering2018-02-211-1/+1
| | | | | Apparently, world-writable bpffs is intended by the kernel folks, hence let's make sure we don't choke on it on our tests.
* test: fix test for TemporaryFileSystem= (#8241)Yu Watanabe2018-02-211-3/+9
| | | | | | This makes test-execute work on SELinux enabled systems. Fixes the issue reported at https://github.com/systemd/systemd/pull/7908#discussion_r169583540
* test: add tests for TemporaryFileSystem=Yu Watanabe2018-02-214-0/+92
|
* test-execute: use the "nogroup" group if it exists for testingLennart Poettering2017-12-061-0/+7
| | | | | | We currently look for "nobody" and "nfsnobody" when testing groups, both of which do not exist on Ubuntu, our main testing environment. Let's extend the tests slightly to also use "nogroup" if it exists.
* test-execute: add tests for CPUAffinity=Yu Watanabe2017-12-063-0/+21
|
* test-execute: add test for that DynamicUser= migrate StateDirectory=Yu Watanabe2017-12-052-0/+40
| | | | Test for 949befd3f09e8c06a908ec99efd241666c21d944.
* test-execute: cleanupYu Watanabe2017-12-0514-14/+26
| | | | | | This makes rename the test units by a consistent naming scheme, add several logs, and sort internal functions. No functional change.
* test-execute: test more % specifiers (#7450)Yu Watanabe2017-11-242-3/+30
|
* test: add basic test for StandardInput=file:Lennart Poettering2017-11-172-1/+8
|
* test: add tests for StandardInputText= and StandardInputData=Lennart Poettering2017-11-171-0/+19
|
* test-execute: change path to python3 (#7306)Yu Watanabe2017-11-124-4/+4
| | | | | | Change python3 path from /bin/python3 to /usr/bin/python3 to make the test work on Ubuntu Xenial. Follow-up for #7178.
* test-execute: update test for SystemCallErrorNumber=Yu Watanabe2017-11-112-1/+9
|
* test: add tests for syscall:errno style in SystemCallFilter=Yu Watanabe2017-11-112-0/+16
|
* test: add test for ReadOnlyPaths= with RuntimeDirectory=Yu Watanabe2017-11-081-0/+9
|
* test: add simple test for validating some of the unit specifiers we supportLennart Poettering2017-10-261-0/+15
| | | | | (Also, sort list of test unit files in meson.build alphabetically, to make future additions more systematic)
* test-execute: always use /bin/shYu Watanabe2017-10-128-17/+17
|
* test: add test for BindPaths= and BindReadOnlyPaths=Yu Watanabe2017-10-121-0/+14
| | | | Follow-up for a8cabc612b16834260831a8163ae4b479b5c33a5.
* test: add test for DynamicUser= + StateDirectory=Lennart Poettering2017-10-021-0/+19
| | | | | | | | | | | Also, tests for DynamicUser= should really run for system mode, as we allocate from a system resource. (This also increases the test timeout to 2min. If one of our tests really hangs then waiting for 2min longer doesn't hurt either. The old 2s is really short, given that we run in potentially slow VM environments for this test. This becomes noticable when the slow "find" command this adds is triggered)
* test: add test case for UnsetEnvironment=Lennart Poettering2017-09-141-0/+8
|
* test: ensure 'InaccessiblePaths=/proc' option works (#6017)Timothée Ravier2017-05-251-0/+7
| | | Test case for PR #5985.
* tests: stop creating /TEST (#5943)Evgeny Vereshchagin2017-05-124-4/+4
| | | Closes #5856.
* core: skip ReadOnlyPaths= and other permission-related mounts on ↵Lennart Poettering2017-02-121-0/+8
| | | | | | | | | | | | | | | | | | | | | | PermissionsStartOnly= (#5309) ReadOnlyPaths=, ProtectHome=, InaccessiblePaths= and ProtectSystem= are about restricting access and little more, hence they should be disabled if PermissionsStartOnly= is used or ExecStart= lines are prefixed with a "+". Do that. (Note that we will still create namespaces and stuff, since that's about a lot more than just permissions. We'll simply disable the effect of the four options mentioned above, but nothing else mount related.) This also adds a test for this, to ensure this works as intended. No documentation updates, as the documentation are already vague enough to support the new behaviour ("If true, the permission-related execution options…"). We could clarify this further, but I think we might want to extend the switches' behaviour a bit more in future, hence leave it at this for now. Fixes: #5308