-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
fixtures: | ||
repositories: | ||
symlinks: | ||
samba: "#{source_dir}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
require 'spec_helper' | ||
|
||
describe 'samba::server::config', :type => :class do | ||
context "on a Debian OS" do | ||
let( :facts ) { { :osfamily => 'Debian' } } | ||
|
||
it { should contain_file('/etc/samba/smb.conf').with_owner('root') } | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require 'spec_helper' | ||
|
||
describe 'samba::server::install', :type => :class do | ||
context "on a Debian OS" do | ||
let(:facts) {{ :osfamily => 'Debian' }} | ||
it { should contain_package('samba') } | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
require 'spec_helper' | ||
|
||
describe 'samba::server::service' do | ||
context 'on a Debian os family' do | ||
let(:facts) {{ :osfamily => 'Debian' }} | ||
|
||
it { should contain_service('samba') | ||
.with_require('Class[Samba::Server::Config]') } | ||
|
||
context 'Debian' do | ||
let(:facts) {{ :osfamily => 'Debian', :operatingsystem => 'Debian' }} | ||
it { should contain_service('samba') } | ||
end | ||
|
||
context 'Ubuntu' do | ||
let(:facts) {{ :osfamily => 'Debian', :operatingsystem => 'Ubuntu' }} | ||
it { should contain_service('smbd') } | ||
end | ||
end | ||
|
||
context 'on a Redhat os family' do | ||
let(:facts) {{ :osfamily => 'Redhat' }} | ||
it { should contain_service('smb') } | ||
end | ||
|
||
context 'on a Archlinux os family' do | ||
let(:facts) {{ :osfamily => 'Archlinux' }} | ||
it { should contain_service('smbd') } | ||
end | ||
|
||
context 'on a Gentoo os family' do | ||
let(:facts) {{ :osfamily => 'Linux', :operatingsystem => 'Gentoo' }} | ||
it { should contain_service('samba') } | ||
end | ||
|
||
context 'on an unsupported OS' do | ||
let(:facts) {{ :osfamily => 'Solaris' }} | ||
it { should raise_error(/Solaris is not supported by this module./) } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
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') } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node 'testhost.example.com' { | ||
|
||
include samba::server | ||
|
||
} | ||
|
||
node default {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require 'puppetlabs_spec_helper/module_spec_helper' | ||
|
||
RSpec.configure do |c| | ||
c.before do | ||
# avoid "Only root can execute commands as other users" | ||
Puppet.features.stubs(:root? => true) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Smoketest. | ||
|
||
class {'samba::server': | ||
workgroup => 'example', | ||
server_string => "Example Samba Server", | ||
interfaces => "eth0 lo", | ||
security => 'share' | ||
} | ||
|
||
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', | ||
copy => 'some-other-share', | ||
} | ||
} |