Skip to content

Commit

Permalink
Fix disabled org creations in 10.4.2 tests (vmware#572)
Browse files Browse the repository at this point in the history
* Fix disabled org creations in 10.4.2 tests
   Due to a VCD bug in 10.4.2, creating a disabled Org is not possible.
   As a workaround, we change the enabled status of the Org being created
   for this specific VCD version
* Increase timeout for functional test

Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
  • Loading branch information
dataclouder committed May 3, 2023
1 parent 74f9539 commit b6afa00
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .changes/v2.21.0/572-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Changed Org enablement status during tests for VCD 10.4.2, to circumvent a VCD bug that prevents creation of disabled Orgs [GH-572]

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ default: fmtcheck vet static security build
# test runs the test suite and vets the code
test: testunit tagverify
@echo "==> Running Functional Tests"
cd govcd && go test -tags "functional" -timeout=650m -check.vv
cd govcd && go test -tags "functional" -timeout=720m -check.vv

# tagverify checks that each tag can run independently
tagverify: fmtcheck
Expand Down
6 changes: 5 additions & 1 deletion govcd/org_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ func (vcd *TestVCD) Test_UpdateOrg(check *C) {
}

for _, uo := range updateOrgs {

if vcd.client.Client.APIVCDMaxVersionIs("= 37.2") && !uo.enabled {
// TODO revisit once bug is fixed in VCD
fmt.Println("[INFO] VCD 10.4.2 has a bug that prevents creating a disabled Org - Changing 'enabled' parameter to 'true'")
uo.enabled = true
}
fmt.Printf("Org %s - enabled %v - catalogs %v\n", uo.orgName, uo.enabled, uo.canPublishCatalogs)
task, err := CreateOrg(vcd.client, uo.orgName, uo.orgName, uo.orgName, &types.OrgSettings{
OrgGeneralSettings: &types.OrgGeneralSettings{
Expand Down
5 changes: 5 additions & 0 deletions govcd/system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ func (vcd *TestVCD) Test_CreateOrg(check *C) {
}
orgName := TestCreateOrg + "_" + od.name

if vcd.client.Client.APIVCDMaxVersionIs("= 37.2") && !od.enabled {
// TODO revisit once bug is fixed in VCD
fmt.Println("[INFO] VCD 10.4.2 has a bug that prevents creating a disabled Org - Changing 'enabled' parameter to 'true'")
od.enabled = true
}
fmt.Printf("# org %s (enabled: %v - catalogs: %v [%d %d])\n", orgName, od.enabled, od.canPublishCatalogs, od.storedVmQuota, od.deployedVmQuota)
settings.OrgGeneralSettings.CanPublishCatalogs = od.canPublishCatalogs
settings.OrgGeneralSettings.DeployedVMQuota = od.deployedVmQuota
Expand Down

0 comments on commit b6afa00

Please sign in to comment.