mirror of
https://github.com/edgebox-iot/edgeboxctl.git
synced 2026-11-26 14:48:31 +01:00
storage tests: accept nvme devices (CI runners moved off sda)
This commit is contained in:
@@ -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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user