aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAdam Jahn <ajjahn@gmail.com>2015-12-07 16:16:58 -0500
committerAdam Jahn <ajjahn@gmail.com>2015-12-07 16:16:58 -0500
commit91ae01bd358ea0696a865c88207e61daafe7cd8a (patch)
tree70bb4d70c6a500bf4d4854d58188627e29ece213 /spec
parentced334fafff20b8eee8674376d19904b2ddeefed (diff)
downloadpuppet-samba-91ae01bd358ea0696a865c88207e61daafe7cd8a.tar.gz
puppet-samba-91ae01bd358ea0696a865c88207e61daafe7cd8a.tar.bz2
implement acceptance tests
Diffstat (limited to 'spec')
-rw-r--r--spec/acceptance/basic_samba_spec.rb35
-rw-r--r--spec/acceptance/nodesets/centos-66-x64.yml12
-rw-r--r--spec/acceptance/nodesets/centos-70-x64.yml12
-rw-r--r--spec/acceptance/nodesets/debian-78-x64.yml12
-rw-r--r--spec/acceptance/nodesets/ubuntu-server-1204-x86.yml13
-rw-r--r--spec/acceptance/nodesets/ubuntu-server-1404-x64.yml13
-rw-r--r--spec/spec_helper_acceptance.rb29
7 files changed, 126 insertions, 0 deletions
diff --git a/spec/acceptance/basic_samba_spec.rb b/spec/acceptance/basic_samba_spec.rb
new file mode 100644
index 0000000..0dd6ac6
--- /dev/null
+++ b/spec/acceptance/basic_samba_spec.rb
@@ -0,0 +1,35 @@
+require 'spec_helper_acceptance'
+
+describe 'basic samba' do
+ context 'default parameters' do
+ let(:pp) {"
+ class { 'samba::server':
+ workgroup => 'example',
+ server_string => 'Example Samba Server'
+ }
+
+ samba::server::share {'example-share':
+ comment => 'Example Share',
+ path => '/path/to/share',
+ guest_only => true,
+ guest_ok => true,
+ guest_account => 'guest',
+ browsable => false,
+ create_mask => 0777,
+ force_create_mask => 0777,
+ directory_mask => 0777,
+ force_directory_mask => 0777,
+ force_group => 'group',
+ force_user => 'user',
+ }
+ "}
+
+ it 'should apply with no errors' do
+ apply_manifest(pp, :catch_failures=>true)
+ end
+
+ it 'should be idempotent' do
+ apply_manifest(pp, :catch_changes=>true)
+ end
+ end
+end
diff --git a/spec/acceptance/nodesets/centos-66-x64.yml b/spec/acceptance/nodesets/centos-66-x64.yml
new file mode 100644
index 0000000..1fffff6
--- /dev/null
+++ b/spec/acceptance/nodesets/centos-66-x64.yml
@@ -0,0 +1,12 @@
+HOSTS:
+ centos-66-x64:
+ roles:
+ - master
+ platform: el-6-x86_64
+ box: puppetlabs/centos-6.6-64-nocm
+ box_url: https://vagrantcloud.com/puppetlabs/boxes/centos-6.6-64-nocm
+ hypervisor: vagrant
+CONFIG:
+ log_level: verbose
+ type: foss
+ color: false
diff --git a/spec/acceptance/nodesets/centos-70-x64.yml b/spec/acceptance/nodesets/centos-70-x64.yml
new file mode 100644
index 0000000..845e47e
--- /dev/null
+++ b/spec/acceptance/nodesets/centos-70-x64.yml
@@ -0,0 +1,12 @@
+HOSTS:
+ centos-70-x64:
+ roles:
+ - master
+ platform: el-7-x86_64
+ box: puppetlabs/centos-7.0-64-nocm
+ box_url: https://vagrantcloud.com/puppetlabs/boxes/centos-7.0-64-nocm
+ hypervisor : vagrant
+CONFIG:
+ log_level: verbose
+ type: foss
+ color: false
diff --git a/spec/acceptance/nodesets/debian-78-x64.yml b/spec/acceptance/nodesets/debian-78-x64.yml
new file mode 100644
index 0000000..c4062fd
--- /dev/null
+++ b/spec/acceptance/nodesets/debian-78-x64.yml
@@ -0,0 +1,12 @@
+HOSTS:
+ debian-78-x64:
+ roles:
+ - master
+ platform: debian-7-amd64
+ box: puppetlabs/debian-7.8-64-nocm
+ box_url: https://vagrantcloud.com/puppetlabs/boxes/debian-7.8-64-nocm
+ hypervisor: vagrant
+
+CONFIG:
+ log_level: verbose
+ type: foss
diff --git a/spec/acceptance/nodesets/ubuntu-server-1204-x86.yml b/spec/acceptance/nodesets/ubuntu-server-1204-x86.yml
new file mode 100644
index 0000000..c2e8657
--- /dev/null
+++ b/spec/acceptance/nodesets/ubuntu-server-1204-x86.yml
@@ -0,0 +1,13 @@
+HOSTS:
+ ubuntu-server-1204-x64:
+ roles:
+ - master
+ platform: ubuntu-1204-amd64
+ box: puppetlabs/ubuntu-12.04-64-nocm
+ box_url: https://vagrantcloud.com/puppetlabs/boxes/ubuntu-12.04-64-nocm
+ hypervisor: vagrant
+
+CONFIG:
+ log_level: verbose
+ type: foss
+ color: false
diff --git a/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml b/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml
new file mode 100644
index 0000000..2fcee43
--- /dev/null
+++ b/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml
@@ -0,0 +1,13 @@
+HOSTS:
+ ubuntu-server-1404-x64:
+ roles:
+ - master
+ platform: ubuntu-server-14.04-amd64
+ box: puppetlabs/ubuntu-14.04-64-nocm
+ box_url: https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm
+ hypervisor: vagrant
+
+CONFIG:
+ log_level: verbose
+ type: foss
+ color: false
diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb
new file mode 100644
index 0000000..74187d8
--- /dev/null
+++ b/spec/spec_helper_acceptance.rb
@@ -0,0 +1,29 @@
+require 'beaker-rspec/spec_helper'
+require 'beaker-rspec/helpers/serverspec'
+require 'pry'
+
+unless ENV['BEAKER_provision'] == 'no'
+ hosts.each do |host|
+ # Install Puppet
+ if host.is_pe?
+ install_pe
+ else
+ install_puppet
+ end
+ end
+end
+
+RSpec.configure do |c|
+ # Project root
+ proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
+
+ # Readable test descriptions
+ c.formatter = :documentation
+
+ # Configure all nodes in nodeset
+ c.before :suite do
+ # Install module and dependencies
+ puppet_module_install(:source => proj_root, :module_name => 'samba')
+ end
+end
+