EGI-Federation / fedcloud-vmi-templates

Virtual Machine Image of EGI Fedcloud
Apache License 2.0
6 stars 5 forks source link

Regular Ubuntu 20.04 update #73

Closed enolfc closed 2 months ago

enolfc commented 2 months ago

Summary

Update to the image as it's expiring in 4 days


Related issue :

enolfc commented 2 months ago

Manual tests working for me, thanks!

how can we automate this?

gwarf commented 2 months ago

Manual tests working for me, thanks!

how can we automate this?

AKA @brucellino? 😇

enolfc commented 2 months ago

Manual tests working for me, thanks!

how can we automate this?

AKA @brucellino? 😇

I guess we can:

  1. upload the image to a site (which one?)
  2. start the image with terraform
  3. try to interact with the running VM - can we do this without a public IP? (this would be very helpful also for the argo probe)
  4. destroy everything
enolfc commented 2 months ago

And if we do step 0, build the image as part of the action, then this would be 🚀

brucellino commented 2 months ago

I would have typically used terratest for this - if can rely on the terraform provider, then nontrivial test cases can be written. I have a basic example https://github.com/brucellino/terraform-digitalocean-vpc/blob/main/test/vpc_test.go

We can easily test point 3 above by writing an inspec or testinfra compliance profile, and then using a Terraform provisioner during the test.

However, it's better to separate layers - test the image during image build time and test the deployment at deployment time. So we should insert the compliance profile in the packer template, and then write infrastructure tests for the deployment.

This should actually be native in Terraform > 1.7 iirc so we might not need Terratest after all.... @enolfc you want to open an issue on this and see where we can get to?