Skip to content

Commit

Permalink
r/aws_ssm_patch_baseline(test): tidy configs
Browse files Browse the repository at this point in the history
  • Loading branch information
jar-b committed Oct 31, 2024
1 parent ae7e00c commit 23402a1
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions internal/service/ssm/patch_baseline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ func TestAccSSMPatchBaseline_approveUntilDateParam(t *testing.T) {
})
}

func TestAccSSMPatchBaseline_approveAfterDaysParam(t *testing.T) {
func TestAccSSMPatchBaseline_approveAfterDays(t *testing.T) {
ctx := acctest.Context(t)
var before ssm.GetPatchBaselineOutput
var baseline ssm.GetPatchBaselineOutput
name := sdkacctest.RandString(10)
resourceName := "aws_ssm_patch_baseline.test"

Expand All @@ -234,9 +234,9 @@ func TestAccSSMPatchBaseline_approveAfterDaysParam(t *testing.T) {
CheckDestroy: testAccCheckPatchBaselineDestroy(ctx),
Steps: []resource.TestStep{
{
Config: testAccPatchBaselineConfig_approve_after_days(name),
Config: testAccPatchBaselineConfig_approveAfterDays(name),
Check: resource.ComposeTestCheckFunc(
testAccCheckPatchBaselineExists(ctx, resourceName, &before),
testAccCheckPatchBaselineExists(ctx, resourceName, &baseline),
resource.TestCheckResourceAttr(resourceName, "approval_rule.#", "1"),
resource.TestCheckResourceAttr(resourceName, "approval_rule.0.approve_after_days", "360"),
resource.TestCheckResourceAttr(resourceName, "approval_rule.0.patch_filter.#", "2"),
Expand Down Expand Up @@ -640,17 +640,13 @@ resource "aws_ssm_patch_baseline" "test" {
`, rName)
}

func testAccPatchBaselineConfig_approve_after_days(rName string) string {
func testAccPatchBaselineConfig_approveAfterDays(rName string) string {
return fmt.Sprintf(`
resource "aws_ssm_patch_baseline" "test" {
name = "patch-baseline-%[1]s"
name = %[1]q
operating_system = "AMAZON_LINUX"
description = "Baseline containing all updates approved for production systems"
tags = {
Name = "My Patch Baseline"
}
approval_rule {
approve_after_days = 360
enable_non_security = true
Expand Down

0 comments on commit 23402a1

Please sign in to comment.