End to end testing can be improved in terms of assurance that the VM was created according to specifications in the following ways:
- Verify that the DNS name actually points to the created VM by attempting to ssh into the machine and read back some information that confirms it's the machine we just created (e.g. perhaps the output from
hostname works for this).
- Verify that the ssh key configured correctly (the above test implicitly also checks this, but it might be useful to detect the use of an incorrect ssh key fails with a key error in order to confirm).
- Verify that cloud-init does in fact run the specified script. This could be done by having a test machine configuration that specifies a script that does something simple such as create a file with a known file name. The test can then log in and look for the file as confirmation.
- Since all the above tests involve ssh into the machine, they could be optimized with one ssh session that checks multiple things are as they should be.
End to end testing can be improved in terms of assurance that the VM was created according to specifications in the following ways:
hostnameworks for this).