aboutsummaryrefslogtreecommitdiff
path: root/spec/classes/samba__server_spec.rb
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-03-24 14:18:03 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-03-24 14:18:03 -0300
commit309d5859d9c801218075789fe068869ab49065f5 (patch)
treedc31d7e0e39b48f75475f374d5301bba10c7c64a /spec/classes/samba__server_spec.rb
parent846ed365f19187b50f9aff0c7911b533880398a7 (diff)
parenteb97a2b642499fde7afdb64dfd3e2b7e8c14eacc (diff)
downloadpuppet-samba-309d5859d9c801218075789fe068869ab49065f5.tar.gz
puppet-samba-309d5859d9c801218075789fe068869ab49065f5.tar.bz2
Merge branch 'master' of https://github.com/ajjahn/puppet-samba
Conflicts: manifests/server/service.pp
Diffstat (limited to 'spec/classes/samba__server_spec.rb')
-rw-r--r--spec/classes/samba__server_spec.rb66
1 files changed, 66 insertions, 0 deletions
diff --git a/spec/classes/samba__server_spec.rb b/spec/classes/samba__server_spec.rb
new file mode 100644
index 0000000..46c5b15
--- /dev/null
+++ b/spec/classes/samba__server_spec.rb
@@ -0,0 +1,66 @@
+require 'spec_helper'
+
+describe 'samba::server' do
+ let(:facts) {{ :osfamily => 'Debian' }}
+
+ it { should contain_class('samba::server::install') }
+ it { should contain_class('samba::server::config') }
+ it { should contain_class('samba::server::service') }
+
+ it { should contain_samba__server__option('interfaces') }
+ it { should contain_samba__server__option('bind interfaces only') }
+ it { should contain_samba__server__option('security') }
+ it { should contain_samba__server__option('server string') }
+ it { should contain_samba__server__option('unix password sync') }
+ it { should contain_samba__server__option('workgroup') }
+ it { should contain_samba__server__option('socket options') }
+ it { should contain_samba__server__option('deadtime') }
+ it { should contain_samba__server__option('keepalive') }
+ it { should contain_samba__server__option('load printers') }
+ it { should contain_samba__server__option('printing') }
+ it { should contain_samba__server__option('printcap name') }
+ it { should contain_samba__server__option('disable spoolss') }
+
+ context 'with hiera shares hash' do
+ let(:params) {{
+ 'shares' => {
+ 'testShare' => {
+ 'path' => '/path/to/some/share',
+ 'browsable' => true,
+ 'writable' => true,
+ 'guest_ok' => true,
+ 'guest_only' => true,
+ },
+ 'testShare2' => {
+ 'path' => '/some/other/path'
+ }
+ }
+ }}
+ it {
+ should contain_samba__server__share( 'testShare' ).with({
+ 'path' => '/path/to/some/share',
+ 'browsable' => true,
+ 'writable' => true,
+ 'guest_ok' => true,
+ 'guest_only' => true,
+ })
+ }
+ it { should contain_samba__server__share( 'testShare2' ).with_path('/some/other/path') }
+ end
+
+ context 'with hiera users hash' do
+ let(:params) {{
+ 'users' => {
+ 'testUser' => {
+ 'password' => 'testpass01'
+ },
+ 'testUser2' => {
+ 'password' => 'testpass02'
+ }
+ }
+ }}
+ it { should contain_samba__server__user( 'testUser' ).with_password('testpass01') }
+ it { should contain_samba__server__user( 'testUser2' ).with_password('testpass02') }
+ end
+
+end