8000 tests/platforms: add test for Azure NVMe udev rules by marmijo · Pull Request #3519 · coreos/fedora-coreos-config · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

tests/platforms: add test for Azure NVMe udev rules #3519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/kola/platforms/azure/nvme/data/commonlib.sh
44 changes: 44 additions & 0 deletions tests/kola/platforms/azure/nvme/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash
## kola:
## # This test requires changing instance types and must
## # be run exclusively.
## exclusive: true
## # This test is targeted at Azure
## platforms: azure
## # attach an NVMe data disk to the instance
## additionalDisks: ["30G:sku=UltraSSD_LRS"]
## # This test requires an instance type that supports NVMe
## instanceType: "Standard_M16bds_v3"
## description: Verify that udev rules for Azure Managed NVMe disks
## correctly create stable symlinks under /dev/disk/azure.

set -xeuo pipefail

. "$KOLA_EXT_DATA/commonlib.sh"

# Wait up to 30 seconds for a symlink to be created.
wait_for_symlink() {
local path="$1"
local timeout=30
while [ ! -L "$path" ] && [ "$timeout" -gt 0 ]; do
sleep 1
timeout=$((timeout - 1))
done
if [ ! -L "$path" ]; then
fatal "Timed out waiting for symlink $path to appear"
fi
}

# Verify OS disk symlink
azure_os_symlink="/dev/disk/azure/os"
wait_for_symlink "$azure_os_symlink"
if [ ! -e "$azure_os_symlink" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance of these checks running early enough and racing with the thing that creates the symlinks (i.e. udev)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's definitely a chance of a race. I'll update the test to wait for the symlink to exist before proceeding with the checks.

fatal "symlink $azure_os_symlink exists but points to a missing target"
fi

# Verify data disk symlink
azure_data_symlink="/dev/disk/azure/data/by-lun/0"
wait_for_symlink "$azure_data_symlink"
if [ ! -e "$azure_data_symlink" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of -e (existence) should we be checking to make sure it is actually a symlink (-h or -L)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! I think it makes sense to explicitly check that the path is a symlink (not just that it exists), and also verify that it points to a valid path. I realize I have those two mixed up here. I'll update the test to do both so we have full confidence the udev rules are working as expected.

fatal "symlink $azure_data_symlink exists but points to a missing target"
fi
0