This work flips from onlyif to unless (mistakenly looked at the
wrong return code).
This commit is contained in:
parent
e3907061fd
commit
39cbeeb9d2
3 changed files with 4 additions and 16 deletions
|
@ -42,7 +42,7 @@ define apt::ppa(
|
|||
exec { "add-apt-repository-${name}":
|
||||
environment => $proxy_env,
|
||||
command => "/usr/bin/add-apt-repository ${options} ${name}",
|
||||
onlyif => "/usr/bin/test -s ${sources_list_d}/${sources_list_d_filename}",
|
||||
unless => "/usr/bin/test -s ${sources_list_d}/${sources_list_d_filename}",
|
||||
logoutput => 'on_failure',
|
||||
notify => Exec['apt_update'],
|
||||
require => [
|
||||
|
|
|
@ -45,7 +45,7 @@ describe 'apt::ppa', :type => :define do
|
|||
|
||||
it { should contain_exec("add-apt-repository-#{t}").with(
|
||||
'command' => "/usr/bin/add-apt-repository #{options} #{t}",
|
||||
'onlyif' => "/usr/bin/test -s /etc/apt/sources.list.d/#{filename}",
|
||||
'unless' => "/usr/bin/test -s /etc/apt/sources.list.d/#{filename}",
|
||||
'require' => ["File[/etc/apt/sources.list.d]", "Package[#{package}]"],
|
||||
'notify' => "Exec[apt_update]"
|
||||
)
|
||||
|
@ -74,7 +74,7 @@ describe 'apt::ppa', :type => :define do
|
|||
it { should contain_exec("add-apt-repository-#{title}").with(
|
||||
'environment' => [],
|
||||
'command' => "/usr/bin/add-apt-repository #{options} #{title}",
|
||||
'onlyif' => "/usr/bin/test -s /etc/apt/sources.list.d/#{filename}",
|
||||
'unless' => "/usr/bin/test -s /etc/apt/sources.list.d/#{filename}",
|
||||
'require' => ["File[/etc/apt/sources.list.d]", "Package[#{package}]"],
|
||||
'notify' => "Exec[apt_update]"
|
||||
)
|
||||
|
@ -100,7 +100,7 @@ describe 'apt::ppa', :type => :define do
|
|||
"https_proxy=http://user:pass@proxy:8080",
|
||||
],
|
||||
'command' => "/usr/bin/add-apt-repository #{options} #{title}",
|
||||
'onlyif' => "/usr/bin/test -s /etc/apt/sources.list.d/#{filename}",
|
||||
'unless' => "/usr/bin/test -s /etc/apt/sources.list.d/#{filename}",
|
||||
'require' => ["File[/etc/apt/sources.list.d]", "Package[#{package}]"],
|
||||
'notify' => "Exec[apt_update]"
|
||||
)
|
||||
|
|
|
@ -8,15 +8,3 @@ describe 'basic tests:' do
|
|||
its(:exit_code) { should be_zero }
|
||||
end
|
||||
end
|
||||
|
||||
describe 'disable selinux:' do
|
||||
context puppet_apply '
|
||||
exec { "setenforce 0":
|
||||
path => "/bin:/sbin:/usr/bin:/usr/sbin",
|
||||
onlyif => "which setenforce && getenforce | grep Enforcing",
|
||||
}
|
||||
' do
|
||||
its(:stderr) { should be_empty }
|
||||
its(:exit_code) { should_not == 1 }
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue