This repository has been archived by the owner on Apr 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from petems/remove_class_swap_files
Remove Class for Swap file
- Loading branch information
Showing
12 changed files
with
144 additions
and
257 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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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,31 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'swap_file class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do | ||
|
||
context 'multiple swap_file::files', :unless => ['FreeBSD'].include?(fact('osfamily')) do | ||
it 'should work with no errors' do | ||
pp = <<-EOS | ||
swap_file::files { 'tmp file swap 1': | ||
ensure => present, | ||
swapfile => '/tmp/swapfile1', | ||
} | ||
swap_file::files { 'tmp file swap 2': | ||
ensure => present, | ||
swapfile => '/tmp/swapfile2', | ||
} | ||
EOS | ||
|
||
apply_manifest(pp, :catch_failures => true) | ||
apply_manifest(pp, :catch_changes => true) | ||
end | ||
it 'should contain the given swapfile' do | ||
shell('/sbin/swapon -s | grep /tmp/swapfile1', :acceptable_exit_codes => [0]) | ||
shell('/sbin/swapon -s | grep /tmp/swapfile2', :acceptable_exit_codes => [0]) | ||
end | ||
it 'should contain the default fstab setting' do | ||
shell('cat /etc/fstab | grep /tmp/swapfile1', :acceptable_exit_codes => [0]) | ||
shell('cat /etc/fstab | grep /tmp/swapfile2', :acceptable_exit_codes => [0]) | ||
end | ||
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,35 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'swap_file class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do | ||
|
||
context 'swap_file' do | ||
context 'custom parameters' do | ||
it 'should work with no errors' do | ||
pp = <<-EOS | ||
swap_file::files { 'tmp file swap': | ||
ensure => present, | ||
swapfile => '/tmp/swapfile', | ||
} | ||
EOS | ||
|
||
apply_manifest(pp, :catch_failures => true) | ||
apply_manifest(pp, :catch_changes => true) | ||
end | ||
it 'should contain the given swapfile' do | ||
if ["FreeBSD"].include?(fact('osfamily')) | ||
shell('/usr/sbin/swapinfo | grep /dev/md99', :acceptable_exit_codes => [0]) | ||
else | ||
shell('/sbin/swapon -s | grep /tmp/swapfile', :acceptable_exit_codes => [0]) | ||
end | ||
end | ||
it 'should contain the given fstab setting' do | ||
shell('cat /etc/fstab | grep /tmp/swapfile', :acceptable_exit_codes => [0]) | ||
if ["FreeBSD"].include?(fact('osfamily')) | ||
shell('cat /etc/fstab | grep md99', :acceptable_exit_codes => [0]) | ||
else | ||
shell('cat /etc/fstab | grep defaults', :acceptable_exit_codes => [0]) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.