-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add test for windows_local_group_member resource
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
internal/provider/local/local_group_member_resource_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"), | ||
), | ||
}, | ||
}, | ||
}) | ||
} |