summaryrefslogtreecommitdiff
path: root/test/hwdb-test.sh
Commit message (Collapse)AuthorAgeFilesLines
* hwdb-test: don't rely on --root= quirkLennart Poettering2022-08-221-3/+3
| | | | | | | | Previously, the test would rely on the fact that systemd-hwdb would follow symlinks outside of the --root= hierarchy. That's a bug however, and systemd-hwdb shouldn't do that. Hence let's remove the fact that the test relies on it, so that we can then fix systemd-hwdb (specifically: conf_files_list()) accordingly.
* tree-wide: drop manually-crafted message for missing variablesZbigniew Jędrzejewski-Szmek2022-05-041-1/+1
| | | | | | | | Bash will generate a very nice message for us: /tmp/ff.sh: line 1: SOMEVAR: parameter null or not set Let's save some keystrokes by not replacing this with our own inferior messages.
* test: shellcheck-ify test scriptsFrantisek Sumsal2021-09-301-2/+3
|
* hwdb-test: pass an explit path to systemd-hwdbZbigniew Jędrzejewski-Szmek2021-04-281-2/+2
| | | | | | | | | | | | | | https://github.com/systemd/systemd/pull/19316 failed with: [1065/1670] Linking target systemd-hwdb --- command --- 14:28:29 /root/src/test/hwdb-test.sh --- stdout --- ./systemd-hwdb does not exist, please build first I'm not sure what is going on here… In principle meson says that tests may be called from any directory, but in practice is was always the build directory. So far we were relying on systemd-hwdb being present in '.', and this worked. Either way, it's nicer to pass the exact path, so let's do that.
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* tests: when creating temp dirs, include test name in pathZbigniew Jędrzejewski-Szmek2020-10-011-1/+1
| | | | | | This makes it easier to figure out which directory we want to look at when tests fail, and also which test left behind a directory when it shouldn't.
* Rename udev's hwdb/ to hwdb.d/Zbigniew Jędrzejewski-Szmek2019-10-101-2/+2
| | | | | As in the parent commit, this makes the name consistent with the rest of the source tree and the actuall installation path.
* 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.
* test: set log_level to info in test-hwdb and check-help-*Yu Watanabe2017-11-261-0/+1
| | | | | | | | | | These tests check the stderr. So, if the systemd.log_level=debug is set in the kernel command line, then these tests fail. This set log_level to info in hwdb-test.sh and meson-check-help.sh, the kernel command line not to change the output of the target programs. Fixes #7362.
* Add SPDX license headers to various assorted filesZbigniew Jędrzejewski-Szmek2017-11-191-2/+4
|
* meson: hook up hwdb-test.sh againZbigniew Jędrzejewski-Szmek2017-09-261-1/+1
| | | | | The motivation for the ./systemd-hwdb is the same as in the grandparent for systemd-sysv-generator.
* hwdb: improve and test syntax error messagesZbigniew Jędrzejewski-Szmek2016-12-011-0/+23
| | | | | | | | | | | | | | | | | | | Since syntax error are non-fatal, downgrade them to warnings. Use log_syntax to have uniform formatting including the line number. State machine states like DATA and MATCH are internal, user-facing messages should use the names from hwdb(7): match, property, record. Also change "key/value" to "key-value", since there's no alternative here, both parts must be present. [/tmp/tmp.KFwEhm74n4/etc/udev/hwdb.d/10-bad.hwdb:2] Property expected, ignoring record with no properties [/tmp/tmp.KFwEhm74n4/etc/udev/hwdb.d/10-bad.hwdb:5] Property expected, ignoring record with no properties [/tmp/tmp.KFwEhm74n4/etc/udev/hwdb.d/10-bad.hwdb:9] Property expected, ignoring record with no properties [/tmp/tmp.KFwEhm74n4/etc/udev/hwdb.d/10-bad.hwdb:11] Key/value pair expected but got " NO_VALUE", ignoring [/tmp/tmp.KFwEhm74n4/etc/udev/hwdb.d/10-bad.hwdb:18] Property or empty line expected, got "BAD:7:match at wrong place", ignoring record [/tmp/tmp.KFwEhm74n4/etc/udev/hwdb.d/10-bad.hwdb:22] Property or empty line expected, got "BAD:8:match at wrong place", ignoring record [/tmp/tmp.KFwEhm74n4/etc/udev/hwdb.d/10-bad.hwdb:23] Match expected but got indented property " Z=z", ignoring line squash! hwdb: improve syntax error messages
* hwdb-test: properly print error output from systemd-hwdb updateZbigniew Jędrzejewski-Szmek2016-12-011-2/+8
| | | | | | | | | | Because -e was set, we'd exit immediately when systemd-hwdb failed and the captured error output was never printed. We want to test two things: that 0 is returned, and that nothing is printed to stderr (to catch syntax errors in the hwdb). v2: stop capturing stderr to a variable v3: capture stderr to a variable and test both error types separately
* tests: add hwdb parsing testMartin Pitt2016-11-241-0/+43
This calls the built "systemd-hwdb update" on the source tree's hwdb/ in a temporary directory and verifies that there are no error messages.