205 lines
11 KiB
Diff
205 lines
11 KiB
Diff
|
From 94ad224240140a7287f9e2be5905b9c506350193 Mon Sep 17 00:00:00 2001
|
||
|
From: Michal Sekletar <msekleta@redhat.com>
|
||
|
Date: Mon, 17 May 2021 15:54:10 +0200
|
||
|
Subject: [PATCH] test/udev-test.pl: drop test cases that add mutliple devices
|
||
|
|
||
|
[msekleta: It is easier to delete test-cases that would make
|
||
|
udev test fail. Once we reintroduce the fix for link_update()
|
||
|
we will revert this commit.]
|
||
|
|
||
|
Related: #1942299
|
||
|
---
|
||
|
test/udev-test.pl | 179 ----------------------------------------------
|
||
|
1 file changed, 179 deletions(-)
|
||
|
|
||
|
diff --git a/test/udev-test.pl b/test/udev-test.pl
|
||
|
index 0612859cda..343d9c01ae 100755
|
||
|
--- a/test/udev-test.pl
|
||
|
+++ b/test/udev-test.pl
|
||
|
@@ -2041,185 +2041,6 @@ TAGS=="foo", SYMLINK+="found"
|
||
|
TAGS=="aaa", SYMLINK+="bad"
|
||
|
EOF
|
||
|
},
|
||
|
- {
|
||
|
- desc => "multiple devices",
|
||
|
- devices => [
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
|
||
|
- exp_links => ["part-1"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
|
||
|
- exp_links => ["part-5"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda6",
|
||
|
- exp_links => ["part-6"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda7",
|
||
|
- exp_links => ["part-7"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda8",
|
||
|
- exp_links => ["part-8"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda9",
|
||
|
- exp_links => ["part-9"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda10",
|
||
|
- exp_links => ["part-10"],
|
||
|
- },
|
||
|
- ],
|
||
|
- rules => <<EOF
|
||
|
-SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNEL=="sda?*", ENV{DEVTYPE}=="partition", SYMLINK+="part-%n"
|
||
|
-EOF
|
||
|
- },
|
||
|
- {
|
||
|
- desc => "multiple devices, same link name, positive prio",
|
||
|
- repeat => 100,
|
||
|
- devices => [
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
|
||
|
- exp_links => ["part-1"],
|
||
|
- not_exp_links => ["partition"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
|
||
|
- exp_links => ["part-5"],
|
||
|
- not_exp_links => ["partition"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda6",
|
||
|
- not_exp_links => ["partition"],
|
||
|
- exp_links => ["part-6"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda7",
|
||
|
- exp_links => ["part-7", "partition"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda8",
|
||
|
- not_exp_links => ["partition"],
|
||
|
- exp_links => ["part-8"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda9",
|
||
|
- not_exp_links => ["partition"],
|
||
|
- exp_links => ["part-9"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda10",
|
||
|
- not_exp_links => ["partition"],
|
||
|
- exp_links => ["part-10"],
|
||
|
- },
|
||
|
- ],
|
||
|
- rules => <<EOF
|
||
|
-SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNEL=="sda?*", ENV{DEVTYPE}=="partition", SYMLINK+="part-%n"
|
||
|
-SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNEL=="sda?*", ENV{DEVTYPE}=="partition", SYMLINK+="partition"
|
||
|
-KERNEL=="*7", OPTIONS+="link_priority=10"
|
||
|
-EOF
|
||
|
- },
|
||
|
- {
|
||
|
- desc => "multiple devices, same link name, negative prio",
|
||
|
- devices => [
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
|
||
|
- exp_links => ["part-1"],
|
||
|
- not_exp_links => ["partition"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
|
||
|
- exp_links => ["part-5"],
|
||
|
- not_exp_links => ["partition"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda6",
|
||
|
- not_exp_links => ["partition"],
|
||
|
- exp_links => ["part-6"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda7",
|
||
|
- exp_links => ["part-7", "partition"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda8",
|
||
|
- not_exp_links => ["partition"],
|
||
|
- exp_links => ["part-8"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda9",
|
||
|
- not_exp_links => ["partition"],
|
||
|
- exp_links => ["part-9"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda10",
|
||
|
- not_exp_links => ["partition"],
|
||
|
- exp_links => ["part-10"],
|
||
|
- },
|
||
|
- ],
|
||
|
- rules => <<EOF
|
||
|
-SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNEL=="sda?*", ENV{DEVTYPE}=="partition", SYMLINK+="part-%n"
|
||
|
-SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNEL=="sda?*", ENV{DEVTYPE}=="partition", SYMLINK+="partition"
|
||
|
-KERNEL!="*7", OPTIONS+="link_priority=-10"
|
||
|
-EOF
|
||
|
- },
|
||
|
- {
|
||
|
- desc => "multiple devices, same link name, positive prio, sleep",
|
||
|
- devices => [
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
|
||
|
- exp_links => ["part-1"],
|
||
|
- not_exp_links => ["partition"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5",
|
||
|
- exp_links => ["part-5"],
|
||
|
- not_exp_links => ["partition"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda6",
|
||
|
- not_exp_links => ["partition"],
|
||
|
- exp_links => ["part-6"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda7",
|
||
|
- exp_links => ["part-7", "partition"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda8",
|
||
|
- not_exp_links => ["partition"],
|
||
|
- exp_links => ["part-8"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda9",
|
||
|
- not_exp_links => ["partition"],
|
||
|
- exp_links => ["part-9"],
|
||
|
- },
|
||
|
- {
|
||
|
- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda10",
|
||
|
- not_exp_links => ["partition"],
|
||
|
- exp_links => ["part-10"],
|
||
|
- },
|
||
|
- ],
|
||
|
- sleep_us => 10000,
|
||
|
- rules => <<EOF
|
||
|
-SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNEL=="sda?*", ENV{DEVTYPE}=="partition", SYMLINK+="part-%n"
|
||
|
-SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNEL=="sda?*", ENV{DEVTYPE}=="partition", SYMLINK+="partition"
|
||
|
-KERNEL=="*7", OPTIONS+="link_priority=10"
|
||
|
-EOF
|
||
|
- },
|
||
|
- {
|
||
|
- desc => 'all_block_devs',
|
||
|
- generator => expect_for_some("\\/sda6\$", ["blockdev"]),
|
||
|
- repeat => 10,
|
||
|
- rules => <<EOF
|
||
|
-SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNEL=="sd*", SYMLINK+="blockdev"
|
||
|
-KERNEL=="sda6", OPTIONS+="link_priority=10"
|
||
|
-EOF
|
||
|
- }
|
||
|
);
|
||
|
|
||
|
sub create_rules {
|