Fix org policies update test to actually update instead of doing a create/delete/create/delete cycle (#573)

This commit is contained in:
Vincent Roseberry 2017-10-11 13:31:24 -07:00 committed by GitHub
parent 231d866eba
commit eb88e6d40d
2 changed files with 9 additions and 9 deletions

View File

@ -19,7 +19,7 @@ func TestAccGoogleOrganizationPolicy_import(t *testing.T) {
Config: testAccGoogleOrganizationPolicy_list_allowAll(org),
},
{
ResourceName: "google_organization_policy.listAll",
ResourceName: "google_organization_policy.list",
ImportState: true,
ImportStateVerify: true,
},

View File

@ -86,7 +86,7 @@ func TestAccGoogleOrganizationPolicy_list_allowAll(t *testing.T) {
Steps: []resource.TestStep{
{
Config: testAccGoogleOrganizationPolicy_list_allowAll(org),
Check: testAccCheckGoogleOrganizationListPolicyAll("listAll", "ALLOW"),
Check: testAccCheckGoogleOrganizationListPolicyAll("list", "ALLOW"),
},
},
})
@ -104,7 +104,7 @@ func TestAccGoogleOrganizationPolicy_list_allowSome(t *testing.T) {
Steps: []resource.TestStep{
{
Config: testAccGoogleOrganizationPolicy_list_allowSome(org, project),
Check: testAccCheckGoogleOrganizationListPolicyAllowedValues("listSome", []string{project}),
Check: testAccCheckGoogleOrganizationListPolicyAllowedValues("list", []string{project}),
},
},
})
@ -121,7 +121,7 @@ func TestAccGoogleOrganizationPolicy_list_denySome(t *testing.T) {
Steps: []resource.TestStep{
{
Config: testAccGoogleOrganizationPolicy_list_denySome(org),
Check: testAccCheckGoogleOrganizationListPolicyDeniedValues("listSome", DENIED_ORG_POLICIES),
Check: testAccCheckGoogleOrganizationListPolicyDeniedValues("list", DENIED_ORG_POLICIES),
},
},
})
@ -138,11 +138,11 @@ func TestAccGoogleOrganizationPolicy_list_update(t *testing.T) {
Steps: []resource.TestStep{
{
Config: testAccGoogleOrganizationPolicy_list_allowAll(org),
Check: testAccCheckGoogleOrganizationListPolicyAll("listAll", "ALLOW"),
Check: testAccCheckGoogleOrganizationListPolicyAll("list", "ALLOW"),
},
{
Config: testAccGoogleOrganizationPolicy_list_denySome(org),
Check: testAccCheckGoogleOrganizationListPolicyDeniedValues("listSome", DENIED_ORG_POLICIES),
Check: testAccCheckGoogleOrganizationListPolicyDeniedValues("list", DENIED_ORG_POLICIES),
},
},
})
@ -270,7 +270,7 @@ resource "google_organization_policy" "bool" {
func testAccGoogleOrganizationPolicy_list_allowAll(org string) string {
return fmt.Sprintf(`
resource "google_organization_policy" "listAll" {
resource "google_organization_policy" "list" {
org_id = "%s"
constraint = "constraints/serviceuser.services"
@ -285,7 +285,7 @@ resource "google_organization_policy" "listAll" {
func testAccGoogleOrganizationPolicy_list_allowSome(org, project string) string {
return fmt.Sprintf(`
resource "google_organization_policy" "listSome" {
resource "google_organization_policy" "list" {
org_id = "%s"
constraint = "constraints/compute.trustedImageProjects"
@ -302,7 +302,7 @@ resource "google_organization_policy" "listSome" {
func testAccGoogleOrganizationPolicy_list_denySome(org string) string {
return fmt.Sprintf(`
resource "google_organization_policy" "listSome" {
resource "google_organization_policy" "list" {
org_id = "%s"
constraint = "serviceuser.services"