Curverneur commented on PR #268:
URL:
https://github.com/apache/cloudstack-terraform-provider/pull/268#issuecomment-4085078142
Hi @vishesh92, the `deleteprotection` parameter has been added to the api in
version 4.20. Testing with older versions of cloudstack-simulator, e.g. 4.19.3,
just won't configure deleteprotection for instances or disks and logs:
```
WARN [c.c.a.d.ParamGenericValidationWorker] (qtp2068388745-328:ctx-e860b95a
ctx-604302c4 ctx-94a7892a) (logid:8565d729) Received unknown parameters for
command updateVirtualMachine. Unknown parameters : deleteprotection
```
</br>
Well, using `ExpectError` might not be the best approach as indicated in
`testing.go`. Do you have any other ideas? How could I properly test this
feature and ensure the test is successful? Had the idea to check the api
version and skip the check if the version is older than 4.20, but still not
sure where I could get it from.
```
// ExpectError allows the construction of test cases that we expect to
fail
// with an error. The specified regexp must match against the error for
the
// test to pass.
//
// This functionality is only intended for provider-controlled error
// messaging. While in certain scenarios this can also catch testing
logic
// error messages, those messages are not protected by compatibility
// promises.
ExpectError *regexp.Regexp
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]