summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorkwadronaut <kwadronaut@leap.se>2018-11-07 15:43:05 +0100
committerkwadronaut <kwadronaut@leap.se>2018-11-07 15:43:05 +0100
commitd30831f7214da266ad943cf4013f0632e8b15d48 (patch)
treee04489f4d3755c91c637ac413596c172300c3aad /spec
parent4380e2eabd94d8f0df7f63c642dd46ec4783ef07 (diff)
parentb1af45d47d3e1441405a9b4b67f44f7d6008486a (diff)
Merge remote-tracking branch 'riseup/master'
Diffstat (limited to 'spec')
-rw-r--r--spec/acceptance/nodesets/default.yml19
-rw-r--r--spec/spec_helper.rb12
-rw-r--r--spec/spec_helper_acceptance.rb18
3 files changed, 49 insertions, 0 deletions
diff --git a/spec/acceptance/nodesets/default.yml b/spec/acceptance/nodesets/default.yml
new file mode 100644
index 0000000..f09ad62
--- /dev/null
+++ b/spec/acceptance/nodesets/default.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/spec_helper.rb b/spec/spec_helper.rb
new file mode 100644
index 0000000..3cca63a
--- /dev/null
+++ b/spec/spec_helper.rb
@@ -0,0 +1,12 @@
+# https://puppetlabs.com/blog/testing-modules-in-the-puppet-forge
+require 'puppetlabs_spec_helper/module_spec_helper'
+
+fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))
+
+RSpec.configure do |c|
+
+ c.manifest_dir = File.join(fixture_path, 'manifests')
+ c.module_path = File.join(fixture_path, 'modules')
+
+ c.color = true
+end
diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb
new file mode 100644
index 0000000..e6a2cd8
--- /dev/null
+++ b/spec/spec_helper_acceptance.rb
@@ -0,0 +1,18 @@
+require 'beaker-rspec'
+
+RSpec.configure do |c|
+ module_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
+ module_name = module_root.split('-').last
+
+ # Readable test descriptions
+ c.formatter = :documentation
+
+ # Configure all nodes in nodeset
+ c.before :suite do
+ # Install module and dependencies
+ puppet_module_install(:source => module_root, :module_name => module_name)
+ hosts.each do |host|
+ shell('git clone https://github.com/puppetlabs/puppetlabs-concat.git /etc/puppet/modules/concat')
+ end
+ end
+end