fix tests and remove no longer useful stuff

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
This commit is contained in:
Kay Sievers
2005-11-10 01:50:06 +01:00
parent f5f8f316aa
commit 53899a171e
10 changed files with 5 additions and 262 deletions
-37
View File
@@ -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
-35
View File
@@ -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
-33
View File
@@ -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
-27
View File
@@ -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
-41
View File
@@ -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
-29
View File
@@ -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
-20
View File
@@ -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
-36
View File
@@ -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
+3 -2
View File
@@ -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;
+2 -2
View 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);