test: fix the integration test for no META name

When META has never been written (e.g. booted from a disk image), it
won't be detected as `talosmeta`.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
This commit is contained in:
Andrey Smirnov 2024-06-11 15:17:52 +04:00
parent 5350063340
commit d1a0c1f983
No known key found for this signature in database
GPG Key ID: FE042E3D4085A811

View File

@ -62,16 +62,16 @@ func (suite *VolumesSuite) testDiscoveredVolumes(node string) {
suite.Require().NoError(err) suite.Require().NoError(err)
expectedVolumes := map[string]struct { expectedVolumes := map[string]struct {
Name string Names []string
}{ }{
"META": { "META": {
Name: "talosmeta", Names: []string{"talosmeta", ""}, // if META was never written, it will not be detected
}, },
"STATE": { "STATE": {
Name: "xfs", Names: []string{"xfs"},
}, },
"EPHEMERAL": { "EPHEMERAL": {
Name: "xfs", Names: []string{"xfs"},
}, },
} }
@ -102,7 +102,7 @@ func (suite *VolumesSuite) testDiscoveredVolumes(node string) {
} }
} }
suite.Assert().Equal(expected.Name, dv.TypedSpec().Name, "node: ", node) suite.Assert().Contains(expected.Names, dv.TypedSpec().Name, "node: %s", node)
delete(expectedVolumes, id) delete(expectedVolumes, id)
} }