mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-09 03:28:29 +00:00
9fa1d462d2
<!-- This change is generated by MagicModules. --> /cc @chrisst
48 lines
1.1 KiB
Go
48 lines
1.1 KiB
Go
package google
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
)
|
|
|
|
func TestAccDataSourceGoogleProjectOrganizationPolicy_basic(t *testing.T) {
|
|
project := getTestProjectFromEnv()
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
Steps: []resource.TestStep{
|
|
{
|
|
Config: testAccDataSourceGoogleProjectOrganizationPolicy_basic(project),
|
|
Check: testAccDataSourceGoogleOrganizationPolicyCheck(
|
|
"data.google_project_organization_policy.data",
|
|
"google_project_organization_policy.resource"),
|
|
},
|
|
},
|
|
})
|
|
}
|
|
|
|
func testAccDataSourceGoogleProjectOrganizationPolicy_basic(project string) string {
|
|
return fmt.Sprintf(`
|
|
|
|
|
|
resource "google_project_organization_policy" "resource" {
|
|
project = "%s"
|
|
constraint = "constraints/compute.trustedImageProjects"
|
|
|
|
list_policy {
|
|
allow {
|
|
all = true
|
|
}
|
|
}
|
|
}
|
|
|
|
data "google_project_organization_policy" "data" {
|
|
project = "%s"
|
|
constraint = "constraints/compute.trustedImageProjects"
|
|
}
|
|
`, project, project)
|
|
}
|