Skip to content

Commit

Permalink
Fix the installconfig_test for OpenStack
Browse files Browse the repository at this point in the history
  • Loading branch information
tomassedovic committed Jul 29, 2019
1 parent 4278e44 commit 280f9d1
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions pkg/types/validation/installconfig_test.go
Expand Up @@ -86,6 +86,18 @@ func validVSpherePlatform() *vsphere.Platform {
}
}

func validOpenStackPlatform() *openstack.Platform {
return &openstack.Platform{
Region: "test-region",
Cloud: "test-cloud",
ExternalNetwork: "test-network",
FlavorName: "test-flavor",
APIVIP: "10.0.128.5",
DNSVIP: "10.0.128.6",
IngressVIP: "10.0.128.7",
}
}

func TestValidateInstallConfig(t *testing.T) {
cases := []struct {
name string
Expand Down Expand Up @@ -421,12 +433,7 @@ func TestValidateInstallConfig(t *testing.T) {
installConfig: func() *types.InstallConfig {
c := validInstallConfig()
c.Platform = types.Platform{
OpenStack: &openstack.Platform{
Region: "test-region",
Cloud: "test-cloud",
ExternalNetwork: "test-network",
FlavorName: "test-flavor",
},
OpenStack: validOpenStackPlatform(),
}
return c
}(),
Expand All @@ -436,8 +443,9 @@ func TestValidateInstallConfig(t *testing.T) {
installConfig: func() *types.InstallConfig {
c := validInstallConfig()
c.Platform = types.Platform{
OpenStack: &openstack.Platform{},
OpenStack: validOpenStackPlatform(),
}
c.Platform.OpenStack.Cloud = ""
return c
}(),
expectedError: `^platform\.openstack\.cloud: Unsupported value: "": supported values: "test-cloud"$`,
Expand Down

0 comments on commit 280f9d1

Please sign in to comment.