vmware / go-vcloud-director

Golang SDK for VMware Cloud Director
Other
80 stars 79 forks source link

Amend metadata tests to be compatible with latest VCD #629

Closed adambarreiro closed 9 months ago

adambarreiro commented 9 months ago

In the latest VCD version, certain items such as vApps and VMs that are created via a vApp Template come with autogenerated metadata that needs to be considered.

In the metadata tests, there was an assert that expected a hardcoded value of 2, but this number may vary due to the reason stated above, or due to any other feature that may come in the future. In order to make the test more robust and flexible, instead of hardcoding we use a real calculated value that varies depending on the case.

This also fixes the cleanup function, that was removing all metadata, instead of respecting the already existent metadata.