X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Fdefines%2Fppa_spec.rb;h=f95776f6ee83dfa386d4c5f379a3fea59e550814;hb=e014fc04ed8358e4f7c2e87f7434df9817a4c7bb;hp=74b52ea9c94fba1a82f69bd14de522786e2e8102;hpb=cc537070e8ee5fbecbbb8f76dc69f39dd79433cc;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/defines/ppa_spec.rb b/spec/defines/ppa_spec.rb index 74b52ea..f95776f 100644 --- a/spec/defines/ppa_spec.rb +++ b/spec/defines/ppa_spec.rb @@ -7,6 +7,7 @@ describe 'apt::ppa' do describe 'defaults' do let :facts do { + :os => { :family => 'Debian', :name => 'Ubuntu', :release => { :major => '11', :full => '11.04' }}, :lsbdistrelease => '11.04', :lsbdistcodename => 'natty', :operatingsystem => 'Ubuntu', @@ -21,7 +22,7 @@ describe 'apt::ppa' do it { is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow+type').that_notifies('Class[Apt::Update]').with({ :environment => [], :command => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow+type', - :unless => '/usr/bin/test -s /etc/apt/sources.list.d/needs-such_substitution-wow_type-natty.list', + :unless => '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow_type-natty.list', :user => 'root', :logoutput => 'on_failure', }) @@ -31,6 +32,7 @@ describe 'apt::ppa' do describe 'Ubuntu 15.10 sources.list filename' do let :facts do { + :os => { :family => 'Debian', :name => 'Ubuntu', :release => { :major => '15', :full => '15.10' }}, :lsbdistrelease => '15.10', :lsbdistcodename => 'wily', :operatingsystem => 'Ubuntu', @@ -44,7 +46,7 @@ describe 'apt::ppa' do it { is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with({ :environment => [], :command => '/usr/bin/add-apt-repository -y ppa:user/foo', - :unless => '/usr/bin/test -s /etc/apt/sources.list.d/user-ubuntu-foo-wily.list', + :unless => '/usr/bin/test -f /etc/apt/sources.list.d/user-ubuntu-foo-wily.list', :user => 'root', :logoutput => 'on_failure', }) @@ -69,6 +71,7 @@ describe 'apt::ppa' do end let :facts do { + :os => { :family => 'Debian', :name => 'Ubuntu', :release => { :major => '11', :full => '11.04' }}, :lsbdistrelease => '11.04', :lsbdistcodename => 'natty', :operatingsystem => 'Ubuntu', @@ -83,7 +86,7 @@ describe 'apt::ppa' do it { is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow').that_notifies('Class[Apt::Update]').with({ 'environment' => [], 'command' => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow', - 'unless' => '/usr/bin/test -s /etc/apt/sources.list.d/needs-such_substitution-wow-natty.list', + 'unless' => '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow-natty.list', 'user' => 'root', 'logoutput' => 'on_failure', }) @@ -104,6 +107,7 @@ describe 'apt::ppa' do end let :facts do { + :os => { :family => 'Debian', :name => 'Ubuntu', :release => { :major => '11', :full => '11.04' }}, :lsbdistrelease => '11.04', :lsbdistcodename => 'natty', :operatingsystem => 'Ubuntu', @@ -123,7 +127,7 @@ describe 'apt::ppa' do it { is_expected.to contain_exec('add-apt-repository-ppa:user/bar').that_notifies('Class[Apt::Update]').with({ 'environment' => [], 'command' => '/usr/bin/add-apt-repository -y ppa:user/bar', - 'unless' => '/usr/bin/test -s /etc/apt/sources.list.d/user-bar-natty.list', + 'unless' => '/usr/bin/test -f /etc/apt/sources.list.d/user-bar-natty.list', 'user' => 'root', 'logoutput' => 'on_failure', }) @@ -141,6 +145,7 @@ describe 'apt::ppa' do end let :facts do { + :os => { :family => 'Debian', :name => 'Ubuntu', :release => { :major => '11', :full => '11.04' }}, :lsbdistrelease => '11.04', :lsbdistcodename => 'natty', :operatingsystem => 'Ubuntu', @@ -160,7 +165,7 @@ describe 'apt::ppa' do it { is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow').that_notifies('Class[Apt::Update]').with({ 'environment' => [], 'command' => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow', - 'unless' => '/usr/bin/test -s /etc/apt/sources.list.d/needs-such_substitution-wow-natty.list', + 'unless' => '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow-natty.list', 'user' => 'root', 'logoutput' => 'on_failure', }) @@ -180,6 +185,7 @@ describe 'apt::ppa' do end let :facts do { + :os => { :family => 'Debian', :name => 'Ubuntu', :release => { :major => '14', :full => '14.04' }}, :lsbdistrelease => '14.04', :lsbdistcodename => 'trusty', :operatingsystem => 'Ubuntu', @@ -201,7 +207,7 @@ describe 'apt::ppa' do it { is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with({ :environment => [], :command => '/usr/bin/add-apt-repository ppa:user/foo', - :unless => '/usr/bin/test -s /etc/apt/sources.list.d/user-foo-trusty.list', + :unless => '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list', :user => 'root', :logoutput => 'on_failure', }) @@ -216,6 +222,7 @@ describe 'apt::ppa' do end let :facts do { + :os => { :family => 'Debian', :name => 'Ubuntu', :release => { :major => '14', :full => '14.04' }}, :lsbdistrelease => '14.04', :lsbdistcodename => 'trusty', :operatingsystem => 'Ubuntu', @@ -235,7 +242,7 @@ describe 'apt::ppa' do it { is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with({ :environment => ['http_proxy=http://localhost:8080'], :command => '/usr/bin/add-apt-repository ppa:user/foo', - :unless => '/usr/bin/test -s /etc/apt/sources.list.d/user-foo-trusty.list', + :unless => '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list', :user => 'root', :logoutput => 'on_failure', }) @@ -250,6 +257,7 @@ describe 'apt::ppa' do end let :facts do { + :os => { :family => 'Debian', :name => 'Ubuntu', :release => { :major => '14', :full => '14.04' }}, :lsbdistrelease => '14.04', :lsbdistcodename => 'trusty', :operatingsystem => 'Ubuntu', @@ -269,7 +277,7 @@ describe 'apt::ppa' do it { is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with({ :environment => ['http_proxy=http://localhost:8180'], :command => '/usr/bin/add-apt-repository ppa:user/foo', - :unless => '/usr/bin/test -s /etc/apt/sources.list.d/user-foo-trusty.list', + :unless => '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list', :user => 'root', :logoutput => 'on_failure', }) @@ -284,6 +292,7 @@ describe 'apt::ppa' do end let :facts do { + :os => { :family => 'Debian', :name => 'Ubuntu', :release => { :major => '14', :full => '14.04' }}, :lsbdistrelease => '14.04', :lsbdistcodename => 'trusty', :operatingsystem => 'Ubuntu', @@ -303,7 +312,7 @@ describe 'apt::ppa' do it { is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with({ :environment => ['http_proxy=http://localhost:8180', 'https_proxy=https://localhost:8180'], :command => '/usr/bin/add-apt-repository ppa:user/foo', - :unless => '/usr/bin/test -s /etc/apt/sources.list.d/user-foo-trusty.list', + :unless => '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list', :user => 'root', :logoutput => 'on_failure', }) @@ -316,6 +325,7 @@ describe 'apt::ppa' do end let :facts do { + :os => { :family => 'Debian', :name => 'Ubuntu', :release => { :major => '14', :full => '14.04' }}, :lsbdistrelease => '14.04', :lsbdistcodename => 'trusty', :operatingsystem => 'Ubuntu', @@ -340,6 +350,7 @@ describe 'apt::ppa' do describe 'no release' do let :facts do { + :os => { :family => 'Debian', :name => 'Ubuntu', :release => { :major => '14', :full => '14.04' }}, :lsbdistrelease => '14.04', :operatingsystem => 'Ubuntu', :lsbdistid => 'Ubuntu', @@ -359,6 +370,7 @@ describe 'apt::ppa' do describe 'not ubuntu' do let :facts do { + :os => { :family => 'Debian', :name => 'Debian', :release => { :major => '6', :full => '6.0.7' }}, :lsbdistrelease => '6.0.7', :lsbdistcodename => 'wheezy', :operatingsystem => 'Debian',