aboutsummaryrefslogtreecommitdiff
path: root/spec/defines/tftp_file_spec.rb
diff options
context:
space:
mode:
authorNan Liu <nan.liu@gmail.com>2012-07-11 16:21:46 -0700
committerNan Liu <nan.liu@gmail.com>2012-07-11 16:21:46 -0700
commit3795cdabd43e909702f433d0be3886626f97e802 (patch)
tree3fa7d7aef4652079754c55f1ac9c73074a9eba7e /spec/defines/tftp_file_spec.rb
parentf8f6723253b8c34577e8eeb0b5bd2364b24dca4a (diff)
parent07062af1a236646970906d4a3f98f1646fcca44d (diff)
downloadpuppet-tftp-3795cdabd43e909702f433d0be3886626f97e802.tar.gz
puppet-tftp-3795cdabd43e909702f433d0be3886626f97e802.tar.bz2
Merge pull request #11 from crayfishx/master
(#15462) Redhat/CentOS support and replacement of inetd with xinetd.
Diffstat (limited to 'spec/defines/tftp_file_spec.rb')
-rw-r--r--spec/defines/tftp_file_spec.rb153
1 files changed, 88 insertions, 65 deletions
diff --git a/spec/defines/tftp_file_spec.rb b/spec/defines/tftp_file_spec.rb
index 0de1b6f..e24f0f3 100644
--- a/spec/defines/tftp_file_spec.rb
+++ b/spec/defines/tftp_file_spec.rb
@@ -6,30 +6,36 @@ describe 'tftp::file' do
describe 'when deploying on debian' do
let(:facts) { { :operatingsystem => 'Debian',
+ :osfamily => 'Debian',
:path => '/usr/local/bin:/usr/bin:/bin', } }
- it { should include_class('tftp') }
- it { should contain_file('/srv/tftp/sample').with({
- 'ensure' => 'file',
- 'owner' => 'tftp',
- 'group' => 'tftp',
- 'mode' => '0644',
- 'recurse' => false,
- }) }
+ it {
+ should include_class('tftp')
+ should contain_file('/srv/tftp/sample').with({
+ 'ensure' => 'file',
+ 'owner' => 'tftp',
+ 'group' => 'tftp',
+ 'mode' => '0644',
+ 'recurse' => false,
+ })
+ }
end
describe 'when deploying on ubuntu' do
let(:facts) { { :operatingsystem => 'ubuntu',
+ :osfamily => 'Debian',
:path => '/usr/local/bin:/usr/bin:/bin', } }
- it { should include_class('tftp') }
- it { should contain_file('/var/lib/tftpboot/sample').with({
- 'ensure' => 'file',
- 'owner' => 'tftp',
- 'group' => 'tftp',
- 'mode' => '0644',
- 'recurse' => false,
- }) }
+ it {
+ should include_class('tftp')
+ should contain_file('/var/lib/tftpboot/sample').with({
+ 'ensure' => 'file',
+ 'owner' => 'tftp',
+ 'group' => 'tftp',
+ 'mode' => '0644',
+ 'recurse' => false,
+ })
+ }
end
describe 'when deploying with parameters' do
@@ -39,30 +45,36 @@ describe 'tftp::file' do
:mode => '0755',
:recurse => true }}
let(:facts) { { :operatingsystem => 'Debian',
+ :osfamily => 'Debian',
:path => '/usr/local/bin:/usr/bin:/bin', } }
- it { should include_class('tftp') }
- it { should contain_file('/srv/tftp/sample').with({
- 'ensure' => 'directory',
- 'owner' => 'root',
- 'group' => 'root',
- 'mode' => '0755',
- 'recurse' => true,
- }) }
+ it {
+ should include_class('tftp')
+ should contain_file('/srv/tftp/sample').with({
+ 'ensure' => 'directory',
+ 'owner' => 'root',
+ 'group' => 'root',
+ 'mode' => '0755',
+ 'recurse' => true,
+ })
+ }
end
describe 'when deploying without recurse parameters' do
let(:facts) { {:operatingsystem => 'Debian',
+ :osfamily => 'Debian',
:path => '/usr/local/bin:/usr/bin:/bin', } }
- it { should include_class('tftp') }
- it { should contain_file('/srv/tftp/sample').with({
- 'ensure' => 'file',
- 'recurse' => false,
- 'purge' => nil,
- 'replace' => nil,
- 'recurselimit' => nil,
- }) }
+ it {
+ should include_class('tftp')
+ should contain_file('/srv/tftp/sample').with({
+ 'ensure' => 'file',
+ 'recurse' => false,
+ 'purge' => nil,
+ 'replace' => nil,
+ 'recurselimit' => nil,
+ })
+ }
end
describe 'when deploying with recurse parameters' do
@@ -73,49 +85,57 @@ describe 'tftp::file' do
:purge => true,
:replace => false }}
let(:facts) { {:operatingsystem => 'Debian',
+ :osfamily => 'Debian',
:path => '/usr/local/bin:/usr/bin:/bin', }}
- it { should include_class('tftp') }
- it { should contain_file('/srv/tftp/sample').with({
- 'ensure' => 'directory',
- 'owner' => 'tftp',
- 'group' => 'tftp',
- 'mode' => '0755',
- 'recurse' => true,
- 'recurselimit' => 42,
- 'purge' => true,
- 'replace' => false,
- }) }
+ it {
+ should include_class('tftp')
+ should contain_file('/srv/tftp/sample').with({
+ 'ensure' => 'directory',
+ 'owner' => 'tftp',
+ 'group' => 'tftp',
+ 'mode' => '0755',
+ 'recurse' => true,
+ 'recurselimit' => 42,
+ 'purge' => true,
+ 'replace' => false,
+ })
+ }
end
describe 'when deploying directory' do
let(:params) { {:ensure => 'directory',
:mode => '0755' }}
let(:facts) { { :operatingsystem => 'Debian',
+ :osfamily => 'Debian',
:caller_module_name => 'acme',
:path => '/usr/local/bin:/usr/bin:/bin', } }
- it { should include_class('tftp') }
- it { should contain_file('/srv/tftp/sample').with({
- 'ensure' => 'directory',
- 'mode' => '0755',
- 'source' => nil,
- }) }
+ it {
+ should include_class('tftp')
+ should contain_file('/srv/tftp/sample').with({
+ 'ensure' => 'directory',
+ 'mode' => '0755',
+ 'source' => nil,
+ })
+ }
end
- describe 'when deploying file from another module' do
+ describe 'when deploying file' do
let(:params) { {:ensure => 'file',
:mode => '0755' }}
let(:facts) { { :operatingsystem => 'Debian',
- :caller_module_name => 'acme',
+ :osfamily => 'Debian',
:path => '/usr/local/bin:/usr/bin:/bin', } }
- it { should include_class('tftp') }
- it { should contain_file('/srv/tftp/sample').with({
- 'ensure' => 'file',
- 'mode' => '0755',
- 'source' => 'puppet:///modules/acme/sample'
- }) }
+ it {
+ should include_class('tftp')
+ should contain_file('/srv/tftp/sample').with({
+ 'ensure' => 'file',
+ 'mode' => '0755',
+ 'source' => 'puppet:///modules/tftp/sample'
+ })
+ }
end
describe 'when deploying file with content' do
@@ -123,15 +143,18 @@ describe 'tftp::file' do
:content => 'hi',
:mode => '0755' }}
let(:facts) { { :operatingsystem => 'Debian',
+ :osfamily => 'Debian',
:caller_module_name => 'acme',
:path => '/usr/local/bin:/usr/bin:/bin', } }
-
- it { should include_class('tftp') }
- it { should contain_file('/srv/tftp/sample').with({
- 'ensure' => 'file',
- 'mode' => '0755',
- 'content' => 'hi',
- 'source' => nil,
- }) }
+ it {
+ should include_class('tftp')
+ should contain_file('/srv/tftp/sample').with({
+ 'ensure' => 'file',
+ 'mode' => '0755',
+ 'content' => 'hi',
+ 'source' => nil,
+ })
+ }
end
+
end