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.
[x] 10.5.0 go test -tags metadata -check.vv -timeout 0
[x] 10.5.1 go test -tags metadata -check.vv -timeout 0
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.
go test -tags metadata -check.vv -timeout 0
go test -tags metadata -check.vv -timeout 0