Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Remove Class for Swap file #23

Merged
merged 10 commits into from
Jul 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source 'http://rubygems.org'

group :test do
gem 'rake'
gem 'puppet', ENV['PUPPET_VERSION'] || '~> 3.4.0'
gem 'puppet', ENV['PUPPET_VERSION'] || '~> 3.8.0'
gem 'puppet-lint'
gem 'rspec-puppet', :git => 'https://github.com/rodjek/rspec-puppet.git'
gem 'puppet-syntax'
Expand Down
12 changes: 7 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,10 @@ GEM
coderay (~> 1.0)
method_source (~> 0.8)
slop (~> 3.4)
puppet (3.4.3)
facter (~> 1.6)
puppet (3.8.1)
facter (> 1.6, < 3)
hiera (~> 1.0)
rgen (~> 0.6.5)
json_pure
puppet-blacksmith (3.2.0)
puppet (>= 2.7.16)
rest-client
Expand Down Expand Up @@ -256,7 +256,6 @@ GEM
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
retriable (1.4.1)
rgen (0.6.6)
rspec (3.2.0)
rspec-core (~> 3.2.0)
rspec-expectations (~> 3.2.0)
Expand Down Expand Up @@ -332,7 +331,7 @@ DEPENDENCIES
beaker-rspec
guard-rake
metadata-json-lint
puppet (~> 3.4.0)
puppet (~> 3.8.0)
puppet-blacksmith
puppet-lint
puppet-module
Expand All @@ -343,3 +342,6 @@ DEPENDENCIES
simplecov
travis
travis-lint

BUNDLED WITH
1.10.5
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class { 'swap_file':

However, this had many problems, such as not being able to declare more than one swap_file because of duplicate class errors.

This is now deprecated and will give a warning.
This is now removed from 2.x.x onwards.

##Limitations

Expand Down
68 changes: 0 additions & 68 deletions manifests/init.pp

This file was deleted.

24 changes: 0 additions & 24 deletions manifests/params.pp

This file was deleted.

2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"requirements": [
{
"name": "pe",
"version_requirement": ">= 3.2.0 < 3.4.0"
"version_requirement": ">= 3.2.0"
},
{
"name": "puppet",
Expand Down
45 changes: 0 additions & 45 deletions spec/acceptance/class_spec.rb

This file was deleted.

31 changes: 31 additions & 0 deletions spec/acceptance/swap_file_files_multiple_spec.rb
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
35 changes: 35 additions & 0 deletions spec/acceptance/swap_file_files_parameters_spec.rb
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
111 changes: 0 additions & 111 deletions spec/classes/swap_file_spec.rb

This file was deleted.

Loading