EGI-Federation / fedcloud-vmi-templates

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

Automatic testing of VMIs #93

Open sebastian-luna-valero opened 2 weeks ago

sebastian-luna-valero commented 2 weeks ago

As discussed recently it would be nice to have an automatic way to test the VMIs built on this repository.

@enolfc proposed this initial plan:

  1. Build the image as part of the action. This has been recently added in https://github.com/EGI-Federation/fedcloud-vmi-templates/pull/76 and later improved in https://github.com/EGI-Federation/fedcloud-vmi-templates/pull/79 and https://github.com/EGI-Federation/fedcloud-vmi-templates/pull/80
  2. Upload the image to a site. We are building images in SCAI, should we also use the same site for testing? (image uploads are enabled in SCAI)
  3. Start the image with terraform
  4. Interact with the running VM; what tests would be relevant? can we do this without a public IP? (this would be very helpful also for the argo probe)
  5. Destroy everything

Am I missing something?

sebastian-luna-valero commented 2 weeks ago

For the record, @brucellino also added:

I would have typically used terratest for this - if can rely on the terraform provider, then nontrivial test cases can be written. We can easily test point 3 above by writing an inspec or testinfra compliance profile, and then using a Terraform provisioner during the test.

sebastian-luna-valero commented 1 week ago

Update regarding terratest

I am looking at https://terratest.gruntwork.io/ and the first requirement is that one needs to know Go to write tests.

I don't know about you guys, but at the moment that's a no-go for me? Pun intended :)