Skip to content

Commit 8c4fa8c

Browse files
authored
Merge pull request #74 from aws/fix/failed-e2e-tests
Fix failed e2e tests
2 parents b380e7e + 6dbe5e2 commit 8c4fa8c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

pkg/cloud/cluster.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,12 @@ func (c *client) ResolveDomainAndAccount(csCluster *infrav1.CloudStackCluster) e
129129
listAccountResp, retErr := c.cs.Account.ListAccounts(listAccountParams)
130130
if retErr != nil {
131131
return retErr
132-
} else if listAccountResp.Count != 1 {
132+
} else if listAccountResp.Count == 0 {
133+
return errors.Errorf("could not find account %s in domain ID %s",
134+
csCluster.Spec.Account, csCluster.Status.DomainID)
135+
} else if listAccountResp.Count > 1 {
133136
return errors.Errorf("expected 1 Account with account name %s in domain ID %s, but got %d",
134-
csCluster.Spec.Account, csCluster.Status.DomainID, resp.Count)
137+
csCluster.Spec.Account, csCluster.Status.DomainID, listAccountResp.Count)
135138
}
136139
}
137140
return nil

test/e2e/invalid_resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func InvalidResourceSpec(ctx context.Context, inputGetter func() CommonSpecInput
6666
})
6767

6868
It("Should fail due to the specified domain is not found [TC4b]", func() {
69-
testInvalidResource(ctx, input, "invalid-domain", "No match found for "+input.E2EConfig.GetVariable(InvalidDomainName))
69+
testInvalidResource(ctx, input, "invalid-domain", "domain not found for domain path "+input.E2EConfig.GetVariable(InvalidDomainName))
7070
})
7171

7272
It("Should fail due to the specified control plane offering is not found [TC7]", func() {

0 commit comments

Comments
 (0)