storage tests: accept nvme devices (CI runners moved off sda)

This commit is contained in:
Paulo Truta
2026-11-26 13:39:29 +01:00
parent b1cbb90fc2
commit 3717c6e90b
+4 -3
View File
@@ -3,6 +3,7 @@
package storage package storage
import ( import (
"strings"
"testing" "testing"
) )
@@ -26,10 +27,10 @@ func assertGetDevices(devices []Device, t *testing.T) {
foundDevice := false foundDevice := false
t.Log("Looking for a mmcblk0, sda or dva device") t.Log("Looking for a mmcblk0, sda, vda or nvme device")
for _, device := range devices { for _, device := range devices {
if device.ID == "mmcblk0" || device.ID == "sda" || device.ID == "vda" { if device.ID == "mmcblk0" || device.ID == "sda" || device.ID == "vda" || strings.HasPrefix(device.ID, "nvme") {
t.Log("Found target device", device.ID) t.Log("Found target device", device.ID)
foundDevice = true foundDevice = true
} }
@@ -37,7 +38,7 @@ func assertGetDevices(devices []Device, t *testing.T) {
} }
if !foundDevice { if !foundDevice {
t.Log("Expected to find device mmcblk0, sda or dva but did not. Devices:", devices) t.Log("Expected to find device mmcblk0, sda, vda or nvme but did not. Devices:", devices)
t.Fail() t.Fail()
} }
} }