diff options
author | varac <varacanero@zeromail.org> | 2015-12-20 01:57:04 +0100 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2015-12-20 22:46:54 +0100 |
commit | 005f06f3dde8198fac2ca1a0206e05157e927d3c (patch) | |
tree | 9fad0dff04b1a3de4c581b10f68e8e01bc8a324f /spec/acceptance | |
parent | 185ac30062d7aa11fc39a24aa89504e5ac0db6d9 (diff) |
[tests] Use beaker+docker for acceptance tests
Beaker together with docker is a very fast way to do
acceptance testing.
This commit adds basic beaker/docker support:
- Add a debian jessie nodeset
- Test if the module applies idempotentially, so it doesn't
change resources on a second run with the same parameters.
https://github.com/puppetlabs/beaker/blob/master/docs/Docker-Support.md
Diffstat (limited to 'spec/acceptance')
-rw-r--r-- | spec/acceptance/apt_spec.rb | 21 | ||||
-rw-r--r-- | spec/acceptance/nodesets/debian-8-x86_64-docker.yml | 19 | ||||
l--------- | spec/acceptance/nodesets/default.yml | 1 |
3 files changed, 41 insertions, 0 deletions
diff --git a/spec/acceptance/apt_spec.rb b/spec/acceptance/apt_spec.rb new file mode 100644 index 0000000..a976a56 --- /dev/null +++ b/spec/acceptance/apt_spec.rb @@ -0,0 +1,21 @@ +require 'spec_helper_acceptance' + +describe 'apt class' do + + context 'default parameters' do + it 'should work idempotently with no errors' do + pp = <<-EOS + class { 'apt': } + EOS + + # Run it twice and test for idempotency + apply_manifest(pp, :catch_failures => true) + apply_manifest(pp, :catch_changes => true) + end + + describe package('apt') do + it { is_expected.to be_installed } + end + + end +end diff --git a/spec/acceptance/nodesets/debian-8-x86_64-docker.yml b/spec/acceptance/nodesets/debian-8-x86_64-docker.yml new file mode 100644 index 0000000..f09ad62 --- /dev/null +++ b/spec/acceptance/nodesets/debian-8-x86_64-docker.yml @@ -0,0 +1,19 @@ +HOSTS: + debian-8-x64: + platform: debian-8-amd64 + image: debian:8 + hypervisor: docker + docker_preserve_image: true + docker_cmd: '["/sbin/init"]' + docker_image_commands: + - 'apt-get install -y wget locales-all puppet git' + - 'rm -f /usr/sbin/policy-rc.d' + +CONFIG: + type: foss + #log_level: verbose + #log_level: debug + +ssh: + password: root + auth_methods: ["password"] diff --git a/spec/acceptance/nodesets/default.yml b/spec/acceptance/nodesets/default.yml new file mode 120000 index 0000000..b125a96 --- /dev/null +++ b/spec/acceptance/nodesets/default.yml @@ -0,0 +1 @@ +debian-8-x86_64-docker.yml
\ No newline at end of file |