From 1aa1e24848903d11780db1ade355be73ad61a937 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Mon, 9 Jan 2006 21:18:00 +0100 Subject: replace libsysfs We never used any of the libsysfs convenience features. Here we replace it completely with 300 lines of code, which are much simpler and a bit faster cause udev(d) does not open any syfs file for a simple event which does not need any parent device information. Signed-off-by: Kay Sievers --- test/udev-test.pl | 51 +++++++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 22 deletions(-) (limited to 'test/udev-test.pl') diff --git a/test/udev-test.pl b/test/udev-test.pl index c33c79b1c0..7ce920092f 100755 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -243,18 +243,18 @@ EOF desc => "test substitution chars", subsys => "block", devpath => "/block/sda/sda3", - exp_name => "Major:8:minor:3:kernelnumber:3:bus:0:0:0:0" , + exp_name => "Major:8:minor:3:kernelnumber:3" , rules => < "test substitution chars (with length limit)", subsys => "block", devpath => "/block/sda/sda3", - exp_name => "M8-m3-n3-b0:0-sIBM" , + exp_name => "M8-m3-n3-bsd-sIBM" , rules => < "program result substitution", subsys => "block", devpath => "/block/sda/sda3", - exp_name => "test-0:0:0:0" , + exp_name => "test-3" , rules => < "test substitution by variable name", subsys => "block", devpath => "/block/sda/sda3", - exp_name => "Major:8-minor:3-kernelnumber:3-bus:0:0:0:0" , + exp_name => "Major:8-minor:3-kernelnumber:3" , rules => < "test substitution by variable name 2", subsys => "block", devpath => "/block/sda/sda3", - exp_name => "Major:8-minor:3-kernelnumber:3-bus:0:0:0:0" , + exp_name => "Major:8-minor:3-kernelnumber:3-name:sda3" , rules => < "test substitution by variable name 3", subsys => "block", devpath => "/block/sda/sda3", - exp_name => "830:0:0:03" , + exp_name => "83sda33" , rules => < "test substitution by variable name 5", subsys => "block", devpath => "/block/sda/sda3", - exp_name => "8330:0:0:0" , + exp_name => "833sda3" , rules => < "program and bus type match", subsys => "block", devpath => "/block/sda", - exp_name => "scsi-0:0:0:0" , + exp_name => "scsi-sda" , rules => < "symlink2-ttyUSB0", exp_target => "ttyUSB0", rules => < "symlink %b substitution", + desc => "symlink %k substitution", subsys => "block", devpath => "/block/sda", - exp_name => "symlink-0:0:0:0", + exp_name => "symlink-sda", exp_target => "node", rules => <; + close $fd; + $dev =~ m/^(.+):(.+)$/; + $ENV{MAJOR} = $1; + $ENV{MINOR} = $2; + # create temporary rules open CONF, ">$udev_rules" || die "unable to create rules file: $udev_rules"; print CONF $$rules; -- cgit v1.2.3-54-g00ecf