Skip to content

Commit

Permalink
test: add test for windows_local_group_member resource
Browse files Browse the repository at this point in the history
  • Loading branch information
d-strobel committed Sep 29, 2024
1 parent fab8282 commit 0bec075
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions internal/provider/local/local_group_member_resource_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package local_test

import (
"testing"

"github.com/d-strobel/terraform-provider-windows/internal/acctest"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
)

func TestAccLocalGroupMemberResource(t *testing.T) {
resource.Test(t, resource.TestCase{
ProtoV6ProviderFactories: acctest.TestAccProtoV6ProviderFactories,
Steps: []resource.TestStep{
// Create and Read testing with Guest user in Administrators group
{
Config: acctest.ProviderConfig() + `
resource "windows_local_group_member" "test" {
group_id = "S-1-5-32-544"
member_id = "S-1-5-21-153895498-367353507-3704405138-501"
}
`,
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr("windows_local_group_member.test", "group_id", "S-1-5-32-544"),
resource.TestCheckResourceAttr("windows_local_group_member.test", "member_id", "S-1-5-21-153895498-367353507-3704405138-501"),
resource.TestCheckResourceAttr("windows_local_group_member.test", "id", "S-1-5-32-544/member/S-1-5-21-153895498-367353507-3704405138-501"),
),
},
},
})
}

0 comments on commit 0bec075

Please sign in to comment.