]> gitweb.fluxo.info Git - puppet-samba.git/commitdiff
implement acceptance tests
authorAdam Jahn <ajjahn@gmail.com>
Mon, 7 Dec 2015 21:16:58 +0000 (16:16 -0500)
committerAdam Jahn <ajjahn@gmail.com>
Mon, 7 Dec 2015 21:16:58 +0000 (16:16 -0500)
Rakefile
spec/acceptance/basic_samba_spec.rb [new file with mode: 0644]
spec/acceptance/nodesets/centos-66-x64.yml [new file with mode: 0644]
spec/acceptance/nodesets/centos-70-x64.yml [new file with mode: 0644]
spec/acceptance/nodesets/debian-78-x64.yml [new file with mode: 0644]
spec/acceptance/nodesets/ubuntu-server-1204-x86.yml [new file with mode: 0644]
spec/acceptance/nodesets/ubuntu-server-1404-x64.yml [new file with mode: 0644]
spec/spec_helper_acceptance.rb [new file with mode: 0644]

index 69fed1b0cc4058dfea3893b42bfb28fbb802571c..908647f5701e36dd6b24573a207e60f8f13258f3 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -28,6 +28,7 @@ exclude_paths = [
 PuppetLint.configuration.ignore_paths = exclude_paths
 PuppetSyntax.exclude_paths = exclude_paths
 
+ENV['BEAKER_set'] ||= 'ubuntu-server-1204-x86'
 desc "Run acceptance tests"
 RSpec::Core::RakeTask.new(:acceptance) do |t|
   t.pattern = 'spec/acceptance'
diff --git a/spec/acceptance/basic_samba_spec.rb b/spec/acceptance/basic_samba_spec.rb
new file mode 100644 (file)
index 0000000..0dd6ac6
--- /dev/null
@@ -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 (file)
index 0000000..1fffff6
--- /dev/null
@@ -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 (file)
index 0000000..845e47e
--- /dev/null
@@ -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 (file)
index 0000000..c4062fd
--- /dev/null
@@ -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 (file)
index 0000000..c2e8657
--- /dev/null
@@ -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 (file)
index 0000000..2fcee43
--- /dev/null
@@ -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 (file)
index 0000000..74187d8
--- /dev/null
@@ -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
+