Skip to content

Commit 8626c82

Browse files
Move various files into correct locations, including moving test files into location so they're used in the downstream (#7505) (#5359)
* 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]>
1 parent e760bf7 commit 8626c82

File tree

4 files changed

+128
-0
lines changed

4 files changed

+128
-0
lines changed

.changelog/7505.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:none
2+
3+
```
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
package google
2+
3+
import (
4+
"testing"
5+
6+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
7+
)
8+
9+
func TestAccCertificateManagerDnsAuthorization_update(t *testing.T) {
10+
t.Parallel()
11+
12+
context := map[string]interface{}{
13+
"random_suffix": RandString(t, 10),
14+
}
15+
16+
VcrTest(t, resource.TestCase{
17+
PreCheck: func() { testAccPreCheck(t) },
18+
ProtoV5ProviderFactories: ProtoV5ProviderFactories(t),
19+
CheckDestroy: testAccCheckCertificateManagerDnsAuthorizationDestroyProducer(t),
20+
Steps: []resource.TestStep{
21+
{
22+
Config: testAccCertificateManagerDnsAuthorization_update0(context),
23+
},
24+
{
25+
ResourceName: "google_certificate_manager_dns_authorization.default",
26+
ImportState: true,
27+
ImportStateVerify: true,
28+
ImportStateVerifyIgnore: []string{"name"},
29+
},
30+
{
31+
Config: testAccCertificateManagerDnsAuthorization_update1(context),
32+
},
33+
{
34+
ResourceName: "google_certificate_manager_dns_authorization.default",
35+
ImportState: true,
36+
ImportStateVerify: true,
37+
ImportStateVerifyIgnore: []string{"name"},
38+
},
39+
},
40+
})
41+
}
42+
43+
func testAccCertificateManagerDnsAuthorization_update0(context map[string]interface{}) string {
44+
return Nprintf(`
45+
resource "google_certificate_manager_dns_authorization" "default" {
46+
name = "tf-test-dns-auth%{random_suffix}"
47+
description = "The default dnss"
48+
labels = {
49+
a = "a"
50+
}
51+
domain = "%{random_suffix}.hashicorptest.com"
52+
}
53+
`, context)
54+
}
55+
56+
func testAccCertificateManagerDnsAuthorization_update1(context map[string]interface{}) string {
57+
return Nprintf(`
58+
resource "google_certificate_manager_dns_authorization" "default" {
59+
name = "tf-test-dns-auth%{random_suffix}"
60+
description = "The default dnss2"
61+
labels = {
62+
a = "b"
63+
}
64+
domain = "%{random_suffix}.hashicorptest.com"
65+
}
66+
`, context)
67+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package google
2+
3+
import (
4+
"testing"
5+
6+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
7+
)
8+
9+
func TestAccNetworkServicesEdgeCacheKeyset_update(t *testing.T) {
10+
t.Parallel()
11+
12+
context := map[string]interface{}{
13+
"random_suffix": RandString(t, 10),
14+
}
15+
16+
VcrTest(t, resource.TestCase{
17+
PreCheck: func() { testAccPreCheck(t) },
18+
ProtoV5ProviderFactories: ProtoV5ProviderFactories(t),
19+
CheckDestroy: testAccCheckNetworkServicesEdgeCacheKeysetDestroyProducer(t),
20+
Steps: []resource.TestStep{
21+
{
22+
Config: testAccNetworkServicesEdgeCacheKeyset_networkServicesEdgeCacheKeysetBasicExample(context),
23+
},
24+
{
25+
ResourceName: "google_network_services_edge_cache_keyset.default",
26+
ImportState: true,
27+
ImportStateVerify: true,
28+
ImportStateVerifyIgnore: []string{"name"},
29+
},
30+
{
31+
Config: testAccNetworkServicesEdgeCacheKeyset_update(context),
32+
},
33+
{
34+
ResourceName: "google_network_services_edge_cache_keyset.default",
35+
ImportState: true,
36+
ImportStateVerify: true,
37+
ImportStateVerifyIgnore: []string{"name"},
38+
},
39+
},
40+
})
41+
}
42+
43+
func testAccNetworkServicesEdgeCacheKeyset_update(context map[string]interface{}) string {
44+
return Nprintf(`
45+
46+
resource "google_network_services_edge_cache_keyset" "default" {
47+
name = "default%{random_suffix}"
48+
description = "T2"
49+
public_key {
50+
id = "my-public-key-2"
51+
value = "hzd03llxB1u5FOLKFkZ6_wCJqC7jtN0bg7xlBqS6WVM"
52+
}
53+
labels = {
54+
a = "a"
55+
}
56+
}
57+
`, context)
58+
}

0 commit comments

Comments
 (0)