summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@strace.io>2023-03-26 08:00:00 +0000
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-04-03 23:44:26 +0900
commit56df2f6f9b0d37169b3d9112ad5701a4d3692b8d (patch)
tree63135daeb5459362ba9d0f01a9d5b8e694f57548 /test
parentacbb504eaf1be51572b1c0d0d490ac478bc41c64 (diff)
downloadsystemd-56df2f6f9b0d37169b3d9112ad5701a4d3692b8d.tar.gz
udev-rules: check tokens order
When invoked by udevadm verify, warn about rules that have PROGRAM assignments specified after RESULT checks.
Diffstat (limited to 'test')
-rwxr-xr-xtest/units/testsuite-17.11.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/units/testsuite-17.11.sh b/test/units/testsuite-17.11.sh
index e3a96e5cdb..ce6f58077f 100755
--- a/test/units/testsuite-17.11.sh
+++ b/test/units/testsuite-17.11.sh
@@ -300,6 +300,9 @@ test_syntax_error 'ACTION=="a" NAME="b"' 'A comma between tokens is expected.'
test_syntax_error 'ACTION=="a",, NAME="b"' 'More than one comma between tokens.'
test_syntax_error 'ACTION=="a" , NAME="b"' 'Stray whitespace before comma.'
test_syntax_error 'ACTION=="a",NAME="b"' 'Whitespace after comma is expected.'
+test_syntax_error 'RESULT=="a", PROGRAM="b"' 'Reordering RESULT check after PROGRAM assignment.'
+test_syntax_error 'RESULT=="a*", PROGRAM="b", RESULT=="*c", PROGRAM="d"' \
+ 'Reordering RESULT check after PROGRAM assignment.'
cat >"${rules}" <<'EOF'
KERNEL=="a|b", KERNEL=="a|c", NAME="d"
@@ -308,6 +311,7 @@ KERNEL!="a", KERNEL!="b", NAME="c"
KERNEL=="|a", KERNEL=="|b", NAME="c"
KERNEL=="*", KERNEL=="a*", NAME="b"
KERNEL=="a*", KERNEL=="c*|ab*", NAME="d"
+PROGRAM="a", RESULT=="b"
EOF
assert_0 "${rules}"