Skip to content

Commit a51eaa9

Browse files
committed
folder unit test changes
- remove duplicate test - since capv infrastructure can and will create custom folders the check that makes sure the folder pre-exists is no longer valid. Changed the test to pass if there is no expected error.
1 parent 9cdc03a commit a51eaa9

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

pkg/asset/installconfig/vsphere/validation_test.go

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -361,27 +361,15 @@ func TestValidateFailureDomains(t *testing.T) {
361361
checkTags: false,
362362
expectErr: `^platform.vsphere.failureDomains.topology: Invalid value: "invalid-network": unable to find network provided$`,
363363
}, {
364-
name: "multi-zone validation - invalid folder",
364+
name: "multi-zone validation - create missing folder",
365365
failureDomain: func() *vsphere.FailureDomain {
366366
failureDomain := &validMultiVCenterPlatform().FailureDomains[0]
367-
failureDomain.Topology.Folder = "/DC0/vm/invalid-folder"
367+
failureDomain.Topology.Folder = "/DC0/vm/create-missing-folder"
368368
return failureDomain
369369
}(),
370370
validationMethod: validateFailureDomain,
371371
checkTags: false,
372-
expectErr: `^platform.vsphere.failureDomains.topology.folder: Invalid value: "/DC0/vm/invalid-folder": folder '/DC0/vm/invalid-folder' not found$`,
373-
},
374-
375-
{
376-
name: "multi-zone validation - invalid folder",
377-
failureDomain: func() *vsphere.FailureDomain {
378-
failureDomain := &validMultiVCenterPlatform().FailureDomains[0]
379-
failureDomain.Topology.Folder = "/DC0/vm/invalid-folder"
380-
return failureDomain
381-
}(),
382-
validationMethod: validateFailureDomain,
383-
checkTags: false,
384-
expectErr: `^platform.vsphere.failureDomains.topology.folder: Invalid value: "/DC0/vm/invalid-folder": folder '/DC0/vm/invalid-folder' not found$`,
372+
expectErr: ``,
385373
}, {
386374
name: "multi-zone tag categories present and tags attached",
387375
validationMethod: validateFailureDomain,

0 commit comments

Comments
 (0)