summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #27013 from fbuihuu/test-fixletsYu Watanabe2023-03-281-4/+13
|\ | | | | Test fixlets
| * test: don't export $TOOLS_DIRFranck Bui2023-03-271-2/+2
| | | | | | | | It's not (and shouldn't be) used by any test scripts.
| * test: clean up $STATEDIR tooFranck Bui2023-03-271-0/+1
| |
| * test: $STATEDIR should not point to /usr/lib/systemd/tests when NO_BUILD=1Franck Bui2023-03-271-2/+10
| | | | | | | | | | | | | | | | When testing the binaries from the host, make sure to not store the state data below /usr but use a dedicated directory in /var/tmp/ instead. The working directories of the tests, initially located in /var/tmp, are also moved in a dedicated directory /var/tmp/systemd-tests.
* | Merge pull request #26993 from mrc0mmand/TEST-46-tweaksYu Watanabe2023-03-281-2/+2
|\ \ | | | | | | test: explicitly pull in systemd-userdbd.service
| * | test: explicitly pull in systemd-userdbd.socketFrantisek Sumsal2023-03-271-2/+2
| | | | | | | | | | | | | | | | | | Since we don't run preset-all on the test image, the systemd-userdbd.socket remains disabled. Let's pull it in explicitly to give systemd-userdbd some coverage as well.
* | | udev-rules: fix grammar in diagnostics about lines that have no effectDmitry V. Levin2023-03-271-11/+11
| | | | | | | | | | | | Fixes: 25de7aa7b90c ("udev: modernize udev-rules.c")
* | | udev-rules: extend the check for conflicting expressionsDmitry V. Levin2023-03-271-0/+4
| | | | | | | | | | | | | | | | | | | | | Log an error when a rule line contains the following kind of conflicting match expressions: KEY=="foo*", KEY=="bar*"
* | | udev-rules: check token delimitersDmitry V. Levin2023-03-271-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When udev_rules_parse_file() is called by udevadm verify, issue warnings about the following conditions in udev rules: * the first token in the rule is preceded with a comma * the last token in the rule is followed by a comma * there is no comma between tokens * there is no whitespace between tokens * there is more than a single comma between tokens * there is whitespace between a token and a comma * there is no whitespace after comma
* | | testsuite-17.11.sh: add commas between tokensDmitry V. Levin2023-03-271-13/+13
| |/ |/|
* | Merge pull request #26870 from fbuihuu/move-unit-tests-in-a-dedicated-subdirLuca Boccassi2023-03-276-23/+24
|\ \ | | | | | | Move unit tests in a dedicated subdir
| * | test: install symlinks with valid targets on SUSE and DebianFranck Bui2023-03-261-2/+2
| | |
| * | test: on openSUSE install the collection of unit test binaries in the target ↵Franck Bui2023-03-242-10/+8
| | | | | | | | | | | | only for TEST-02-UNITTESTS
| * | meson: make sure the unit test scripts find testdata/ even if they are not ↵Franck Bui2023-03-241-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | installed in the same directory testdata/ is shared by both the unit tests and the integration tests. Hence it makes sense to place them right under /usr/lib/systemd/tests/ while the tests themself are located under dedicated sub-directories: /usr/lib/systemd/tests/ ├── integration-tests ├── testdata └── unit-tests ├── testdata -> ../testdata However the unit tests implemented as shell scripts (such as test-fstab-generator.sh) expect to find testdata/ where the scripts are installed, ie they do something like: src="$(dirname "$0")/testdata/test-fstab-generator" This patch installs a symlink in 'unitestsdir' named "testdata" and that points to whatever value 'testdata_dir' is set.
| * | meson: define testdata_dir globallyFranck Bui2023-03-241-2/+0
| | |
| * | test: install unit tests in a dedicated subdirectory below '$testsdir'Franck Bui2023-03-245-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | /usr/lib/systemd/tests may contain more than the unit tests. For example on SUSE we also install the integration tests there. Putting the unit tests in a dedicated directory named 'unit-tests' makes the layout cleaner. Note that `run-unit-tests.py` has not been moved so we don't need to adjust (Fedora) packaging and users also don't need to descend into the subdirectory.
* | | Merge pull request #26294 from yuwata/locale-verify-confZbigniew Jędrzejewski-Szmek2023-03-271-0/+97
|\ \ \ | |_|/ |/| | locale: verify loaded keymap or friends
| * | test: add test for invalid keymap settingYu Watanabe2023-03-251-0/+97
| |/
* | Merge pull request #26973 from mrc0mmand/userdbctl-testsYu Watanabe2023-03-261-0/+136
|\ \ | | | | | | test: add a couple of tests for userdbctl
| * | test: add a couple of tests for userdbctlFrantisek Sumsal2023-03-251-0/+136
| |/
* | Merge pull request #26983 from mrc0mmand/coredump-test-followupYu Watanabe2023-03-262-10/+3
|\ \ | | | | | | test: don't expand the subshell expression prematurely
| * | test: drop unnecessary returnFrantisek Sumsal2023-03-251-2/+0
| | | | | | | | | | | | Return code of the EXIT trap handler is ignored in bash.
| * | test: don't touch the /failed marker in the subtest scriptsFrantisek Sumsal2023-03-251-5/+0
| | | | | | | | | | | | As it is already handled by the "main" script (testsuite-74.sh).
| * | test: don't expand the subshell expression prematurelyFrantisek Sumsal2023-03-251-3/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | We need to expand the subshell expression during the `bash -c` invocation, not before, to take the desired effect, as now it expands to: timeout 30 bash -c 'while [[ 0 -eq 0 ]]; do sleep 1; done' instead of the expected: timeout 30 bash -c 'while [[ $(coredumpctl list -q --no-legend 770 | wc -l) -eq 0 ]]; do sleep 1; done' Follow-up to aadbd81f7f.
* | test: filter the merged coverage report insteadFrantisek Sumsal2023-03-251-1/+1
| | | | | | | | | | | | | | So we don't have to do this twice - once for the base report and then for each "real" one. Follow-up to 7fdd6e157a.
* | test: do an initial coverage captureFrantisek Sumsal2023-03-251-8/+25
|/ | | | | | | | | | I noticed that our coverage reports miss some files completely - this happens when the test doesn't touch the code in them at all, so the generated coverage data (and resulting reports) have no information about them. Let's fix this by doing an initial zero coverage capture that contains a zeroed counter for every instrumented line in every file, so when we later merge it with a capture from the test, it shows up with a missing coverage instead of not showing at all.
* test: add a couple of tests for systemd-coredumpFrantisek Sumsal2023-03-241-0/+175
|
* test-coredump-util: add tests for parse_aux()Zbigniew Jędrzejewski-Szmek2023-03-2313-57/+29
| | | | | | | | The test files are /proc//auxv files copies from various architecutres signified by the file name suffix. Those tests are fairly simple, but when we run them on n architectures, we do ~n² cross-arch tests.
* Merge pull request #26214 from YHNdnzj/sd-notify-change-notifyaccessMike Yuan2023-03-247-0/+85
|\ | | | | core: support overriding NOTIFYACCESS= through sd-notify during runtime
| * test: add tests for NOTIFYACCESS override through sd_notifyMike Yuan2023-03-227-0/+85
| |
* | udev-rules: fix nvme symlink creation on namespace changesThomas Blume2023-03-211-0/+2
|/ | | | | | | | | | The nvme by-id symlink changes to the latest namespace when a new namespace gets added, for example by connecting multiple NVMe/TCP host controllers via nvme connect-all. That is incorrect for persistent device links. The persistent symbolic device link should continue to point to the same NVMe namespace throughout the lifetime of the current boot. Therefore the namespace id needs to be added to the link name.
* udev-rules: add another check for conflicting expressionsDmitry V. Levin2023-03-211-0/+3
| | | | | | | Log an error when a rule line contains the following kind of conflicting match expressions: KEY=="foo", KEY=="bar"
* udev-rules: fix check for conflicting and duplicate expressionsDmitry V. Levin2023-03-191-0/+8
| | | | | | | Fix check for conflicting and duplicate expressions of types that support alternative patterns. Fixes: 3ec58d0cd8f6 ("udev-rules: check for conflicting and duplicate expressions")
* test-systemd-tmpfiles.py: create global temporary directoryYu Watanabe2023-03-181-1/+2
| | | | | | | | | | | For some unknown reasons, the temporary directory created by the test below is not removed: ``` # Test the case that a valid symlink is in the path. label = 'valid_symlink-deep' test_content('f= {} - - - - ' + label, label, user=user, subpath='/deep/1/2', path_cb=valid_symlink) ``` To keep /tmp clean, let's create the global temprary directory.
* test-systemd-tmpfiles.py: use test_content() at one more placeYu Watanabe2023-03-181-6/+1
|
* Merge pull request #26783 from yuwata/loop-ref-follow-upDaan De Meyer2023-03-171-1/+21
|\ | | | | udev: slightly extend comment and add more tests
| * test-50-dissect: add test for long reference nameYu Watanabe2023-03-141-1/+21
| |
* | Merge pull request #26803 from yuwata/udevadm-verify-summaryYu Watanabe2023-03-171-35/+75
|\ \ | | | | | | udevadm-verify: print a short summary
| * | test: add tests for summary output of udevadm verifyYu Watanabe2023-03-161-11/+50
| | |
| * | test: reindent testsuite-17.11.shYu Watanabe2023-03-161-35/+36
| | |
* | | test: wrap mkfs.*/mksquashfs/mkswap binaries when running w/ ASanFrantisek Sumsal2023-03-161-5/+7
|/ /
* | Merge pull request #26771 from YHNdnzj/machinectl-editYu Watanabe2023-03-162-0/+47
|\ \ | | | | | | machinectl: add verb edit and cat to operate on .nspawn files
| * | test: add testsuite-74.machinectlMike Yuan2023-03-152-0/+47
| | |
* | | test: fix testsuite-17.10.shDmitry V. Levin2023-03-161-0/+1
| | | | | | | | | | | | | | | | | | Make sure /etc/udev/hwdb.d/ exists before creating a file inside it. Fixes: 95cf8cae77f7 ("test: add coverage test for udevadm")
* | | udev-rules: check for conflicting and duplicate expressionsDmitry V. Levin2023-03-161-2/+24
|/ / | | | | | | | | | | | | | | Log an error when a rule line contains conflicting match expressions, e.g. NAME=="value", NAME!="value" Log a warning when a rule line contains duplicate expressions, e.g. NAME=="value", NAME=="value"
* | Merge pull request #26804 from fbuihuu/fixes-for-test-58-repartLuca Boccassi2023-03-152-3/+3
|\ \ | | | | | | Fixes for test 58 repart
| * | tests: don't use absolute paths when installing binaries in TEST-58-REPARTFranck Bui2023-03-141-2/+2
| | | | | | | | | | | | | | | | | | Let image_install figures the binary paths out itself as not all distributions ship the mkfs.* tools in the same location. For example openSUSE ships mksquashfs in /usr/bin/.
| * | tests: fix inverted condition in testsuite-58.shFranck Bui2023-03-141-1/+1
| | |
* | | core: make the memory pressure cgroup path writable when ↵Luca Boccassi2023-03-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | ProtectControlGroups=yes The interface requires services to write to the cgroup file to activate notifications, but with ProtectControlGroups=yes we make it read-only. Add a writable bind mount. Follow-up for 6bb0084204bd93122c9f04391b80aea5a8a0ff08
* | | test: assume run-unit-tests.py and unit tests are installed in the same ↵Franck Bui2023-03-151-3/+4
| | | | | | | | | | | | | | | | | | | | | directory This avoids hard coding the path of the directory where the unit tests are installed.