diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:40 +0000 |
commit | fc53809803cd2bc2434e312b19a18fa36776da12 (patch) | |
tree | b4b43bd6538f51965ce32856e9c053d0f90919c8 /test/TEST-64-UDEV-STORAGE/long_sysfs_path.configure | |
parent | Adding upstream version 255.5. (diff) | |
download | systemd-fc53809803cd2bc2434e312b19a18fa36776da12.tar.xz systemd-fc53809803cd2bc2434e312b19a18fa36776da12.zip |
Adding upstream version 256.upstream/256
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/TEST-64-UDEV-STORAGE/long_sysfs_path.configure')
-rwxr-xr-x | test/TEST-64-UDEV-STORAGE/long_sysfs_path.configure | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/TEST-64-UDEV-STORAGE/long_sysfs_path.configure b/test/TEST-64-UDEV-STORAGE/long_sysfs_path.configure new file mode 100755 index 0000000..6108bdb --- /dev/null +++ b/test/TEST-64-UDEV-STORAGE/long_sysfs_path.configure @@ -0,0 +1,32 @@ +#!/usr/bin/python3 +# SPDX-License-Identifier: LGPL-2.1-or-later + +import json +import sys + + +config = json.load(sys.stdin) + +config["QemuDrives"] += [ + { + "Id": "drive0", + "Size": "64M", + "Options": "cache=unsafe", + } +] +config["QemuArgs"] += ["-device", "pci-bridge,id=pci_bridge0,chassis_nr=64"] + +# Create 25 additional PCI bridges, each one connected to the previous one +# (basically a really long extension cable), and attach a virtio drive to +# the last one. This should force udev into attempting to create a device +# unit with a _really_ long name. +for bridge in range(1, 26): + config["QemuArgs"] += [ + "-device", + f"pci-bridge,id=pci_bridge{bridge},bus=pci_bridge{bridge - 1}," + f"chassis_nr={64 + bridge}" + ] + +config["QemuArgs"] += ["-device", f"virtio-blk-pci,drive=drive0,scsi=off,bus=pci_bridge25"] + +json.dump(config, sys.stdout) |