Skip to content

Commit

Permalink
Move various files into correct locations, including moving test file…
Browse files Browse the repository at this point in the history
…s into location so they're used in the downstream (#7505) (#14063)

* Move data source file into correct location

* Rename data source test file to match conventions

* Move handwritten tests into correct folder

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Mar 22, 2023
1 parent 6e6975e commit 5cd80a9
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/7505.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none

```
67 changes: 67 additions & 0 deletions google/resource_certificate_manager_dns_authorization_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package google

import (
"testing"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)

func TestAccCertificateManagerDnsAuthorization_update(t *testing.T) {
t.Parallel()

context := map[string]interface{}{
"random_suffix": RandString(t, 10),
}

VcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV5ProviderFactories: ProtoV5ProviderFactories(t),
CheckDestroy: testAccCheckCertificateManagerDnsAuthorizationDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccCertificateManagerDnsAuthorization_update0(context),
},
{
ResourceName: "google_certificate_manager_dns_authorization.default",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"name"},
},
{
Config: testAccCertificateManagerDnsAuthorization_update1(context),
},
{
ResourceName: "google_certificate_manager_dns_authorization.default",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"name"},
},
},
})
}

func testAccCertificateManagerDnsAuthorization_update0(context map[string]interface{}) string {
return Nprintf(`
resource "google_certificate_manager_dns_authorization" "default" {
name = "tf-test-dns-auth%{random_suffix}"
description = "The default dnss"
labels = {
a = "a"
}
domain = "%{random_suffix}.hashicorptest.com"
}
`, context)
}

func testAccCertificateManagerDnsAuthorization_update1(context map[string]interface{}) string {
return Nprintf(`
resource "google_certificate_manager_dns_authorization" "default" {
name = "tf-test-dns-auth%{random_suffix}"
description = "The default dnss2"
labels = {
a = "b"
}
domain = "%{random_suffix}.hashicorptest.com"
}
`, context)
}
58 changes: 58 additions & 0 deletions google/resource_network_services_edge_cache_keyset_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package google

import (
"testing"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)

func TestAccNetworkServicesEdgeCacheKeyset_update(t *testing.T) {
t.Parallel()

context := map[string]interface{}{
"random_suffix": RandString(t, 10),
}

VcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV5ProviderFactories: ProtoV5ProviderFactories(t),
CheckDestroy: testAccCheckNetworkServicesEdgeCacheKeysetDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccNetworkServicesEdgeCacheKeyset_networkServicesEdgeCacheKeysetBasicExample(context),
},
{
ResourceName: "google_network_services_edge_cache_keyset.default",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"name"},
},
{
Config: testAccNetworkServicesEdgeCacheKeyset_update(context),
},
{
ResourceName: "google_network_services_edge_cache_keyset.default",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"name"},
},
},
})
}

func testAccNetworkServicesEdgeCacheKeyset_update(context map[string]interface{}) string {
return Nprintf(`
resource "google_network_services_edge_cache_keyset" "default" {
name = "default%{random_suffix}"
description = "T2"
public_key {
id = "my-public-key-2"
value = "hzd03llxB1u5FOLKFkZ6_wCJqC7jtN0bg7xlBqS6WVM"
}
labels = {
a = "a"
}
}
`, context)
}

0 comments on commit 5cd80a9

Please sign in to comment.