From 30860210cce628839e97b8ece7edf90300556ed7 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Mon, 3 Jun 2024 17:20:42 +0400 Subject: [PATCH] test: fix hardware test not to require PCI devices On e.g. Azure VMs there are non reported. Signed-off-by: Andrey Smirnov --- internal/integration/api/hardware.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/internal/integration/api/hardware.go b/internal/integration/api/hardware.go index 1596f3b01e..5366e56a1e 100644 --- a/internal/integration/api/hardware.go +++ b/internal/integration/api/hardware.go @@ -63,11 +63,17 @@ func (suite *HardwareSuite) TestSystemInformation() { func (suite *HardwareSuite) TestHardwareInfo() { node := suite.RandomDiscoveredNodeInternalIP() - for _, resourceType := range []resource.Type{ + resourceList := []resource.Type{ hardware.MemoryModuleType, hardware.ProcessorType, - hardware.PCIDeviceType, - } { + } + + if suite.Cluster != nil { + // cloud VMs might not publish PCI devices + resourceList = append(resourceList, hardware.PCIDeviceType) + } + + for _, resourceType := range resourceList { items, err := suite.Client.COSI.List(client.WithNode(suite.ctx, node), resource.NewMetadata(hardware.NamespaceName, resourceType, "", resource.VersionUndefined)) suite.Require().NoError(err)