]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-efi-string: add more cases
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Wed, 1 Apr 2026 13:47:30 +0000 (15:47 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Wed, 1 Apr 2026 14:01:58 +0000 (16:01 +0200)
This excercises the patterns used in
45e4df9a331208d20ecb9f5ead8110eb50a5b86d.

src/boot/test-efi-string.c

index 76a891ec1fa692af2b98d216cd443690f307e072..7633534dd4c07847ff645f968e76eeb78285609f 100644 (file)
@@ -475,6 +475,12 @@ TEST(efi_fnmatch) {
         TEST_FNMATCH_ONE_MAY_SKIP_LIBC("[a\\-z]", "b", false);
         TEST_FNMATCH_ONE("?a*b[.-0]c", "/a/b/c", true);
         TEST_FNMATCH_ONE("debian-*-*-*.*", "debian-jessie-2018-06-17-kernel-image-5.10.0-16-amd64.efi", true);
+        TEST_FNMATCH_ONE("console=*", "console=xxx", true);
+        TEST_FNMATCH_ONE("* console=*", "opt1 console=ttyS0 opt2", true);
+        TEST_FNMATCH_ONE("console=*", " console=xxx", false);
+        TEST_FNMATCH_ONE("* console=", "opt1 console=ttyS0 opt2", false);
+        TEST_FNMATCH_ONE("console=*", "netconsole=@/eth0,@10.0.0.1/", false);
+        TEST_FNMATCH_ONE("* console=*", "netconsole=@/eth0,@10.0.0.1/", false);
 
         /* These would take forever with a backtracking implementation. */
         TEST_FNMATCH_ONE(