Skip to content

Commit

Permalink
Resume vmwareengine terraform tests (#12699)
Browse files Browse the repository at this point in the history
  • Loading branch information
swamitagupta authored Jan 15, 2025
1 parent 2e132b7 commit 7b15af4
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 225 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package vmwareengine_test

import (
"fmt"
"os"
"strings"
"testing"

Expand All @@ -15,15 +16,15 @@ import (
)

func TestAccVmwareengineCluster_vmwareEngineClusterUpdate(t *testing.T) {
t.Skip("https://github.com/hashicorp/terraform-provider-google/issues/20719")
acctest.SkipIfVcr(t)
t.Parallel()

context := map[string]interface{}{
"region": "me-west1", // region with allocated quota
"random_suffix": acctest.RandString(t, 10),
"org_id": envvar.GetTestOrgFromEnv(t),
"billing_account": envvar.GetTestBillingAccountFromEnv(t),
"region": "me-west1", // region with allocated quota
"random_suffix": acctest.RandString(t, 10),
"org_id": envvar.GetTestOrgFromEnv(t),
"billing_account": envvar.GetTestBillingAccountFromEnv(t),
"vmwareengine_project": os.Getenv("GOOGLE_VMWAREENGINE_PROJECT"),
}

acctest.VcrTest(t, resource.TestCase{
Expand Down Expand Up @@ -72,13 +73,15 @@ func testVmwareEngineClusterConfig(context map[string]interface{}, nodeCount int
context["node_count"] = nodeCount
return acctest.Nprintf(`
resource "google_vmwareengine_network" "cluster-nw" {
project = "%{vmwareengine_project}"
name = "tf-test-cluster-nw%{random_suffix}"
location = "global"
type = "STANDARD"
description = "PC network description."
}
resource "google_vmwareengine_private_cloud" "cluster-pc" {
project = "%{vmwareengine_project}"
location = "%{region}-b"
name = "tf-test-cluster-pc%{random_suffix}"
description = "Sample test PC."
Expand Down Expand Up @@ -136,13 +139,15 @@ func testVmwareEngineClusterUpdateConfig(context map[string]interface{}, nodeCou
context["node_count"] = nodeCount
return acctest.Nprintf(`
resource "google_vmwareengine_network" "cluster-nw" {
project = "%{vmwareengine_project}"
name = "tf-test-cluster-nw%{random_suffix}"
location = "global"
type = "STANDARD"
description = "PC network description."
}
resource "google_vmwareengine_private_cloud" "cluster-pc" {
project = "%{vmwareengine_project}"
location = "%{region}-b"
name = "tf-test-cluster-pc%{random_suffix}"
description = "Sample test PC."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package vmwareengine_test

import (
"fmt"
"os"
"strings"
"testing"

Expand All @@ -14,14 +15,14 @@ import (
)

func TestAccVmwareengineExternalAddress_vmwareEngineExternalAddressUpdate(t *testing.T) {
t.Skip("https://github.com/hashicorp/terraform-provider-google/issues/20719")
t.Parallel()

context := map[string]interface{}{
"region": "me-west1", // region with allocated quota
"random_suffix": acctest.RandString(t, 10),
"org_id": envvar.GetTestOrgFromEnv(t),
"billing_account": envvar.GetTestBillingAccountFromEnv(t),
"region": "me-west1", // region with allocated quota
"random_suffix": acctest.RandString(t, 10),
"org_id": envvar.GetTestOrgFromEnv(t),
"billing_account": envvar.GetTestBillingAccountFromEnv(t),
"vmwareengine_project": os.Getenv("GOOGLE_VMWAREENGINE_PROJECT"),
}
acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
Expand Down Expand Up @@ -102,12 +103,14 @@ func testVmwareengineExternalAccessRuleUpdateConfig(context map[string]interface
func testVmwareengineBaseConfig(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_vmwareengine_network" "vmw-engine-ea-ear-nw" {
project = "%{vmwareengine_project}"
name = "tf-test-sample-ea-ear-nw%{random_suffix}"
location = "global"
type = "STANDARD"
description = "PC network description."
}
resource "google_vmwareengine_private_cloud" "vmw-engine-ea-ear-pc" {
project = "%{vmwareengine_project}"
location = "%{region}-b"
name = "tf-test-sample-ea-ear-pc%{random_suffix}"
type = "TIME_LIMITED"
Expand All @@ -128,6 +131,7 @@ resource "google_vmwareengine_private_cloud" "vmw-engine-ea-ear-pc" {
}
resource "google_vmwareengine_network_policy" "vmw-engine-ea-ear-np" {
project = "%{vmwareengine_project}"
location = "%{region}"
name = "tf-test-sample-ea-ear-np%{random_suffix}"
edge_services_cidr = "192.168.0.0/26"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package vmwareengine_test

import (
"os"
"testing"

"github.com/hashicorp/terraform-plugin-testing/helper/resource"
Expand All @@ -9,13 +10,13 @@ import (
)

func TestAccVmwareengineNetworkPeering_update(t *testing.T) {
t.Skip("https://github.com/hashicorp/terraform-provider-google/issues/20719")
t.Parallel()

context := map[string]interface{}{
"random_suffix": acctest.RandString(t, 10),
"org_id": envvar.GetTestOrgFromEnv(t),
"billing_account": envvar.GetTestBillingAccountFromEnv(t),
"random_suffix": acctest.RandString(t, 10),
"org_id": envvar.GetTestOrgFromEnv(t),
"billing_account": envvar.GetTestBillingAccountFromEnv(t),
"vmwareengine_project": os.Getenv("GOOGLE_VMWAREENGINE_PROJECT"),
}

acctest.VcrTest(t, resource.TestCase{
Expand All @@ -28,6 +29,9 @@ func TestAccVmwareengineNetworkPeering_update(t *testing.T) {
Steps: []resource.TestStep{
{
Config: testAccVmwareengineNetworkPeering_config(context, "Sample description."),
Check: resource.ComposeTestCheckFunc(
acctest.CheckDataSourceStateMatchesResourceStateWithIgnores("data.google_vmwareengine_network_peering.ds", "google_vmwareengine_network_peering.vmw-engine-network-peering", map[string]struct{}{}),
),
},
{
ResourceName: "google_vmwareengine_network_peering.vmw-engine-network-peering",
Expand All @@ -52,23 +56,31 @@ func testAccVmwareengineNetworkPeering_config(context map[string]interface{}, de
context["description"] = description
return acctest.Nprintf(`
resource "google_vmwareengine_network" "network-peering-nw" {
project = "%{vmwareengine_project}"
name = "tf-test-sample-nw%{random_suffix}"
location = "global"
type = "STANDARD"
}
resource "google_vmwareengine_network" "network-peering-peer-nw" {
project = "%{vmwareengine_project}"
name = "tf-test-peer-nw%{random_suffix}"
location = "global"
type = "STANDARD"
}
resource "google_vmwareengine_network_peering" "vmw-engine-network-peering" {
project = "%{vmwareengine_project}"
name = "tf-test-sample-network-peering%{random_suffix}"
description = "%{description}"
vmware_engine_network = google_vmwareengine_network.network-peering-nw.id
peer_network = google_vmwareengine_network.network-peering-peer-nw.id
peer_network_type = "VMWARE_ENGINE_NETWORK"
}
data "google_vmwareengine_network_peering" "ds" {
project = "%{vmwareengine_project}"
name = google_vmwareengine_network_peering.vmw-engine-network-peering.name
}
`, context)
}
Loading

0 comments on commit 7b15af4

Please sign in to comment.