@@ -44,7 +44,7 @@ func TestAccCloudStackProject_basic(t *testing.T) {
4444 resource .TestCheckResourceAttr (
4545 "cloudstack_project.foo" , "name" , "terraform-test-project" ),
4646 resource .TestCheckResourceAttr (
47- "cloudstack_project.foo" , "display_text " , "Terraform Test Project" ),
47+ "cloudstack_project.foo" , "displaytext " , "Terraform Test Project" ),
4848 ),
4949 },
5050 },
@@ -67,7 +67,7 @@ func TestAccCloudStackProject_update(t *testing.T) {
6767 resource .TestCheckResourceAttr (
6868 "cloudstack_project.foo" , "name" , "terraform-test-project" ),
6969 resource .TestCheckResourceAttr (
70- "cloudstack_project.foo" , "display_text " , "Terraform Test Project" ),
70+ "cloudstack_project.foo" , "displaytext " , "Terraform Test Project" ),
7171 ),
7272 },
7373 {
@@ -78,7 +78,7 @@ func TestAccCloudStackProject_update(t *testing.T) {
7878 resource .TestCheckResourceAttr (
7979 "cloudstack_project.foo" , "name" , "terraform-test-project-updated" ),
8080 resource .TestCheckResourceAttr (
81- "cloudstack_project.foo" , "display_text " , "Terraform Test Project Updated" ),
81+ "cloudstack_project.foo" , "displaytext " , "Terraform Test Project Updated" ),
8282 ),
8383 },
8484 },
@@ -119,7 +119,7 @@ func TestAccCloudStackProject_account(t *testing.T) {
119119 resource .TestCheckResourceAttr (
120120 "cloudstack_project.bar" , "name" , "terraform-test-project-account" ),
121121 resource .TestCheckResourceAttr (
122- "cloudstack_project.bar" , "display_text " , "Terraform Test Project with Account" ),
122+ "cloudstack_project.bar" , "displaytext " , "Terraform Test Project with Account" ),
123123 resource .TestCheckResourceAttr (
124124 "cloudstack_project.bar" , "account" , "admin" ),
125125 ),
@@ -144,7 +144,7 @@ func TestAccCloudStackProject_updateAccount(t *testing.T) {
144144 resource .TestCheckResourceAttr (
145145 "cloudstack_project.bar" , "name" , "terraform-test-project-account" ),
146146 resource .TestCheckResourceAttr (
147- "cloudstack_project.bar" , "display_text " , "Terraform Test Project with Account" ),
147+ "cloudstack_project.bar" , "displaytext " , "Terraform Test Project with Account" ),
148148 resource .TestCheckResourceAttr (
149149 "cloudstack_project.bar" , "account" , "admin" ),
150150 ),
@@ -157,7 +157,7 @@ func TestAccCloudStackProject_updateAccount(t *testing.T) {
157157 resource .TestCheckResourceAttr (
158158 "cloudstack_project.bar" , "name" , "terraform-test-project-account" ),
159159 resource .TestCheckResourceAttr (
160- "cloudstack_project.bar" , "display_text " , "Terraform Test Project with Account" ),
160+ "cloudstack_project.bar" , "displaytext " , "Terraform Test Project with Account" ),
161161 resource .TestCheckResourceAttr (
162162 "cloudstack_project.bar" , "account" , "admin" ),
163163 ),
@@ -182,7 +182,7 @@ func TestAccCloudStackProject_emptyDisplayText(t *testing.T) {
182182 resource .TestCheckResourceAttr (
183183 "cloudstack_project.empty" , "name" , "terraform-test-project-empty-display" ),
184184 resource .TestCheckResourceAttr (
185- "cloudstack_project.empty" , "display_text " , "terraform-test-project-empty-display" ),
185+ "cloudstack_project.empty" , "displaytext " , "terraform-test-project-empty-display" ),
186186 ),
187187 },
188188 },
@@ -205,7 +205,7 @@ func TestAccCloudStackProject_updateUserid(t *testing.T) {
205205 resource .TestCheckResourceAttr (
206206 "cloudstack_project.baz" , "name" , "terraform-test-project-userid" ),
207207 resource .TestCheckResourceAttr (
208- "cloudstack_project.baz" , "display_text " , "Terraform Test Project with Userid" ),
208+ "cloudstack_project.baz" , "displaytext " , "Terraform Test Project with Userid" ),
209209 ),
210210 },
211211 {
@@ -216,7 +216,7 @@ func TestAccCloudStackProject_updateUserid(t *testing.T) {
216216 resource .TestCheckResourceAttr (
217217 "cloudstack_project.baz" , "name" , "terraform-test-project-userid-updated" ),
218218 resource .TestCheckResourceAttr (
219- "cloudstack_project.baz" , "display_text " , "Terraform Test Project with Userid Updated" ),
219+ "cloudstack_project.baz" , "displaytext " , "Terraform Test Project with Userid Updated" ),
220220 ),
221221 },
222222 },
@@ -403,51 +403,89 @@ func testAccCheckCloudStackProjectDestroy(s *terraform.State) error {
403403const testAccCloudStackProject_basic = `
404404resource "cloudstack_project" "foo" {
405405 name = "terraform-test-project"
406- display_text = "Terraform Test Project"
406+ displaytext = "Terraform Test Project"
407407}`
408408
409409const testAccCloudStackProject_update = `
410410resource "cloudstack_project" "foo" {
411411 name = "terraform-test-project-updated"
412- display_text = "Terraform Test Project Updated"
412+ displaytext = "Terraform Test Project Updated"
413413}`
414414
415415const testAccCloudStackProject_account = `
416416resource "cloudstack_project" "bar" {
417417 name = "terraform-test-project-account"
418- display_text = "Terraform Test Project with Account"
418+ displaytext = "Terraform Test Project with Account"
419419 account = "admin"
420420 domain = "ROOT"
421421}`
422422
423423const testAccCloudStackProject_updateAccount = `
424424resource "cloudstack_project" "bar" {
425425 name = "terraform-test-project-account"
426- display_text = "Terraform Test Project with Account"
426+ displaytext = "Terraform Test Project with Account"
427427 account = "admin"
428428 domain = "ROOT"
429429}`
430430
431431const testAccCloudStackProject_userid = `
432432resource "cloudstack_project" "baz" {
433433 name = "terraform-test-project-userid"
434- display_text = "Terraform Test Project with Userid"
434+ displaytext = "Terraform Test Project with Userid"
435435 domain = "ROOT"
436436}`
437437
438438const testAccCloudStackProject_updateUserid = `
439439resource "cloudstack_project" "baz" {
440440 name = "terraform-test-project-userid-updated"
441- display_text = "Terraform Test Project with Userid Updated"
441+ displaytext = "Terraform Test Project with Userid Updated"
442442 domain = "ROOT"
443443}`
444444
445445const testAccCloudStackProject_emptyDisplayText = `
446446resource "cloudstack_project" "empty" {
447447 name = "terraform-test-project-empty-display"
448- display_text = "terraform-test-project-empty-display"
448+ displaytext = "terraform-test-project-empty-display"
449449}`
450450
451+ func TestAccCloudStackProject_updateAccountid (t * testing.T ) {
452+ var project cloudstack.Project
453+
454+ resource .Test (t , resource.TestCase {
455+ PreCheck : func () { testAccPreCheck (t ) },
456+ Providers : testAccProviders ,
457+ CheckDestroy : testAccCheckCloudStackProjectDestroy ,
458+ Steps : []resource.TestStep {
459+ {
460+ Config : testAccCloudStackProject_accountid ,
461+ Check : resource .ComposeTestCheckFunc (
462+ testAccCheckCloudStackProjectExists (
463+ "cloudstack_project.accountid_test" , & project ),
464+ resource .TestCheckResourceAttr (
465+ "cloudstack_project.accountid_test" , "name" , "terraform-test-project-accountid" ),
466+ resource .TestCheckResourceAttr (
467+ "cloudstack_project.accountid_test" , "displaytext" , "Terraform Test Project with Accountid" ),
468+ resource .TestCheckResourceAttrSet (
469+ "cloudstack_project.accountid_test" , "accountid" ),
470+ ),
471+ },
472+ {
473+ Config : testAccCloudStackProject_updateAccountid ,
474+ Check : resource .ComposeTestCheckFunc (
475+ testAccCheckCloudStackProjectExists (
476+ "cloudstack_project.accountid_test" , & project ),
477+ resource .TestCheckResourceAttr (
478+ "cloudstack_project.accountid_test" , "name" , "terraform-test-project-accountid" ),
479+ resource .TestCheckResourceAttr (
480+ "cloudstack_project.accountid_test" , "displaytext" , "Terraform Test Project with Accountid" ),
481+ resource .TestCheckResourceAttrSet (
482+ "cloudstack_project.accountid_test" , "accountid" ),
483+ ),
484+ },
485+ },
486+ })
487+ }
488+
451489func TestAccCloudStackProject_list (t * testing.T ) {
452490 resource .Test (t , resource.TestCase {
453491 PreCheck : func () { testAccPreCheck (t ) },
@@ -511,13 +549,29 @@ func testAccCheckCloudStackProjectsExist(projectNames ...string) resource.TestCh
511549 }
512550}
513551
552+ const testAccCloudStackProject_accountid = `
553+ resource "cloudstack_project" "accountid_test" {
554+ name = "terraform-test-project-accountid"
555+ displaytext = "Terraform Test Project with Accountid"
556+ accountid = "1"
557+ domain = "ROOT"
558+ }`
559+
560+ const testAccCloudStackProject_updateAccountid = `
561+ resource "cloudstack_project" "accountid_test" {
562+ name = "terraform-test-project-accountid"
563+ displaytext = "Terraform Test Project with Accountid"
564+ accountid = "2"
565+ domain = "ROOT"
566+ }`
567+
514568const testAccCloudStackProject_list = `
515569resource "cloudstack_project" "project1" {
516570 name = "terraform-test-project-list-1"
517- display_text = "Terraform Test Project List 1"
571+ displaytext = "Terraform Test Project List 1"
518572}
519573
520574resource "cloudstack_project" "project2" {
521575 name = "terraform-test-project-list-2"
522- display_text = "Terraform Test Project List 2"
576+ displaytext = "Terraform Test Project List 2"
523577}`
0 commit comments