chiark / gitweb /
fix tests and remove no longer useful stuff
authorKay Sievers <kay.sievers@suse.de>
Thu, 10 Nov 2005 00:50:06 +0000 (01:50 +0100)
committerKay Sievers <kay.sievers@suse.de>
Thu, 10 Nov 2005 00:50:06 +0000 (01:50 +0100)
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
test/devd_test [deleted file]
test/net_test [deleted file]
test/replace_test [deleted file]
test/show_all_devices.sh [deleted file]
test/test.all [deleted file]
test/test.block [deleted file]
test/test.tty [deleted file]
test/testd.block [deleted file]
test/udev-test.pl
udev_remove.c

diff --git a/test/devd_test b/test/devd_test
deleted file mode 100755 (executable)
index 534e787..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/bash
-
-RULES=label_test.rules
-CONFIG=label_test.conf
-
-export SYSFS_PATH=$PWD/sys/
-export UDEV_CONFIG_FILE=$PWD/$CONFIG
-
-cat > $RULES << EOF
-BUS="scsi", SYSFS{vendor}="IBM-ESXS", SYSFS{model}="ST336605LW   !#", NAME="boot_diskX%n"
-BUS="scsi", SYSFS{vendor}="IBM-ESXS", SYSFS{model}="ST336605LW    !#", NAME="a/nice/place/to/put/a/boot_disk%n"
-EOF
-
-cat > $CONFIG << EOF
-udev_root="$PWD/udev/"
-udev_db="$PWD/udev/.udevdb"
-udev_rules="$PWD/$RULES"
-EOF
-
-mkdir udev
-
-export ACTION=add
-export DEVPATH=block/sda
-
-../udev block
-ls -l udev
-
-export ACTION=remove
-export DEVPATH=block/sda
-
-../udev block
-ls -l udev
-
-
-rm $RULES
-rm $CONFIG
-rm -rf udev
diff --git a/test/net_test b/test/net_test
deleted file mode 100755 (executable)
index 9daf8da..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-
-RULES=label_test.rules
-CONFIG=label_test.conf
-
-export SYSFS_PATH=$PWD/sys/
-export UDEV_CONFIG_FILE=$PWD/$CONFIG
-
-cat > $RULES << EOF
-SYSFS{address}="00:e0:00:8d:9f:25", NAME="wireless"
-EOF
-
-cat > $CONFIG << EOF
-udev_root="$PWD/udev/"
-udev_db="$PWD/udev/.udevdb"
-udev_rules="$PWD/$RULES"
-EOF
-
-mkdir udev
-
-export ACTION=add
-export DEVPATH=class/net/eth1
-
-../udevtest class/net/eth1 net
-ls -l udev
-
-export ACTION=remove
-export DEVPATH=class/net/eth1
-
-../udevtest class/net/eth1 net
-ls -l udev
-
-rm $RULES
-rm $CONFIG
-rm -rf udev
diff --git a/test/replace_test b/test/replace_test
deleted file mode 100755 (executable)
index 6e01f28..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-
-RULES=replace_test.rules
-CONFIG=replace_test.conf
-
-export SYSFS_PATH=$PWD/sys/
-export UDEV_CONFIG_FILE=$PWD/$CONFIG
-
-cat > $RULES << EOF
-KERNEL="ttyUSB0", NAME="visor"
-EOF
-
-cat > $CONFIG << EOF
-udev_root="$PWD/udev/"
-udev_db="$PWD/udev/.udevdb"
-udev_rules="$PWD/$RULES"
-EOF
-
-mkdir udev
-
-export DEVPATH=class/tty/ttyUSB0
-export ACTION=add
-
-../udev tty
-ls -l udev
-
-export ACTION=remove
-../udev tty
-ls -l udev
-
-rm $RULES
-rm $CONFIG
-rm -rf udev
diff --git a/test/show_all_devices.sh b/test/show_all_devices.sh
deleted file mode 100755 (executable)
index 921b8e6..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#! /bin/bash
-#
-# Directory where sysfs is mounted
-SYSFS_DIR=/sys
-
-# handle block devices and their partitions
-for i in ${SYSFS_DIR}/block/*; do
-       # each drive
-       echo ${i#${SYSFS_DIR}/block/}
-
-       # each partition, on each device
-       for j in $i/*; do
-               if [ -f $j/dev ]; then
-                       echo ${j#${SYSFS_DIR}} | cut --delimiter='/' --fields=4-
-               fi
-       done
-done
-
-# all other device classes
-for i in ${SYSFS_DIR}/class/*; do
-       for j in $i/*; do
-               if [ -f $j/dev ]; then
-                       echo ${j#${SYSFS_DIR}} | cut --delimiter='/' --fields=4-
-               fi
-       done
-done
-
diff --git a/test/test.all b/test/test.all
deleted file mode 100755 (executable)
index 527569b..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#! /bin/sh
-#
-# test.block - run udev(8) on each block device in /sys/block
-
-if [ $# = "0" ] ; then
-       echo
-       echo "usage: $0 <action>"
-       echo "where <action> is \"add\" or \"remove\""
-       echo
-       exit 1
-fi
-
-SYSFSDIR=/sys          # change this for a nonstand sysfs mount point
-BIN=../udev            # location of your udev binary
-export ACTION=$1       # 'add' or 'remove'
-
-# do the block devices first
-for i in ${SYSFSDIR}/block/*; do
-       # add each drive
-       export DEVPATH=${i#${SYSFSDIR}}
-       $BIN block
-
-       # add each partition, on each device
-       for j in $i/*; do
-               if [ -f $j/dev ]; then
-                       export DEVPATH=${j#${SYSFSDIR}}
-                       $BIN block
-               fi
-       done
-done
-
-# now all the devices in the class directories
-for i in ${SYSFSDIR}/class/*; do
-       for j in $i/*; do
-               if [ -f $j/dev ]; then
-                       export DEVPATH=${j#${SYSFSDIR}}
-                       CLASS=`echo ${i#${SYSFSDIR}} | cut --delimiter='/' --fields=3-`
-                       $BIN $CLASS
-               fi
-       done
-done
diff --git a/test/test.block b/test/test.block
deleted file mode 100755 (executable)
index 294c47c..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#! /bin/sh
-#
-# test.block - run udev(8) on each block device in /sys/block
-
-if [ $# = "0" ] ; then
-       echo
-       echo "usage: $0 <action>"
-       echo "where <action> is \"add\" or \"remove\""
-       echo
-       exit 1
-fi
-
-SYSFSDIR=/sys          # change this for a nonstand sysfs mount point
-BIN=../udev            # location of your udev binary
-export ACTION=$1       # 'add' or 'remove'
-
-for i in ${SYSFSDIR}/block/*; do
-       # add each drive
-       export DEVPATH=${i#${SYSFSDIR}}
-       $BIN block
-
-       # add each partition, on each device
-       for j in $i/*; do
-               if [ -f $j/dev ]; then
-                       export DEVPATH=${j#${SYSFSDIR}}
-                       $BIN block
-               fi
-       done
-done
diff --git a/test/test.tty b/test/test.tty
deleted file mode 100755 (executable)
index b89ad5a..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#! /bin/sh
-#
-# test.tty - run udev(8) on each tty device in /sys/class/tty
-
-if [ $# = "0" ] ; then
-       echo
-       echo "usage: $0 <action>"
-       echo "where <action> is \"add\" or \"remove\""
-       echo
-       exit 1
-fi
-
-SYSFSDIR=/sys          # change this for a nonstand sysfs mount point
-BIN=../udev            # location of your udev binary
-export ACTION=$1       # 'add' or 'remove'
-
-for i in ${SYSFSDIR}/class/tty/*; do
-       export DEVPATH=${i#${SYSFSDIR}}
-       $BIN tty
-done
diff --git a/test/testd.block b/test/testd.block
deleted file mode 100755 (executable)
index ca9ac8c..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/bash
-#
-# test.block - run udev(8) on each block device in /sys/block
-
-if [ $# = "0" ] ; then
-       echo
-       echo "usage: $0 <action>"
-       echo "where <action> is \"add\" or \"remove\""
-       echo
-       exit 1
-fi
-
-killall udevd
-
-SYSFSDIR=/sys          # change this for a nonstand sysfs mount point
-BIN=./udevsend         # location of your udev binary
-export ACTION=$1       # 'add' or 'remove'
-seq=1
-
-for i in ${SYSFSDIR}/block/*; do
-       # add each drive
-       export DEVPATH=${i#${SYSFSDIR}}
-       export SEQNUM=$seq
-       $BIN block
-       x=$((seq++))
-
-       # add each partition, on each device
-       for j in $i/*; do
-               if [ -f $j/dev ]; then
-                       export DEVPATH=${j#${SYSFSDIR}}
-                       export SEQNUM=$seq
-                       $BIN block
-                       x=$((seq++))
-               fi
-       done
-done
index 44bc483..2549c7e 100755 (executable)
@@ -262,9 +262,9 @@ EOF
                desc            => "import of shell-value file",
                subsys          => "block",
                devpath         => "/block/sda",
-               exp_name        => "subdir/sys/node" ,
+               exp_name        => "subdir/info/node" ,
                rules           => <<EOF
-BUS=="scsi", IMPORT{file}="test.all", NAME="subdir%E{SYSFSDIR}/node"
+BUS=="scsi", IMPORT{file}="udev-test.conf", NAME="subdir/%E{udev_log}/node"
 KERNEL=="ttyUSB0", NAME="visor"
 EOF
        },
@@ -1763,6 +1763,7 @@ open CONF, ">$udev_conf" || die "unable to create config file: $udev_conf";
 print CONF "udev_root=\"$udev_root\"\n";
 print CONF "udev_db=\"$udev_db\"\n";
 print CONF "udev_rules=\"$udev_rules\"\n";
+print CONF "udev_log=\"info\"\n";
 close CONF;
 
 my $test_num = 1;
index cb5523a..4d1b928 100644 (file)
@@ -152,8 +152,8 @@ int udev_remove_device(struct udevice *udev)
                dbg("remove name='%s'", udev->name);
                udev_db_delete_device(udev);
        } else {
-               dbg("'%s' not found in database, don't remove anything", udev->devpath);
-               return -1;
+               dbg("'%s' not found in database, using kernel name '%s'", udev->devpath, udev->kernel_name);
+               strlcpy(udev->name, udev->kernel_name, sizeof(udev->name));
        }
 
        return delete_node(udev);