Added three simple test cases covering the new custom validation, jamf/resource_jamf_staticComputerGroup_test.go
Fixed one simple bug in make testacc - incorrect gofmtcheck.sh path
Fixed two simple bugs in jamf/resource_jamf_computer_extension_attribute_test.go and jamf/data_source_jamf_computer_extension_attribute.go: data_type = "string" -> "String"; recon_display missing from schemata.
There are two other bugs in jamf/resource_jamf_computer_extension_attribute_test.go, though I may just be holding it wrong. On the first run, this occurs:
I'm not sure how to fix this yet. If its not just my mistake, lmk, I'll open an issue.
On a subsequent run, the test fails because the prior test did succeed in creating an extension attribute - but didn't destroy it. Jamf API returns a duplicate name error:
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./jamf -v -count 1 -parallel 20 -run TestAccJamfComputerExtensionAttribute_basic -timeout 120m
=== RUN TestAccJamfComputerExtensionAttribute_basic
=== PAUSE TestAccJamfComputerExtensionAttribute_basic
=== CONT TestAccJamfComputerExtensionAttribute_basic
resource_jamf_computer_extension_attribute_test.go:12: Step 1/3 error: Error running apply: exit status 1
Error: API Error: 409 URI: /JSSResource/computerextensionattributes/id/0 Body: <html> <head> <title>Status page</title> </head> <body style="font-family: sans-serif;"> <p style="font-size: 1.2em;font-weight: bold;margin: 1em 0px;">Conflict</p> <p>Error: Duplicate name</p> <p>You can get technical details <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10">here</a>.<br> Please continue your visit at our <a href="/">home page</a>. </p> </body> </html>
--- FAIL: TestAccJamfComputerExtensionAttribute_basic (1.34s)
FAIL
FAIL github.com/yohan460/terraform-provider-jamf/jamf 1.619s
FAIL
make: *** [testacc] Error 1
Changes:
jamf_staticComputerGroup
'scomputer
attribute schema now allows for exactly one ofserial_number
orid
.The example in docs seems to imply that serial number may be used to assign a computer:
However, it's presently a computed value. Only the Jamf computer object's ID may be used. This change allows the use of serial number.
buildJamfStaticComputerGroupStruct
now returns an error if both (or neither) aserial_number
andid
are specified.I rolled custom validation in this func b/c: https://github.com/hashicorp/terraform-plugin-sdk/issues/644
Added three simple test cases covering the new custom validation, jamf/resource_jamf_staticComputerGroup_test.go
Fixed one simple bug in
make testacc
- incorrect gofmtcheck.sh pathFixed two simple bugs in jamf/resource_jamf_computer_extension_attribute_test.go and jamf/data_source_jamf_computer_extension_attribute.go:
data_type = "string"
->"String"
;recon_display
missing from schemata.There are two other bugs in jamf/resource_jamf_computer_extension_attribute_test.go, though I may just be holding it wrong. On the first run, this occurs:
I'm not sure how to fix this yet. If its not just my mistake, lmk, I'll open an issue.
On a subsequent run, the test fails because the prior test did succeed in creating an extension attribute - but didn't destroy it. Jamf API returns a duplicate name error: