summaryrefslogtreecommitdiffstats
path: root/test/test-udev.py
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-09-15 06:49:32 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-09-15 16:09:26 +0200
commit5f5c5c48b9edd3f2aa634d0d8e40ff77e116879e (patch)
tree726c2a179ea1dcbfa296be9348d7becceb9dd35d /test/test-udev.py
parentudev-rules: embed UdevRuleToken.attr_match_remove_trailing_whitespace flag in... (diff)
downloadsystemd-5f5c5c48b9edd3f2aa634d0d8e40ff77e116879e.tar.xz
systemd-5f5c5c48b9edd3f2aa634d0d8e40ff77e116879e.zip
udev-rules: support case insensitive match
This introduces 'i' prefix for match string. When specified, string or pattern will match case-insensitively. Closes #34359. Co-authored-by: Ryan Wilson <ryantimwilson@meta.com>
Diffstat (limited to 'test/test-udev.py')
-rwxr-xr-xtest/test-udev.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test-udev.py b/test/test-udev.py
index d9d840eb8c..68c48fd790 100755
--- a/test/test-udev.py
+++ b/test/test-udev.py
@@ -2313,6 +2313,17 @@ SUBSYSTEMS=="scsi", PROGRAM=="/bin/sh -c \"printf %%s 'foo1 foo2' | grep 'foo1 f
SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNEL=="sd*", SYMLINK+="blockdev"
KERNEL=="sda6", OPTIONS+="link_priority=10"
"""),
+
+ Rules.new(
+ "case insensitive match",
+ Device(
+ "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
+ exp_links = ["ok"],
+ ),
+
+ rules = r"""
+ KERNEL==i"SDA1", SUBSYSTEMS==i"SCSI", ATTRS{vendor}==i"a?a", SYMLINK+="ok"
+ """),
]
def fork_and_run_udev(action: str, rules: Rules) -> None: