-
Notifications
You must be signed in to change notification settings - Fork 166
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../data/commonlib.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 | ||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
There was a problem hiding this comment.
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)?
There was a problem hiding this comment.
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.