diff --git a/rancher2/data_source_rancher2_user_test.go b/rancher2/data_source_rancher2_user_test.go index 8ed6d01e..97a2c668 100644 --- a/rancher2/data_source_rancher2_user_test.go +++ b/rancher2/data_source_rancher2_user_test.go @@ -23,6 +23,7 @@ data "` + testAccRancher2UserType + `" "foo" { resource.TestCheckResourceAttr(name, "username", "foo"), resource.TestCheckResourceAttr(name, "name", "Terraform user acceptance test"), resource.TestCheckResourceAttr(name, "enabled", "true"), + resource.TestCheckResourceAttr(name, "must_change_password", "true"), ), }, }, diff --git a/rancher2/resource_rancher2_user_test.go b/rancher2/resource_rancher2_user_test.go index a223fb8f..47ed8113 100644 --- a/rancher2/resource_rancher2_user_test.go +++ b/rancher2/resource_rancher2_user_test.go @@ -26,6 +26,7 @@ resource "` + testAccRancher2UserType + `" "foo" { username = "foo" password = "TestACC123456" enabled = true + must_change_password = true } ` testAccRancher2UserUpdate = ` @@ -34,6 +35,7 @@ resource "` + testAccRancher2UserType + `" "foo" { username = "foo" password = "TestACC1234567" enabled = false + must_change_password = true } ` } @@ -52,6 +54,7 @@ func TestAccRancher2User_basic(t *testing.T) { resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "name", "Terraform user acceptance test"), resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "password", "TestACC123456"), resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "enabled", "true"), + resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "must_change_password", "true"), ), }, { @@ -61,6 +64,7 @@ func TestAccRancher2User_basic(t *testing.T) { resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "name", "Terraform user acceptance test - Updated"), resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "password", "TestACC1234567"), resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "enabled", "false"), + resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "must_change_password", "true"), ), }, { @@ -70,6 +74,7 @@ func TestAccRancher2User_basic(t *testing.T) { resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "name", "Terraform user acceptance test"), resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "password", "TestACC123456"), resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "enabled", "true"), + resource.TestCheckResourceAttr(testAccRancher2UserType+".foo", "must_change_password", "true"), ), }, }, diff --git a/rancher2/structure_user_test.go b/rancher2/structure_user_test.go index 11e71a2a..78e49fac 100644 --- a/rancher2/structure_user_test.go +++ b/rancher2/structure_user_test.go @@ -15,14 +15,16 @@ var ( func init() { testUserConf = &managementClient.User{ - Name: "name", - Username: "username", - Enabled: newTrue(), + Name: "name", + Username: "username", + Enabled: newTrue(), + MustChangePassword: *newTrue(), } testUserInterface = map[string]interface{}{ - "name": "name", - "username": "username", - "enabled": true, + "name": "name", + "username": "username", + "enabled": true, + "must_change_password": true, } }