vmware-archive / wardroom

A tool for creating Kubernetes-ready base operating system images.
Apache License 2.0
161 stars 44 forks source link

Add image testing #122

Open randomvariable opened 5 years ago

randomvariable commented 5 years ago

https://github.com/kubernetes-sigs/cluster-api-provider-aws/pull/538 adds image testing using goss. Might be worth porting to wardroom

scottslowe commented 5 years ago

@randomvariable I did some initial testing with goss. I came up with the following tests (for a 1.11.7 image):

package:
  docker-ce:
    installed: true
    versions:
    - 18.06.3~ce~3-0~ubuntu
  kubeadm:
    installed: true
    versions:
    - 1.11.7-00
  kubectl:
    installed: true
    versions:
    - 1.11.7-00
  kubelet:
    installed: true
    versions:
    - 1.11.7-00
mount:
  swap:
    exists: false

Did you have any other tests/conditions in mind to test the images?

randomvariable commented 5 years ago

Think that's a sufficient start for now. We can build it up incrementally.

detiber commented 5 years ago

@scottslowe one potential issue with this is that since the versions are set using Ansible variables, this would cause failures if the versions are overridden. Ansible itself should also error out if the version installed does not match the version requested.

scottslowe commented 5 years ago

@detiber You are correct, of course. I posted the list of tests above more for an idea of what other sorts of tests we should consider. In my testing, I've already moved to a templated goss config file that pulls the Kubernetes and Docker versions from variables files. I hope to have a PR ready soon for review (initial testing looks pretty good).