summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* test: make $BUILD_DIR writable when rootfs is mounted read-onlyFrantisek Sumsal2023-05-151-2/+6
| | | | | Adjust two systemd-nspawn invocations where rootfs is mounted read-only, to avoid gcov complaining.
* test: pass $BUILD_DIR as $COVERAGE_BUILD_DIR to the system managerFrantisek Sumsal2023-05-151-0/+5
| | | | To make additional coverage-related tweaks slightly easier.
* test: update nspawn's basic config file used for fuzzingFrantisek Sumsal2023-05-151-3/+32
|
* test: rename TEST-13-NSPAWN-SMOKE to TEST-13-NSPAWNFrantisek Sumsal2023-05-143-2/+2
| | | | To make it consistent with the rest of the tests.
* test: slightly extend the systemd-nspawn testsFrantisek Sumsal2023-05-142-0/+235
|
* test: wait after sending a signal if necessaryFrantisek Sumsal2023-05-141-3/+3
| | | | | On overloaded systems it might take a bit until the signal is sent, processed, and the respective file is created.
* test: install the overlayfs/loop modules unconditionallyFrantisek Sumsal2023-05-144-37/+22
|
* test: create merged-usr containersFrantisek Sumsal2023-05-141-18/+22
|
* test: bind mount the $BUILD_DIR into nspawn containersFrantisek Sumsal2023-05-142-5/+6
| | | | | when collecting coverage. This applies only to containers started via machinectl (or directly via the systemd-nspawn@.service unit).
* test: use dropins to override system configurationFrantisek Sumsal2023-05-141-11/+13
| | | | Instead of touching the configuration files directly.
* Merge pull request #27634 from mrc0mmand/TEST-13-shenanigansLuca Boccassi2023-05-139-325/+622
|\ | | | | test: clean up & extend the nspawn/machinectl test suite
| * test: merge machinectl edit/cat tests into TEST-13Frantisek Sumsal2023-05-132-36/+19
| |
| * test: always install the script utilityFrantisek Sumsal2023-05-133-8/+1
| |
| * test: add a couple of tests for machinectlFrantisek Sumsal2023-05-135-367/+582
| |
| * test: clean up the nspawn tests a bitFrantisek Sumsal2023-05-124-152/+258
| |
* | core: fix memory leak during deserializationFrantisek Sumsal2023-05-131-0/+6
| | | | | | | | | | | | when activation-details-unit-name is encountered multiple times. Resolves: #27623
* | test-network: add tests for static lease matching with chaddrYu Watanabe2023-05-121-0/+11
| | | | | | | | Follow-up for 4646cdaa378fa2aab7334a80228d8a94b316763b (#27313).
* | cryptenroll: actually allow using multiple "special" strings when wipingFrantisek Sumsal2023-05-111-1/+1
|/ | | | | | | | | | | | The systemd-cryptenroll man page states: Takes a comma separated list of numeric slot indexes, or the special strings ..., or any combination of these strings or numeric indexes, in which case all slots matching either are wiped. but we'd allow only one special string at any given time as the value was not ORed when assigning. So, for example, --wipe=recovery,password would actually become --wipe=password, etc.
* Merge pull request #27603 from mrc0mmand/more-test-shenanigansYu Watanabe2023-05-1170-464/+415
|\ | | | | test: merge PID1-related tests into TEST-07-PID1
| * test: abstract the common test parts into a utility scriptFrantisek Sumsal2023-05-107-73/+150
| | | | | | | | | | Also, instead of bailing out on the first failed subtest, always run all subtests and print a summary at the end (with an appropriate exit code).
| * test: merge TEST-20-MAINPIDGAMES into TEST-07-PID1Frantisek Sumsal2023-05-105-46/+39
| |
| * test: merge TEST-51-ISSUE-16115 into TEST-07-PID1Frantisek Sumsal2023-05-108-34/+16
| |
| * test: merge TEST-47-ISSUE-14566 into TEST-07-PID1Frantisek Sumsal2023-05-107-45/+32
| |
| * test: move TEST-23's units into a dedicated subfolderFrantisek Sumsal2023-05-1012-0/+1
| | | | | | | | To remain consistent with other tests.
| * test: merge TEST-12-ISSUE-3171 into TEST-07-PID1Frantisek Sumsal2023-05-105-70/+50
| |
| * test: merge TEST-11-ISSUE-3166 into TEST-07-PID1Frantisek Sumsal2023-05-106-34/+16
| |
| * test: merge TEST-10-ISSUE-2467 with TEST-07-PID1Frantisek Sumsal2023-05-108-40/+27
| |
| * test: merge TEST-09-ISSUE-2691 into TEST-07-PID1Frantisek Sumsal2023-05-104-24/+5
| |
| * test: merge TEST-08-ISSUE-2730 into TEST-07-PID1Frantisek Sumsal2023-05-1010-61/+23
| |
| * test: rename TEST-07-ISSUE-1981 to TEST-07-PID1Frantisek Sumsal2023-05-104-33/+52
| |
* | tmpfiles: Add merge support for copy files actionDaan De Meyer2023-05-101-0/+16
| | | | | | | | | | If '+' is specified with 'C', let's merge the tree with any existing tree.
* | repart: Fix deny list logicDaan De Meyer2023-05-101-0/+19
|/ | | | | | | | | | | | | | | | | | | | | | Until now, we always excluded the top level directories that were covered by child partition mount points, regardless of the source directory and the target directory of the copy files operation. This means that even if we were populating a XBOOTLDR partition, if there was an EFI partition in the image, we'd exclude /boot unconditionally, leading to the XBOOTLDR partition to be empty. Also, because of the same cause, if we were copying a nested source directory (e.g. /abc/def) to the root directory in the root partition, if /abc/def/usr existed and was populated with files and directories, the root partition would have those files under /usr, even if a /usr partition was defined. To fix these issues, instead of unconditionally excluding the top level partition mount points under <source>, let's make sure that when we're copying files from any source directory to the root directory of a root partition, that we exclude the partition mount point directories under the source directory instead of the top level ones.
* test: slightly extend systemd-cryptenroll coverageFrantisek Sumsal2023-05-091-0/+35
|
* test: TEST-70-TPM2 cleanupFrantisek Sumsal2023-05-091-137/+115
| | | | No functional changes.
* test: add coverage for #27533Frantisek Sumsal2023-05-091-0/+0
| | | | | Issue: https://github.com/systemd/systemd/issues/27533 Fix: https://github.com/systemd/systemd/pull/27553
* test: discard kill's outputFrantisek Sumsal2023-05-091-1/+1
|
* test: merge unit file related tests into TEST-23-UNIT-FILEFrantisek Sumsal2023-05-1044-325/+262
| | | | | | | | | | Rename TEST-23-TYPE-EXEC to TEST-23-UNIT-FILE and merge it with following tests: - TEST-37-RUNTIMEDIRECTORYPRESERV - TEST-40-EXEC-COMMAND-EX - TEST-41-ONESHOT-RESTART - TEST-42-EXECSTOPPOST - TEST-57-ONSUCCESS-UPHOLD
* test: use sed and grep instead of perlZbigniew Jędrzejewski-Szmek2023-05-091-16/+13
| | | | | | | | | | | This gets rid of the all-but-one remaining uses of perl. I tested the new code on my machine, so I'm fairly confident that it works as expected. install_iscsi() has one majestic perl invocation, but we can't get rid of it easily: it extends the code of tgt-admin to print some list of files. Obviously this only works because tgt-admin is written in perl, and perl will be installed if tgt-admin is installed. install_iscsi() is used in TEST-64-UDEV-STORAGE conditionally if tgtadm is installed, so this can stay as is.
* test-execute: use bash instead of perlZbigniew Jędrzejewski-Szmek2023-05-091-1/+1
| | | | I think this is easier to grok too.
* test-udev: skip test on python3.6Zbigniew Jędrzejewski-Szmek2023-05-091-1/+1
|
* test/run-unit-tests, TEST-02: skip tests where the interpeter is not installedZbigniew Jędrzejewski-Szmek2023-05-092-2/+5
| | | | | | | | | | | | | | | | | | | | When the interpeter is missing, we get an exit code of 127. Let's treat those tests as skipped too. If we could run the test far enough so that it could do the check itself, it would return 77 anyway. $ test/asdf; echo $? exec: Failed to execute process 'test/asdf': The file specified the interpreter '/bin/asdf', which is not an executable command. 127 $ test/asdf; echo $? /usr/bin/env: ‘/bin/asdf’: No such file or directory 127 This should resolve the problem that TEST-02 fails or Debian's 'unit-tests' fail when python3 is not installed. Installing python3 via the mechanism that is used to construct TEST images, i.e. the dracut dependency chasing scheme, would be a lot of work for python with its modules in multiple locations and hundreds of little files. So I think it OK to just skip the test there, and also in other cases where python is not available.
* test: rework how udev-test is invokedZbigniew Jędrzejewski-Szmek2023-05-092-31/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of the build, we would populate build/test/sys/ using sys-script.py, and then udev-test.p[ly] would create a tmpfs instance on build/test/tmpfs and copy the sys tree to build/test/tmpfs/sys. Also, we had udev-test.p[ly] which called test-udev. test-udev was marked as a manual test and installed, but neither udev-test.p[ly] or sys-script.py were. test-udev is renamed to udev-rule-runner, which reduces confusion and frees up the test-udev name. udev-test.py is renamed to test-udev.py. All three files are now installed. test-udev.py is modified to internally call sys-script.py to set up the sys tree. Copying and creating it from scratch should take the same amount of time. We avoid having a magic directory, everything is now done underneath a temporary directory. test-udev.py is now a normal installed test, and run-unit-tests.py will pick it up. When test-udev.py is invoked from meson, the path to udev-rule-runner is passed via envvar; when it is invoked via run-unit-tests.py or directly, it looks for udev-rule-runner in a relative path. The goal of this whole change is to let Debian drop the 'udev' test. It called sys-script.py and udev-test.pl from the source directory and had to recreate a bunch of the logic. Now test-udev.py will now be called via 'upstream'.
* test: drop udev-test.plZbigniew Jędrzejewski-Szmek2023-05-092-2923/+1
|
* test: rewrite udev-test.pl in PythonZbigniew Jędrzejewski-Szmek2023-05-092-1/+2416
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I tried to keep this a 1:1 rewrite with the same field names. Nevertheless, some changes were made: - exp_add_error and exp_rem_error are dropped. Those fields meant that "./test-udev add <devpath>" actually succeeded, but symlinks were not created, and exp_links was ignored and could contain bogus content. Instead, exp_links and not_exp_links are adjusted to not contain garbage and the tests check that "./test-udev add" succeeds and that the links are as expected from exp_links and not_exp_links. - cleanup was only used in one rule, and that rule was expected to fail, so cleanup wasn't actually necessary. So the cleanup field and the logic to call cleanup from individual tests is removed. - a bunch of fields were set, but didn't seem to be connected to any implementation: not_exp_name, not_exp_test. e62acc3159935781f05fa59c48e5a74e85c61ce2 did a rewrite of some of the tests and it seems that not_exp_test was added by mistake and not_exp_name was left behind by mistake. In Python, the field list is declared in the class, so it's harder to assign an unused attribute. Those uses were converted to not_exp_links. - in most rules, r"""…""" is used, so that escaping is not necessary. - the logic to generate devices was only used in one place, and the generator function also had provisions to handle arguments that were never given. all_block_devs() is made much simpler. - Descriptions that started with a capital letter were shortened and lowercased. - no special test case counting is done. pytest just counts the cases (Rules objects). - the output for failures is also removed. If something goes wrong, the user can use pytest --pdb or such to debug the issue. - perl version used a semaphore to manage udev runners, and would fork, optionally wait a bit, and then start the runner. In the python version, we just spawn them all and wait for them to exit. It's not very convenient to call fork() from python, so instead the runner was modified (in previous commit) to wait. The test can be called as: (cd build && sudo pytest -v ../test/udev-test.py) sudo meson test -C build udev-test.py -v I think this generally provides functionality that is close to the perl version. It seems some of the checks are now more fully implemented. Support for strace/gdb/valgrind is missing. Runtime goes down: 8.36 s → 5.78 s.
* test: add a test case for #27521Frantisek Sumsal2023-05-051-0/+0
| | | | Which got resolved by e652663a04.
* core: check the unit type more thoroughly when deserializingFrantisek Sumsal2023-05-051-0/+4
| | | | Resolves: #27523
* shared: refuse fd == INT_MAXFrantisek Sumsal2023-05-051-0/+3
| | | | | | | Since we do `FD_TO_PTR(fd)` that expands to `INT_TO_PTR(fd) + 1` which triggers an integer overflow. Resolves: #27522
* test: clean up the test script even furtherFrantisek Sumsal2023-05-032-90/+66
| | | | | | | Most notably: - use `systemd-id128 new` instead of `journalctl --new-id128` - move all temporary files to /tmp - wrap repetitive checks in a function
* test: vacuum the journal after the "stress test"Frantisek Sumsal2023-05-031-0/+1
| | | | To make the rest of the test significantly faster.
* test: slightly extend checks on corrupted journalsFrantisek Sumsal2023-05-031-8/+14
|