mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-01 07:42:40 +00:00
Cleanup from two overlapping magic modules PRs. (#2787)
This commit is contained in:
parent
75f54dce7c
commit
f703fb0aa8
|
@ -16,6 +16,7 @@ package google
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/acctest"
|
||||
|
@ -71,10 +72,13 @@ resource "google_appengine_firewall_rule" "rule" {
|
|||
}
|
||||
|
||||
func testAccCheckAppengineFirewallRuleDestroy(s *terraform.State) error {
|
||||
for _, rs := range s.RootModule().Resources {
|
||||
for name, rs := range s.RootModule().Resources {
|
||||
if rs.Type != "google_appengine_firewall_rule" {
|
||||
continue
|
||||
}
|
||||
if strings.HasPrefix(name, "data.") {
|
||||
continue
|
||||
}
|
||||
|
||||
config := testAccProvider.Meta().(*Config)
|
||||
|
||||
|
|
|
@ -27,13 +27,17 @@ import (
|
|||
func TestAccComputeImage_imageBasicExample(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
context := map[string]interface{}{
|
||||
"random_suffix": acctest.RandString(10),
|
||||
}
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckComputeImageDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
{
|
||||
Config: testAccComputeImage_imageBasicExample(acctest.RandString(10)),
|
||||
Config: testAccComputeImage_imageBasicExample(context),
|
||||
},
|
||||
{
|
||||
ResourceName: "google_compute_image.example",
|
||||
|
@ -45,17 +49,16 @@ func TestAccComputeImage_imageBasicExample(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func testAccComputeImage_imageBasicExample(val string) string {
|
||||
return fmt.Sprintf(`
|
||||
func testAccComputeImage_imageBasicExample(context map[string]interface{}) string {
|
||||
return Nprintf(`
|
||||
resource "google_compute_image" "example" {
|
||||
name = "example-image-%s"
|
||||
name = "example-image-%{random_suffix}"
|
||||
|
||||
raw_disk {
|
||||
source = "https://storage.googleapis.com/bosh-cpi-artifacts/bosh-stemcell-3262.4-google-kvm-ubuntu-trusty-go_agent-raw.tar.gz"
|
||||
}
|
||||
}
|
||||
`, val,
|
||||
)
|
||||
`, context)
|
||||
}
|
||||
|
||||
func testAccCheckComputeImageDestroy(s *terraform.State) error {
|
||||
|
|
Loading…
Reference in New Issue
Block a user