We don't really do module level testing.
We manually do end-to-end testing. I guess its been 'good enough' so far...although tedious.
Anyways, I thought we should chart some new territory and attempt to use Beaker to some degree.
Beaker Wiki: link
Anyways...turns out they support Docker.
I thought, yay, finally an excuse to play with Docker a bit.
Turns out it was a pain in the ass to setup though.
- Get the Ubuntu 14 vagrant box:
https://atlas.hashicorp.com/ubuntu/boxes/trusty64
- SSH into that box
- Install Beaker on that box
https://github.com/puppetlabs/beaker/wiki/Beaker-Installation#installing-beaker
- Install Docker on that box
https://docs.docker.com/installation/ubuntulinux/
- Create a 'beaker hosts config file' on that box
example file: "beaker_hosts.cfg"HOSTS:
ubuntu-
12
-
10
:
platform: ubuntu-
12.10
-x64
image: modified_ubuntu
hypervisor: docker
CONFIG:
type: foss
- Do a simple 'docker run' to get docker to download the Ubuntu Container Image:
sudo docker run ubuntu:12.10 /bin/echo 'shit'
- Modify the Ubuntu Container Image by installing 'ssh' onto it:
sudo docker run ubuntu:12.10 apt-get install -y ssh
- Find the 'container id' after the previous step finishes.
sudo docker ps -l
- Commit the changes to the container
sudo docker commit someFriggingUglyContainerId modified_ubuntu
- Confirm that 'ssh' is installed:
a) open an interactive session with the new container thingy:
sudo docker run -i -t modified_ubuntu /bin/bash
b) start the 'ssh' service on the new container thingy:
service ssh start
c) quit the new container thingy:
exit
- Run beaker on the VM !!
sudo beaker --log-level debug --hosts beaker_hosts.cfg - Happy Dance.
The following images MAY have differently named files/settings... so just use your brain:
No comments:
Post a Comment