测试UDEV

使用udevadm test可以进行udev的测试
但其只接受udevadm info -q path -n /dev/sdb1 的输出作为参数

[root@node1 ~]# udevadm info -q path -n /dev/sdb1
/devices/pci0000:00/0000:00:10.0/host0/target0:0:1/0:0:1:0/block/sdb/sdb1
[root@node1 ~]# udevadm test --action=add /devices/pci0000:00/0000:00:10.0/host0/target0:0:1/0:0:1:0/block/sdb/sdb1
calling: test
version 219
This program is for debugging only, it does not run any program
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

=== trie on-disk ===
tool version:          219
file size:         7259752 bytes
header size             80 bytes
strings            1887992 bytes
nodes              5371680 bytes
Load module index
Created link configuration context.
timestamp of '/etc/udev/rules.d' changed
Reading rules file: /usr/lib/udev/rules.d/10-dm.rules
Reading rules file: /usr/lib/udev/rules.d/11-dm-lvm.rules
Reading rules file: /usr/lib/udev/rules.d/13-dm-disk.rules
Reading rules file: /usr/lib/udev/rules.d/40-redhat.rules
Reading rules file: /usr/lib/udev/rules.d/42-usb-hid-pm.rules
Reading rules file: /usr/lib/udev/rules.d/50-rbd.rules
Reading rules file: /etc/udev/rules.d/50-sms.rules
Reading rules file: /usr/lib/udev/rules.d/50-udev-default.rules
Reading rules file: /usr/lib/udev/rules.d/60-alias-kmsg.rules
Reading rules file: /usr/lib/udev/rules.d/60-cdrom_id.rules
Reading rules file: /usr/lib/udev/rules.d/60-ceph-by-parttypeuuid.rules
Reading rules file: /usr/lib/udev/rules.d/60-drm.rules
Reading rules file: /usr/lib/udev/rules.d/60-keyboard.rules
Reading rules file: /usr/lib/udev/rules.d/60-net.rules
Reading rules file: /usr/lib/udev/rules.d/60-persistent-alsa.rules
Reading rules file: /usr/lib/udev/rules.d/60-persistent-input.rules
Reading rules file: /usr/lib/udev/rules.d/60-persistent-serial.rules
Reading rules file: /usr/lib/udev/rules.d/60-persistent-storage-tape.rules
Reading rules file: /usr/lib/udev/rules.d/60-persistent-storage.rules
Reading rules file: /usr/lib/udev/rules.d/60-persistent-v4l.rules
Reading rules file: /usr/lib/udev/rules.d/60-raw.rules
Reading rules file: /etc/udev/rules.d/60-sms.rules
Reading rules file: /usr/lib/udev/rules.d/61-accelerometer.rules
Reading rules file: /usr/lib/udev/rules.d/63-md-raid-arrays.rules
Reading rules file: /usr/lib/udev/rules.d/64-btrfs.rules
Reading rules file: /usr/lib/udev/rules.d/65-md-incremental.rules
Reading rules file: /usr/lib/udev/rules.d/69-dm-lvm-metad.rules
Reading rules file: /usr/lib/udev/rules.d/70-mouse.rules
Reading rules file: /etc/udev/rules.d/70-persistent-ipoib.rules
Reading rules file: /usr/lib/udev/rules.d/70-power-switch.rules
Reading rules file: /usr/lib/udev/rules.d/70-touchpad.rules
Reading rules file: /usr/lib/udev/rules.d/70-uaccess.rules
Reading rules file: /usr/lib/udev/rules.d/71-biosdevname.rules
Reading rules file: /usr/lib/udev/rules.d/71-seat.rules
Reading rules file: /usr/lib/udev/rules.d/73-idrac.rules
Reading rules file: /usr/lib/udev/rules.d/73-seat-late.rules
Reading rules file: /usr/lib/udev/rules.d/75-net-description.rules
Reading rules file: /usr/lib/udev/rules.d/75-probe_mtd.rules
Reading rules file: /usr/lib/udev/rules.d/75-tty-description.rules
Reading rules file: /usr/lib/udev/rules.d/78-sound-card.rules
Reading rules file: /usr/lib/udev/rules.d/80-drivers.rules
Reading rules file: /usr/lib/udev/rules.d/80-net-name-slot.rules
Reading rules file: /usr/lib/udev/rules.d/80-net-setup-link.rules
Reading rules file: /usr/lib/udev/rules.d/81-kvm-rhel.rules
Reading rules file: /usr/lib/udev/rules.d/84-nm-drivers.rules
Reading rules file: /usr/lib/udev/rules.d/85-nm-unmanaged.rules
Reading rules file: /usr/lib/udev/rules.d/90-alsa-tools-firmware.rules
Reading rules file: /usr/lib/udev/rules.d/90-iprutils.rules
Reading rules file: /usr/lib/udev/rules.d/90-vconsole.rules
Reading rules file: /usr/lib/udev/rules.d/91-drm-modeset.rules
Reading rules file: /usr/lib/udev/rules.d/95-ceph-osd.rules
Reading rules file: /usr/lib/udev/rules.d/95-dm-notify.rules
Reading rules file: /usr/lib/udev/rules.d/95-udev-late.rules
Reading rules file: /usr/lib/udev/rules.d/98-kexec.rules
Reading rules file: /usr/lib/udev/rules.d/98-rdma.rules
Reading rules file: /usr/lib/udev/rules.d/99-systemd.rules
rules contain 49152 bytes tokens (4096 * 12 bytes), 15467 bytes strings
2466 strings (32321 bytes), 1723 de-duplicated (17598 bytes), 744 trie nodes used
GROUP 6 /usr/lib/udev/rules.d/50-udev-default.rules:52
IMPORT '/sbin/blkid -o udev -p /dev/sdb1' /usr/lib/udev/rules.d/60-ceph-by-parttypeuuid.rules:26
starting '/sbin/blkid -o udev -p /dev/sdb1'
'/sbin/blkid -o udev -p /dev/sdb1'(out) 'ID_PART_ENTRY_SCHEME=gpt'
'/sbin/blkid -o udev -p /dev/sdb1'(out) 'ID_PART_ENTRY_NAME=X0Hu3Mr1'
'/sbin/blkid -o udev -p /dev/sdb1'(out) 'ID_PART_ENTRY_UUID=a04af164-70cb-42b9-924b-6038ccec87ac'
'/sbin/blkid -o udev -p /dev/sdb1'(out) 'ID_PART_ENTRY_TYPE=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7'
'/sbin/blkid -o udev -p /dev/sdb1'(out) 'ID_PART_ENTRY_NUMBER=1'
'/sbin/blkid -o udev -p /dev/sdb1'(out) 'ID_PART_ENTRY_OFFSET=32768'
'/sbin/blkid -o udev -p /dev/sdb1'(out) 'ID_PART_ENTRY_SIZE=4096000'
'/sbin/blkid -o udev -p /dev/sdb1'(out) 'ID_PART_ENTRY_DISK=8:16'
'/sbin/blkid -o udev -p /dev/sdb1' [3610] exit with return code 0
LINK 'disk/by-parttypeuuid/ebd0a0a2-b9e5-4433-87c0-68b6b72699c7.a04af164-70cb-42b9-924b-6038ccec87ac' /usr/lib/udev/rules.d/60-ceph-by-parttypeuuid.rules:29
LINK 'disk/by-path/pci-0000:00:10.0-scsi-0:0:1:0-part1' /usr/lib/udev/rules.d/60-persistent-storage.rules:68
IMPORT builtin 'blkid' /usr/lib/udev/rules.d/60-persistent-storage.rules:82
probe /dev/sdb1 raid offset=0
LINK 'disk/by-partuuid/a04af164-70cb-42b9-924b-6038ccec87ac' /usr/lib/udev/rules.d/60-persistent-storage.rules:96
LINK 'disk/by-partlabel/X0Hu3Mr1' /usr/lib/udev/rules.d/60-persistent-storage.rules:97
RUN '/tmp/tt %k' /etc/udev/rules.d/60-sms.rules:1
handling device node '/dev/sdb1', devnum=b8:17, mode=0660, uid=0, gid=6
preserve permissions /dev/sdb1, 060660, uid=0, gid=6
preserve already existing symlink '/dev/block/8:17' to '../sdb1'
found 'b8:17' claiming '/run/udev/links/\x2fdisk\x2fby-partlabel\x2fX0Hu3Mr1'
creating link '/dev/disk/by-partlabel/X0Hu3Mr1' to '/dev/sdb1'
preserve already existing symlink '/dev/disk/by-partlabel/X0Hu3Mr1' to '../../sdb1'
found 'b8:17' claiming '/run/udev/links/\x2fdisk\x2fby-parttypeuuid\x2febd0a0a2-b9e5-4433-87c0-68b6b72699c7.a04af164-70cb-42b9-924b-6038ccec87ac'
creating link '/dev/disk/by-parttypeuuid/ebd0a0a2-b9e5-4433-87c0-68b6b72699c7.a04af164-70cb-42b9-924b-6038ccec87ac' to '/dev/sdb1'
preserve already existing symlink '/dev/disk/by-parttypeuuid/ebd0a0a2-b9e5-4433-87c0-68b6b72699c7.a04af164-70cb-42b9-924b-6038ccec87ac' to '../../sdb1'
found 'b8:17' claiming '/run/udev/links/\x2fdisk\x2fby-partuuid\x2fa04af164-70cb-42b9-924b-6038ccec87ac'
creating link '/dev/disk/by-partuuid/a04af164-70cb-42b9-924b-6038ccec87ac' to '/dev/sdb1'
preserve already existing symlink '/dev/disk/by-partuuid/a04af164-70cb-42b9-924b-6038ccec87ac' to '../../sdb1'
found 'b8:17' claiming '/run/udev/links/\x2fdisk\x2fby-path\x2fpci-0000:00:10.0-scsi-0:0:1:0-part1'
creating link '/dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:1:0-part1' to '/dev/sdb1'
preserve already existing symlink '/dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:1:0-part1' to '../../sdb1'
created db file '/run/udev/data/b8:17' for '/devices/pci0000:00/0000:00:10.0/host0/target0:0:1/0:0:1:0/block/sdb/sdb1'
.ID_FS_TYPE_NEW=
ACTION=add
DEVLINKS=/dev/disk/by-partlabel/X0Hu3Mr1 /dev/disk/by-parttypeuuid/ebd0a0a2-b9e5-4433-87c0-68b6b72699c7.a04af164-70cb-42b9-924b-6038ccec87ac /dev/disk/by-partuuid/a04af164-70cb-42b9-924b-6038ccec87ac /dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:1:0-part1
DEVNAME=/dev/sdb1
DEVPATH=/devices/pci0000:00/0000:00:10.0/host0/target0:0:1/0:0:1:0/block/sdb/sdb1
DEVTYPE=partition
ID_BUS=scsi
ID_FS_TYPE=
ID_MODEL=VMware_Virtual_S
ID_MODEL_ENC=VMware\x20Virtual\x20S
ID_PART_ENTRY_DISK=8:16
ID_PART_ENTRY_NAME=X0Hu3Mr1
ID_PART_ENTRY_NUMBER=1
ID_PART_ENTRY_OFFSET=32768
ID_PART_ENTRY_SCHEME=gpt
ID_PART_ENTRY_SIZE=4096000
ID_PART_ENTRY_TYPE=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
ID_PART_ENTRY_UUID=a04af164-70cb-42b9-924b-6038ccec87ac
ID_PART_TABLE_TYPE=gpt
ID_PATH=pci-0000:00:10.0-scsi-0:0:1:0
ID_PATH_TAG=pci-0000_00_10_0-scsi-0_0_1_0
ID_REVISION=1.0
ID_SCSI=1
ID_TYPE=disk
ID_VENDOR=VMware_
ID_VENDOR_ENC=VMware\x2c\x20
MAJOR=8
MINOR=17
SUBSYSTEM=block
TAGS=:systemd:
USEC_INITIALIZED=244571
run: '/tmp/tt sdb1'
Unload module index
Unloaded link configuration context.