Skip to content

Commit

Permalink
skip vsan esa acceptance test due to version imcompatible
Browse files Browse the repository at this point in the history
  • Loading branch information
zxinyu08 committed Oct 11, 2023
1 parent 37cbcba commit f6adc75
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions vsphere/resource_vsphere_compute_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ func TestAccResourceVSphereComputeCluster_vsanEsaEnabled(t *testing.T) {
RunSweepers()
testAccPreCheck(t)
testAccResourceVSphereComputeClusterPreCheck(t)
testAccResourceVSphereComputeClusterVSANEsaPreCheck(t)
},
Providers: testAccProviders,
CheckDestroy: testAccResourceVSphereComputeClusterCheckExists(false),
Expand Down Expand Up @@ -585,6 +586,20 @@ func testAccResourceVSphereComputeClusterPreCheck(t *testing.T) {
}
}

func testAccResourceVSphereComputeClusterVSANEsaPreCheck(t *testing.T) {
meta, err := testAccProviderMeta(t)
if err != nil {
t.Skip("can not get meta")
}
client, err := resourceVSphereComputeClusterClient(meta)
if err != nil {
t.Skip("can not get client")
}
if version := viapi.ParseVersionFromClient(client); !version.AtLeast(viapi.VSphereVersion{Product: version.Product, Major: 8, Minor: 0}) {
t.Skip("vSAN ESA acceptance test should be run on vSphere 8.0 or higher")
}
}

func testAccResourceVSphereComputeClusterCheckExists(expected bool) resource.TestCheckFunc {
return func(s *terraform.State) error {
_, err := testGetComputeCluster(s, "compute_cluster", resourceVSphereComputeClusterName)
Expand Down

0 comments on commit f6adc75

Please sign in to comment.