Skip to content

Commit

Permalink
Update functional tests with the new storage interface
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Pantano <[email protected]>
  • Loading branch information
fmount committed Jun 11, 2024
1 parent 3537fdc commit a770223
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 18 deletions.
50 changes: 32 additions & 18 deletions test/functional/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ func CreateDefaultGlance(name types.NamespacedName) client.Object {
"keystoneEndpoint": "default",
"databaseInstance": "openstack",
"databaseAccount": glanceTest.GlanceDatabaseAccount.Name,
"storageRequest": glanceTest.GlancePVCSize,
"glanceAPIs": GetAPIList(),
"storage": map[string]interface{}{
"storageRequest": glanceTest.GlancePVCSize,
},
"glanceAPIs": GetAPIList(),
},
}
return th.CreateUnstructured(raw)
Expand All @@ -84,8 +86,10 @@ func GetGlanceEmptySpec() map[string]interface{} {
"keystoneEndpoint": "default",
"secret": SecretName,
"databaseInstance": "openstack",
"storageRequest": glanceTest.GlancePVCSize,
"glanceAPIs": map[string]interface{}{},
"storage": map[string]interface{}{
"storageRequest": glanceTest.GlancePVCSize,
},
"glanceAPIs": map[string]interface{}{},
}
}

Expand All @@ -97,7 +101,9 @@ func GetGlanceDefaultSpec() map[string]interface{} {
"serviceUser": glanceName.Name,
"secret": SecretName,
"glanceAPIs": GetAPIList(),
"storageRequest": glanceTest.GlancePVCSize,
"storage": map[string]interface{}{
"storageRequest": glanceTest.GlancePVCSize,
},
}
}

Expand All @@ -109,9 +115,11 @@ func GetGlanceDefaultSpecWithQuota() map[string]interface{} {
"serviceUser": glanceName.Name,
"secret": SecretName,
"glanceAPIs": GetAPIList(),
"storageRequest": glanceTest.GlancePVCSize,
"quotas": glanceTest.GlanceQuotas,
"memcached": glanceTest.MemcachedInstance,
"storage": map[string]interface{}{
"storageRequest": glanceTest.GlancePVCSize,
},
"quotas": glanceTest.GlanceQuotas,
"memcached": glanceTest.MemcachedInstance,
}
}

Expand All @@ -125,8 +133,10 @@ func GetAPIList() map[string]interface{} {

func GetGlanceAPIDefaultSpec() map[string]interface{} {
return map[string]interface{}{
"replicas": 1,
"storageRequest": glanceTest.GlancePVCSize,
"replicas": 1,
"storage": map[string]interface{}{
"storageRequest": glanceTest.GlancePVCSize,
},
"databaseAccount": glanceTest.GlanceDatabaseAccount.Name,
}
}
Expand Down Expand Up @@ -183,10 +193,12 @@ func GetDefaultGlanceSpec() map[string]interface{} {
// CreateGlanceAPISpec -
func CreateGlanceAPISpec(apiType APIType) map[string]interface{} {
spec := map[string]interface{}{
"replicas": 1,
"serviceAccount": glanceTest.GlanceSA.Name,
"containerImage": glanceTest.ContainerImage,
"storageRequest": glanceTest.GlancePVCSize,
"replicas": 1,
"serviceAccount": glanceTest.GlanceSA.Name,
"containerImage": glanceTest.ContainerImage,
"storage": map[string]interface{}{
"storageRequest": glanceTest.GlancePVCSize,
},
"apiType": apiType,
"name": "default",
"databaseHostname": "openstack",
Expand All @@ -199,10 +211,12 @@ func CreateGlanceAPISpec(apiType APIType) map[string]interface{} {
// GetDefaultGlanceAPISpec -
func GetDefaultGlanceAPISpec(apiType APIType) map[string]interface{} {
spec := map[string]interface{}{
"replicas": 1,
"containerImage": glanceTest.ContainerImage,
"serviceAccount": glanceTest.GlanceSA.Name,
"storageRequest": glanceTest.GlancePVCSize,
"replicas": 1,
"containerImage": glanceTest.ContainerImage,
"serviceAccount": glanceTest.GlanceSA.Name,
"storage": map[string]interface{}{
"storageRequest": glanceTest.GlancePVCSize,
},
"type": apiType,
"name": "default",
"databaseHostname": "openstack",
Expand Down
3 changes: 3 additions & 0 deletions test/functional/glance_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ var _ = Describe("Glance controller", func() {
},
}
rawSpec := map[string]interface{}{
"storage": map[string]interface{}{
"storageRequest": glanceTest.GlancePVCSize,
},
"storageRequest": glanceTest.GlancePVCSize,
"secret": SecretName,
"databaseInstance": "openstack",
Expand Down

0 comments on commit a770223

Please sign in to comment.