@@ -27,13 +27,20 @@ var ( // Declare exported dummy vars.
27
27
Net2 capcv1.Network
28
28
ISONet1 capcv1.Network
29
29
CSISONet1 * capcv1.CloudStackIsolatedNetwork
30
- Domain string
30
+ Domain cloud.Domain
31
+ DomainPath string
32
+ DomainName string
31
33
DomainID string
32
- RootDomain string
33
- RootDomainID string
34
- Level2Domain string
34
+ Level2Domain cloud. Domain
35
+ Level2DomainPath string
36
+ Level2DomainName string
35
37
Level2DomainID string
36
- Account string
38
+ Account cloud.Account
39
+ AccountName string
40
+ AccountID string
41
+ Level2Account cloud.Account
42
+ Level2AccountName string
43
+ Level2AccountID string
37
44
Tags map [string ]string
38
45
Tag1 map [string ]string
39
46
Tag2 map [string ]string
@@ -55,10 +62,6 @@ var ( // Declare exported dummy vars.
55
62
PublicIPID string
56
63
EndPointHost string
57
64
EndPointPort int32
58
- ListDomainsParams * csapi.ListDomainsParams
59
- ListDomainsResp * csapi.ListDomainsResponse
60
- ListAccountsParams * csapi.ListAccountsParams
61
- ListAccountsResp * csapi.ListAccountsResponse
62
65
DiskOffering1 = capcv1.CloudStackResourceDiskOffering {
63
66
CloudStackResourceIdentifier : capcv1.CloudStackResourceIdentifier {
64
67
Name : "Small" ,
@@ -224,13 +227,16 @@ func SetDummyZoneVars() {
224
227
// SetDummyCAPCClusterVars resets the values in each of the exported CloudStackCluster related dummy variables.
225
228
// It is intended to be called in BeforeEach() functions.
226
229
func SetDummyCAPCClusterVars () {
227
- Domain = "FakeDomainName"
230
+ DomainName = "FakeDomainName"
228
231
DomainID = "FakeDomainID"
229
- Level2Domain = "foo/FakeDomainName"
232
+ Domain = cloud.Domain {Name : DomainName , ID : DomainID }
233
+ Level2DomainName = "foo/FakeDomainName"
230
234
Level2DomainID = "FakeLevel2DomainID"
231
- RootDomain = "ROOT"
232
- RootDomainID = "FakeRootDomainID"
233
- Account = "FakeAccountName"
235
+ Level2Domain = cloud.Domain {Name : Level2DomainName , ID : Level2DomainID }
236
+ AccountName = "FakeAccountName"
237
+ Account = cloud.Account {Name : AccountName , Domain : Domain }
238
+ AccountName = "FakeLevel2AccountName"
239
+ Level2Account = cloud.Account {Name : Level2AccountName , Domain : Level2Domain }
234
240
CSApiVersion = "infrastructure.cluster.x-k8s.io/v1beta1"
235
241
CSClusterKind = "CloudStackCluster"
236
242
CSClusterName = "test-cluster"
@@ -275,10 +281,16 @@ func SetDummyCAPCClusterVars() {
275
281
CSISONet1 .Spec .ID = ISONet1 .ID
276
282
}
277
283
278
- // SetDummyDomainAndAccount sets domain and account in the CSCluster Spec. This is not the default.
284
+ // SetClusterDummyDomainAndAccount sets domain and account in the CSCluster Spec. This is not the default.
285
+ func SetClusterDummyDomainAndAccount () {
286
+ CSCluster .Spec .Account = AccountName
287
+ CSCluster .Spec .Domain = DomainPath
288
+ }
289
+
290
+ // SetClusterDummyDomainAndAccount sets domain and account in the CSCluster Spec. This is not the default.
279
291
func SetDummyDomainAndAccount () {
280
- CSCluster .Spec .Account = Account
281
- CSCluster .Spec .Domain = Domain
292
+ CSCluster .Spec .Account = AccountName
293
+ CSCluster .Spec .Domain = DomainPath
282
294
}
283
295
284
296
// SetDummyDomainAndAccount sets domainID in the CSCluster Status. This is not the default.
@@ -330,15 +342,3 @@ func SetDummyCAPIMachineVars() {
330
342
func SetDummyCSMachineStatuses () {
331
343
CSMachine1 .Status = capcv1.CloudStackMachineStatus {ZoneID : Zone1 .ID }
332
344
}
333
-
334
- func SetDummyCSApiResponse () {
335
- ListDomainsParams = & csapi.ListDomainsParams {}
336
- ListDomainsResp = & csapi.ListDomainsResponse {}
337
- ListDomainsResp .Count = 1
338
- ListDomainsResp .Domains = []* csapi.Domain {{Id : DomainID , Path : "ROOT/" + Domain }, {Id : RootDomainID , Path : "ROOT" }, {Id : Level2DomainID , Path : "ROOT/" + Level2Domain }}
339
-
340
- ListAccountsParams = & csapi.ListAccountsParams {}
341
- ListAccountsResp = & csapi.ListAccountsResponse {}
342
- ListAccountsResp .Count = 1
343
- ListAccountsResp .Accounts = []* csapi.Account {{Name : Account }}
344
- }
0 commit comments