summaryrefslogtreecommitdiff
path: root/test/meson.build
Commit message (Collapse)AuthorAgeFilesLines
* meson: do not install testdata when -Dinstall-tests=falseZbigniew Jędrzejewski-Szmek2020-07-141-49/+51
| | | | Fixes #16447.
* feature to honor first shutdown request to completionJay Burger2020-06-241-0/+2
| | | | | | Create unit tests per established norm at position 52 check in_set first before getting unit
* test: convert TEST-35-NETWORK-GENERATOR into a unit testZbigniew Jędrzejewski-Szmek2020-03-281-0/+7
|
* test: move TEST-30-ONCLOCKCHANGE setup to static filesZbigniew Jędrzejewski-Szmek2020-03-281-0/+2
| | | | | | The two timezone files are now installed in the global setup. I am not too happy about this, but it still seems better than to create a completely separate image just for this.
* test: move TEST-28-PERCENTJ-WANTEDBY setup to static filesZbigniew Jędrzejewski-Szmek2020-03-281-0/+2
|
* test: move TEST-16-EXTEND-TIMEOUT setup to static filesZbigniew Jędrzejewski-Szmek2020-03-281-0/+2
|
* test: move most of TEST-13-NSPAWN-SMOKE setup to static filesZbigniew Jędrzejewski-Szmek2020-03-281-0/+4
|
* test: move TEST-11-ISSUE-3166 setup to static filesZbigniew Jędrzejewski-Szmek2020-03-281-0/+2
|
* test: move TEST-10-ISSUE-2467 setup to static filesZbigniew Jędrzejewski-Szmek2020-03-281-0/+2
|
* test: move TEST-08-ISSUE-2730 setup to static files and meson scriptsZbigniew Jędrzejewski-Szmek2020-03-281-0/+12
| | | | | | | | Unfortunately meson does not install symlinks, but copies the symlink destination instead. So symlinks need to be created by a script. This commit adds both symlinks in test/testsuite-08.units/ and meson scriptlet calls. Strictly speaking, the first is not necessary, since nothing reads stuff directly from the source tree.
* test: move most of TEST-06-* setup to static filesZbigniew Jędrzejewski-Szmek2020-03-281-0/+2
|
* test: convert TEST-04-JOURNAL to generic imageZbigniew Jędrzejewski-Szmek2020-03-281-0/+2
|
* meson: use install_subdir() to install filesZbigniew Jędrzejewski-Szmek2020-03-221-183/+14
| | | | | This gives us slightly less control, but we don't need to update the file list...
* tests: move unit files to units/ subdirectoryZbigniew Jędrzejewski-Szmek2020-03-191-49/+4
| | | | | We have a bazillion of those unit files, and keeping them all directly in tests/ has become rather unwieldy.
* execute: Make '+' exec prefix ignore PrivateTmp=yesNate Jones2020-02-291-0/+1
| | | | | | | | The man pages state that the '+' prefix in Exec* directives should ignore filesystem namespacing options such as PrivateTmp. Now it does. This is very similar to #8842, just with PrivateTmp instead of PrivateDevices.
* test: add test for https://github.com/systemd/systemd/issues/14560Lennart Poettering2020-01-201-0/+1
|
* test: add test case for PrivateDevices=y and Group=daemonAnita Zhang2019-12-181-0/+1
| | | | | | For root, group enforcement needs to come after PrivateDevices=y set up according to 096424d1230e0a0339735c51b43949809e972430. Add a test to verify this is the case.
* tests: Add capability tests for ProtectKernelLogsKevin Kuehler2019-11-111-0/+2
|
* Rename udev's hwdb/ to hwdb.d/Zbigniew Jędrzejewski-Szmek2019-10-101-1/+1
| | | | | As in the parent commit, this makes the name consistent with the rest of the source tree and the actuall installation path.
* core: ExecCondition= for servicesAnita Zhang2019-07-171-0/+2
| | | | Closes #10596
* tests: Check trivial loop between two jobsMichal Koutný2019-06-261-0/+1
| | | | | | job_compare return value is undefined in case the jobs have a loop between them, so better make a test to make sure transaction cycle detection catches it.
* tests: Check job ordering on execution cyclesMichal Koutný2019-06-261-0/+1
| | | | | | | | | | | | | | | | | | | | | The test-engine Test2 tests the cycle detection when units a, b and d all start at once ,-------------------after-----------------, v | a/start ---after---> d/start ---after---> b/start Extend the test with Test11 that adds i.service which causes a and d stop (by unordered Conflicts=) while starting b. Because stops precede starts, we effectively eliminate the job cycle and all transaction jobs should be applicable. ,-------------------after-----------------, v | a/stop <---after--- d/stop <---after--- b/start . . ^ . . | '. . . . . . . . . i/start ---after------'
* cgroup: Implement default propagation of MemoryLow with DefaultMemoryLowChris Down2019-04-121-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In cgroup v2 we have protection tunables -- currently MemoryLow and MemoryMin (there will be more in future for other resources, too). The design of these protection tunables requires not only intermediate cgroups to propagate protections, but also the units at the leaf of that resource's operation to accept it (by setting MemoryLow or MemoryMin). This makes sense from an low-level API design perspective, but it's a good idea to also have a higher-level abstraction that can, by default, propagate these resources to children recursively. In this patch, this happens by having descendants set memory.low to N if their ancestor has DefaultMemoryLow=N -- assuming they don't set a separate MemoryLow value. Any affected unit can opt out of this propagation by manually setting `MemoryLow` to some value in its unit configuration. A unit can also stop further propagation by setting `DefaultMemoryLow=` with no argument. This removes further propagation in the subtree, but has no effect on the unit itself (for that, use `MemoryLow=0`). Our use case in production is simplifying the configuration of machines which heavily rely on memory protection tunables, but currently require tweaking a huge number of unit files to make that a reality. This directive makes that significantly less fragile, and decreases the risk of misconfiguration. After this patch is merged, I will implement DefaultMemoryMin= using the same principles.
* test-execute: block /sys not /procZbigniew Jędrzejewski-Szmek2019-03-151-1/+1
| | | | | As explained in the previous commit, blocking /proc can cause us to go into a long loop or fail the test.
* test: add a testcase for ProtectHome=tmpfs vs ProtectSystem=strictYu Watanabe2019-03-131-0/+1
|
* core: add ':' prefix to ExecXYZ= skip env var substitutionAnita Zhang2019-02-201-0/+1
|
* meson: bump timeout for test-udev to 180sFrantisek Sumsal2019-01-211-1/+2
| | | | | | On some (mainly virtual) machines the last test takes more than 30 seconds, which causes unnecessary fails, as the test itself is working properly.
* cgroup: Add DisableControllers= directive to disable controller in subtreeChris Down2018-12-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some controllers (like the CPU controller) have a performance cost that is non-trivial on certain workloads. While this can be mitigated and improved to an extent, there will for some controllers always be some overheads associated with the benefits gained from the controller. Inside Facebook, the fix applied has been to disable the CPU controller forcibly with `cgroup_disable=cpu` on the kernel command line. This presents a problem: to disable or reenable the controller, a reboot is required, but this is quite cumbersome and slow to do for many thousands of machines, especially machines where disabling/enabling a stateful service on a machine is a matter of several minutes. Currently systemd provides some configuration knobs for these in the form of `[Default]CPUAccounting`, `[Default]MemoryAccounting`, and the like. The limitation of these is that Default*Accounting is overrideable by individual services, of which any one could decide to reenable a controller within the hierarchy at any point just by using a controller feature implicitly (eg. `CPUWeight`), even if the use of that CPU feature could just be opportunistic. Since many services are provided by the distribution, or by upstream teams at a particular organisation, it's not a sustainable solution to simply try to find and remove offending directives from these units. This commit presents a more direct solution -- a DisableControllers= directive that forcibly disallows a controller from being enabled within a subtree.
* Merge pull request #10134 from keszybz/test-runnerLennart Poettering2018-10-051-0/+8
|\ | | | | Some test-related fixed and a test runner for installed tests
| * tests: add a runner for installed testsZbigniew Jędrzejewski-Szmek2018-09-241-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have "installed tests", but don't provide an easy way to run them. The protocol is very simple: each test must return 0 for success, 77 means "skipped", anything else is an error. In addition, we want to print test output only if the test failed. I wrote this simple script. It is pretty basic, but implements the functions listed above. Since it is written in python it should be easy to add option parsing (like running only specific tests, or running unsafe tests, etc.) I looked at the following alternatives: - Ubuntu root-unittests: this works, but just dumps all output to the terminal, has no coloring. - @ssahani's test runner [2] It uses the unittest library and the test suite was implented as a class, and doesn't implement any of the functions listed above. - cram [3,4] cram runs our tests, but does not understand the "ignore the output" part, has not support for our magic skip code (it uses hardcoded 80 instead), and seems dead upstream. - meson test Here the idea would be to provide an almost-empty meson.build file under /usr/lib/systemd/tests/ that would just define all the tests. This would allow us to reuse the test runner we use normally. Unfortunately meson requires a build directory and configuration to be done before running tests. This would be possible, but seems a lot of effort to just run a few binaries. [1] https://salsa.debian.org/systemd-team/systemd/blob/242c96addb06480ec9cd75248a5660f37a17b4b9/debian/tests/root-unittests [2] https://github.com/systemd/systemd-fedora-ci/blob/master/upstream/systemd-upstream-tests.py [3] https://bitheap.org/cram/ [4] https://pypi.org/project/pytest-cram/ Fixes #10069.
* | test-execute: add a test for systemcall filter (#10273)Yu Watanabe2018-10-051-0/+1
| | | | | | | | This adds a test for issue #9939 which is fixed by a5404992cc7724ebf7572a0aa89d9fdb26ce0b62 (#9942).
* | fuzz: unify the "fuzz-regressions" directory with the main corpusZbigniew Jędrzejewski-Szmek2018-10-021-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There isn't really much need to keep them separate. Anything which is a good corpus entry can be used as a smoke test, and anything which which is a regression test can just as well be inserted into the corpus. The only functional difference from this patch (apart from different paths in output) is that the regression tests are now zipped together with the rest of the corpus. $ meson configure build -Dslow-tests=true && ninja -C build test ... 307/325 fuzz-dns-packet:issue-7888:address OK 0.06 s 308/325 fuzz-dns-packet:oss-fuzz-5465:address OK 0.04 s 309/325 fuzz-journal-remote:crash-5a8f03d4c3a46fcded39527084f437e8e4b54b76:address OK 0.07 s 310/325 fuzz-journal-remote:crash-96dee870ea66d03e89ac321eee28ea63a9b9aa45:address OK 0.05 s 311/325 fuzz-journal-remote:oss-fuzz-8659:address OK 0.05 s 312/325 fuzz-journal-remote:oss-fuzz-8686:address OK 0.07 s 313/325 fuzz-unit-file:oss-fuzz-6884:address OK 0.06 s 314/325 fuzz-unit-file:oss-fuzz-6885:address OK 0.05 s 315/325 fuzz-unit-file:oss-fuzz-6886:address OK 0.05 s 316/325 fuzz-unit-file:oss-fuzz-6892:address OK 0.05 s 317/325 fuzz-unit-file:oss-fuzz-6897:address OK 0.05 s 318/325 fuzz-unit-file:oss-fuzz-6897-evverx:address OK 0.06 s 319/325 fuzz-unit-file:oss-fuzz-6908:address OK 0.07 s 320/325 fuzz-unit-file:oss-fuzz-6917:address OK 0.07 s 321/325 fuzz-unit-file:oss-fuzz-6977:address OK 0.13 s 322/325 fuzz-unit-file:oss-fuzz-6977-unminimized:address OK 0.12 s 323/325 fuzz-unit-file:oss-fuzz-7004:address OK 0.05 s 324/325 fuzz-unit-file:oss-fuzz-8064:address OK 0.05 s 325/325 fuzz-unit-file:oss-fuzz-8827:address OK 0.52 s
* meson: do not build tests by default when '-Dtests=false'Yu Watanabe2018-09-131-1/+1
| | | | | [zj: it is still possible to build tests explicitly by calling ninja -C build test-name. This way we have full flexibility.]
* meson: disable _all_ tests when -Dtests=falseZbigniew Jędrzejewski-Szmek2018-09-131-10/+18
| | | | | | Back in 08318a2c5acb3d0e4243c36461e69a3e45482441, value "false" was enabled for '-Dtests=', but various tests were not conditionalized properly. So even with -Dtests=false -Dslow-tests=false we'd run 120 tests. Let's make this consistent.
* test: add tests for DynamicUser= with static User= whose UID and GID are ↵Yu Watanabe2018-07-261-0/+2
| | | | different
* Add support for opening files for appendingZsolt Dollenstein2018-07-201-0/+2
| | | | Addresses part of #8983
* Drop my copyright headersZbigniew Jędrzejewski-Szmek2018-06-141-2/+0
| | | | | | | perl -i -0pe 's/\s*Copyright © .... Zbigniew Jędrzejewski.*?\n/\n/gms' man/*xml git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/(#\n)?# +Copyright © [0-9, -]+ Zbigniew Jędrzejewski.*?\n//gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s*\/\*\*\*\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*?\s*\*\*\*\/\s*/\n\n/gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*//gms'
* tree-wide: beautify remaining copyright statementsLennart Poettering2018-06-141-1/+1
| | | | | | Let's unify an beautify our remaining copyright statements, with a unicode ©. This means our copyright statements are now always formatted the same way. Yay.
* test: add test for trailing dot in WorkingDirectory= and RuntimeDirectory=Yu Watanabe2018-06-031-0/+1
|
* test: add tests for merging RestrictNamespaces=Yu Watanabe2018-05-051-0/+3
|
* test: add tests for PrivateDevices= with '+' prefixYu Watanabe2018-05-011-0/+1
|
* Merge pull request #8575 from keszybz/non-absolute-pathsLennart Poettering2018-04-171-0/+1
|\ | | | | Do not require absolute paths in ExecStart and friends
| * systemd: do not require absolute paths in ExecStartZbigniew Jędrzejewski-Szmek2018-04-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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: add test for prefix unit loadingLennart Poettering2018-04-131-4/+9
| |
* | tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
|/ | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* tests: skip udev-test when perl is not installedZbigniew Jędrzejewski-Szmek2018-03-221-3/+7
|
* test-umount: add a simple test for swap_list_get()Zbigniew Jędrzejewski-Szmek2018-03-161-0/+1
| | | | | | | | | The implementation seems buggy: /* test_swap_list("/home/zbyszek/src/systemd/test/test-umount/example.swaps") */ path=0 o= f=0x0 try-ro=no dev=0:0 path=/some/swapfile2 o= f=0x0 try-ro=no dev=0:0 path=/some/swapfile o= f=0x0 try-ro=no dev=0:0 path=/dev/dm-2 o= f=0x0 try-ro=no dev=0:0
* tests: add a simple test for the mountinfo parsing logicZbigniew Jędrzejewski-Szmek2018-03-161-0/+3
|
* test-execute: rename tests for AmbientCapabilities=Yu Watanabe2018-03-041-6/+6
| | | | | | | | 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-021-0/+6
| | | | | | 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.