Merge pull request #11165 from hashicorp/b-11161
Add a test to make sure the implied `connection_limit` default of `-1` is always set.
This commit is contained in:
commit
864c7691b1
|
@ -19,41 +19,25 @@ func TestAccPostgresqlRole_Basic(t *testing.T) {
|
||||||
Config: testAccPostgresqlRoleConfig,
|
Config: testAccPostgresqlRoleConfig,
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckPostgresqlRoleExists("postgresql_role.myrole2", "true"),
|
testAccCheckPostgresqlRoleExists("postgresql_role.myrole2", "true"),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckResourceAttr("postgresql_role.myrole2", "name", "myrole2"),
|
||||||
"postgresql_role.myrole2", "name", "myrole2"),
|
resource.TestCheckResourceAttr("postgresql_role.myrole2", "login", "true"),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckResourceAttr("postgresql_role.myrole2", "skip_drop_role", "false"),
|
||||||
"postgresql_role.myrole2", "login", "true"),
|
resource.TestCheckResourceAttr("postgresql_role.myrole2", "skip_reassign_owned", "false"),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckResourceAttr("postgresql_role.myrole2", "connection_limit", "-1"),
|
||||||
"postgresql_role.myrole2", "skip_drop_role", "false"),
|
|
||||||
resource.TestCheckResourceAttr(
|
|
||||||
"postgresql_role.myrole2", "skip_reassign_owned", "false"),
|
|
||||||
|
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckResourceAttr("postgresql_role.role_with_defaults", "name", "testing_role_with_defaults"),
|
||||||
"postgresql_role.role_with_defaults", "name", "testing_role_with_defaults"),
|
resource.TestCheckResourceAttr("postgresql_role.role_with_defaults", "superuser", "false"),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckResourceAttr("postgresql_role.role_with_defaults", "create_database", "false"),
|
||||||
"postgresql_role.role_with_defaults", "superuser", "false"),
|
resource.TestCheckResourceAttr("postgresql_role.role_with_defaults", "create_role", "false"),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckResourceAttr("postgresql_role.role_with_defaults", "inherit", "false"),
|
||||||
"postgresql_role.role_with_defaults", "create_database", "false"),
|
resource.TestCheckResourceAttr("postgresql_role.role_with_defaults", "replication", "false"),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckResourceAttr("postgresql_role.role_with_defaults", "bypass_row_level_security", "false"),
|
||||||
"postgresql_role.role_with_defaults", "create_role", "false"),
|
resource.TestCheckResourceAttr("postgresql_role.role_with_defaults", "connection_limit", "-1"),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckResourceAttr("postgresql_role.role_with_defaults", "encrypted_password", "true"),
|
||||||
"postgresql_role.role_with_defaults", "inherit", "false"),
|
resource.TestCheckResourceAttr("postgresql_role.role_with_defaults", "password", ""),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckResourceAttr("postgresql_role.role_with_defaults", "valid_until", "infinity"),
|
||||||
"postgresql_role.role_with_defaults", "replication", "false"),
|
resource.TestCheckResourceAttr("postgresql_role.role_with_defaults", "skip_drop_role", "false"),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckResourceAttr("postgresql_role.role_with_defaults", "skip_reassign_owned", "false"),
|
||||||
"postgresql_role.role_with_defaults", "bypass_row_level_security", "false"),
|
|
||||||
resource.TestCheckResourceAttr(
|
|
||||||
"postgresql_role.role_with_defaults", "connection_limit", "-1"),
|
|
||||||
resource.TestCheckResourceAttr(
|
|
||||||
"postgresql_role.role_with_defaults", "encrypted_password", "true"),
|
|
||||||
resource.TestCheckResourceAttr(
|
|
||||||
"postgresql_role.role_with_defaults", "password", ""),
|
|
||||||
resource.TestCheckResourceAttr(
|
|
||||||
"postgresql_role.role_with_defaults", "valid_until", "infinity"),
|
|
||||||
resource.TestCheckResourceAttr(
|
|
||||||
"postgresql_role.role_with_defaults", "skip_drop_role", "false"),
|
|
||||||
resource.TestCheckResourceAttr(
|
|
||||||
"postgresql_role.role_with_defaults", "skip_reassign_owned", "false"),
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue