From: Martin Pitt Date: Wed, 6 Apr 2016 21:18:06 +0000 (+0200) Subject: test: udev: Check tags X-Git-Tag: v230~203^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bf8f7583ee2a6f93ede82c97d6b47f1f4a7245db;p=thirdparty%2Fsystemd.git test: udev: Check tags Add two more tests: - Add a single tag, match on it, don't match on another. - Add 10.000 tags to a device, ensure that udev survives this. (Reproduces crash fixed by commit 1d88a271a) --- diff --git a/test/udev-test.pl b/test/udev-test.pl index 60c10b3889b..da0a4e1f6b4 100755 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -35,6 +35,11 @@ my $udev_rules_dir = "$udev_run/udev/rules.d"; my $udev_rules = "$udev_rules_dir/udev-test.rules"; my $EXIT_TEST_SKIP = 77; +my $rules_10k_tags = ""; +for (my $i = 1; $i <= 10000; ++$i) { + $rules_10k_tags .= 'KERNEL=="sda", TAG+="test' . $i . "\"\n"; +} + my @tests = ( { desc => "no rules", @@ -1317,6 +1322,25 @@ EOF rules => < "add and match tag", + devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda", + exp_name => "found", + not_exp_name => "bad" , + rules => < "don't crash with lots of tags", + devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda", + exp_name => "found", + rules => $rules_10k_tags . <