-
Notifications
You must be signed in to change notification settings - Fork 25
Testing
David Gee edited this page Nov 26, 2021
·
1 revision
Whilst there are no test
files for the Go code, there is a test procedure for any new provider, which you should test on the right device and same software version.
It doesn't matter whether there are 100 resources in your test bed or a single one. We're testing the provider implementation here and not your .tf
file.
For each resource you require in your end-state configuration (achieved through Terraform), create a single example of a resource.
Exercise any enums (via choice-ident
) in YANG models and any choice
elements by virtual of XPath expressions.
- Run a
terraform init
- Run a
terraform plan
- Run a
terraform apply -auto-approve
- Change the local
.tf
file and run anotherterraform plan
- Run a
terraform apply -auto-approve
and check the local state reflects the remote state - Change the remote state (Junos config group contents) and run a
terraform plan
- Run a
terraform apply -auto-approve
and check the local state reflects the remote state - Delete a resouce from the
.tf
file and runterraform plan
,terraform apply -auto-approve
- Run
terraform destroy -auto-approve
and check the local state reflects the remote state
If your remote and local states mirror, then you can consider the provider to work correctly.