]> gitweb.fluxo.info Git - puppet-samba.git/commitdiff
added param users for use in hiera
authorJirgn Mssnr <jirgn76@googlemail.com>
Mon, 22 Feb 2016 12:47:19 +0000 (13:47 +0100)
committerJirgn Mssnr <jirgn76@googlemail.com>
Mon, 22 Feb 2016 12:47:19 +0000 (13:47 +0100)
added tests for samba::server::users

manifests/server.pp
spec/classes/samba__server_spec.rb

index 59d5d5198bec8650f8ededd9321489ec8a224fc8..cbc61a9996527d7a8a4c156084818cd143bdc7bd 100644 (file)
@@ -20,7 +20,8 @@ class samba::server($interfaces = '',
                     $os_level = '',
                     $preferred_master = '',
                     $bind_interfaces_only = 'yes',
-                    $shares = {},) {
+                    $shares = {},
+                    $users = {}, ) {
 
   include samba::server::install
   include samba::server::config
@@ -63,4 +64,5 @@ class samba::server($interfaces = '',
   }
 
   create_resources(samba::server::share, $shares)
+  create_resources(samba::server::user, $users)
 }
index d19fe6a3bf6095756f8a4b87b72f33c1c428374f..46c5b15f608e172da70217a578f975c7ad0d2d3e 100644 (file)
@@ -36,8 +36,31 @@ describe 'samba::server' do
          }
        }
     }}
-    it { should contain_samba__server__share( 'testShare' ) }
-    it { should contain_samba__server__share( 'testShare2' ) }
+    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