1
0
mirror of https://github.com/ardichoke/puppet-arpwatch.git synced 2026-05-11 02:15:37 -04:00

Convert to pdk module

This commit is contained in:
Ryan DeShone
2020-09-24 14:50:38 -04:00
parent 2284b701e9
commit 93243c7912
21 changed files with 665 additions and 103 deletions

View File

@@ -0,0 +1,15 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'arpwatch' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }
it { is_expected.to compile }
it { is_expected.to contain_package('arpwatch') }
it { is_expected.to contain_service('arpwatch') }
end
end
end

View File

@@ -1,53 +0,0 @@
require 'spec_helper'
describe 'arpwatch', type: 'class' do
context 'On RedHat 7 with no parameters' do
let (:facts) { { osfamily: 'RedHat', operatingsystemmajrelease: '7' } }
it {
should contain_package('arpwatch').with({'ensure'=>'installed'})
should contain_file('/etc/sysconfig/arpwatch').with({'ensure'=>'file'})
should contain_service('arpwatch').with({'ensure'=>'running', 'enable'=>true})
}
end
context 'On RedHat 6 with no parameters' do
let (:facts) { { osfamily: 'RedHat', operatingsystemmajrelease: '6' } }
it {
should contain_package('arpwatch').with({'ensure'=>'installed'})
should contain_file('/etc/sysconfig/arpwatch').with({'ensure'=>'file'})
should contain_service('arpwatch').with({'ensure'=>'running', 'enable'=>true})
}
end
context 'On RedHat 5 with no parameters' do
let (:facts) { { osfamily: 'RedHat', operatingsystemmajrelease: '6' } }
it {
should contain_package('arpwatch').with({'ensure'=>'installed'})
should contain_file('/etc/sysconfig/arpwatch').with({'ensure'=>'file'})
should contain_service('arpwatch').with({'ensure'=>'running', 'enable'=>true})
}
end
context 'On Debian 6 with no parameters' do
let (:facts) { { osfamily: 'Debian', operatingsystemmajrelease: '6' }}
it {
should contain_package('arpwatch').with({'ensure'=>'installed'})
should contain_file('/etc/default/arpwatch').with({'ensure'=>'file'})
should contain_service('arpwatch').with({'ensure'=>'running', 'enable'=>true})
}
end
context 'On Debian 7 with no parameters' do
let (:facts) { { osfamily: 'Debian', operatingsystemmajrelease: '7' }}
it {
should contain_package('arpwatch').with({'ensure'=>'installed'})
should contain_file('/etc/default/arpwatch').with({'ensure'=>'file'})
should contain_service('arpwatch').with({'ensure'=>'running', 'enable'=>true})
}
end
context 'On an unknown OS' do
let :facts do
{
:osfamily => 'Darwin'
}
end
it {
expect { should raise_error(Puppet::Error) }
}
end
end