travis_ub_6:
provisioner: docker
images:
- - litmusimage/ubuntu:14.04
- litmusimage/ubuntu:16.04
- litmusimage/ubuntu:18.04
- litmusimage/ubuntu:20.04
describe 'condition', condition_parameter_test: false do
context 'is set' do
pp = <<-PUPPETCODE
- if $facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['full'], '14.04') > 0 {
+ if $facts['os']['name'] == 'Ubuntu' {
firewall { '010 isblue ipv4':
ensure => 'present',
condition => '! isblue',
it 'applies' do
apply_manifest(pp)
end
- if fetch_os_name == 'ubuntu' && os[:release].to_i > 14
+ if fetch_os_name == 'ubuntu'
it 'contains the rule' do
run_shell('iptables-save') do |r|
expect(r.stdout).to match(%r{-A INPUT -i enp0s8 -p icmp -m condition ! --condition "isblue" -m comment --comment "010 isblue ipv4" -j DROP})
['Debian', 'Ubuntu'].each do |os|
context "Debian Like: operatingsystem => #{os}" do
- releases = ((os == 'Debian') ? ['8'] : ['14.04'])
+ releases = ((os == 'Debian') ? ['10'] : ['20.04'])
releases.each do |osrel|
let(:facts) do
{
context 'when iptables-persistent applicable' do
before(:each) { Facter.clear }
- let(:dpkg_cmd) { "dpkg-query -Wf '${Version}' iptables-persistent 2>/dev/null" }
+ let(:dpkg_cmd) { "dpkg-query -Wf '${Version}' netfilter-persistent 2>/dev/null" }
{
'Ubuntu' => '0.5.3ubuntu2',
}.each do |os, ver|
- os_release = '14.04'
+ os_release = '20.04'
describe "#{os} package installed" do
before(:each) do
describe 'Ubuntu package not installed' do
before(:each) do
allow(Facter.fact(:operatingsystem)).to receive(:value).and_return('Ubuntu')
- allow(Facter.fact(:operatingsystemrelease)).to receive(:value).and_return('14.04')
+ allow(Facter.fact(:operatingsystemrelease)).to receive(:value).and_return('20.04')
allow(Facter::Util::Resolution).to receive(:exec).with(dpkg_cmd)
.and_return(nil)
end