Merge pull request #208 from apenney/ppa-debian
Ensure apt::ppa fails on non-Ubuntu.
This commit is contained in:
commit
1ce7dbb4c3
3 changed files with 10 additions and 3 deletions
1
Rakefile
1
Rakefile
|
@ -1,2 +1 @@
|
||||||
require 'puppetlabs_spec_helper/rake_tasks'
|
require 'puppetlabs_spec_helper/rake_tasks'
|
||||||
require 'rspec-system/rake_task'
|
|
||||||
|
|
|
@ -14,6 +14,10 @@ define apt::ppa(
|
||||||
fail('lsbdistcodename fact not available: release parameter required')
|
fail('lsbdistcodename fact not available: release parameter required')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $::operatingsystem != 'Ubuntu' {
|
||||||
|
fail("apt::ppa is currently supported on Ubuntu only.")
|
||||||
|
}
|
||||||
|
|
||||||
$filename_without_slashes = regsubst($name, '/', '-', 'G')
|
$filename_without_slashes = regsubst($name, '/', '-', 'G')
|
||||||
$filename_without_dots = regsubst($filename_without_slashes, '\.', '_', 'G')
|
$filename_without_dots = regsubst($filename_without_slashes, '\.', '_', 'G')
|
||||||
$filename_without_ppa = regsubst($filename_without_dots, '^ppa:', '', 'G')
|
$filename_without_ppa = regsubst($filename_without_dots, '^ppa:', '', 'G')
|
||||||
|
|
|
@ -2,9 +2,11 @@ require 'spec_helper'
|
||||||
describe 'apt::ppa', :type => :define do
|
describe 'apt::ppa', :type => :define do
|
||||||
[ { :lsbdistrelease => '11.04',
|
[ { :lsbdistrelease => '11.04',
|
||||||
:lsbdistcodename => 'natty',
|
:lsbdistcodename => 'natty',
|
||||||
|
:operatingsystem => 'Ubuntu',
|
||||||
:package => 'python-software-properties'},
|
:package => 'python-software-properties'},
|
||||||
{ :lsbdistrelease => '12.10',
|
{ :lsbdistrelease => '12.10',
|
||||||
:lsbdistcodename => 'quantal',
|
:lsbdistcodename => 'quantal',
|
||||||
|
:operatingsystem => 'Ubuntu',
|
||||||
:package => 'software-properties-common'},
|
:package => 'software-properties-common'},
|
||||||
].each do |platform|
|
].each do |platform|
|
||||||
context "on #{platform[:lsbdistcodename]}" do
|
context "on #{platform[:lsbdistcodename]}" do
|
||||||
|
@ -12,6 +14,7 @@ describe 'apt::ppa', :type => :define do
|
||||||
{
|
{
|
||||||
:lsbdistrelease => platform[:lsbdistrelease],
|
:lsbdistrelease => platform[:lsbdistrelease],
|
||||||
:lsbdistcodename => platform[:lsbdistcodename],
|
:lsbdistcodename => platform[:lsbdistcodename],
|
||||||
|
:operatingsystem => platform[:operatingsystem],
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
let :release do
|
let :release do
|
||||||
|
@ -109,7 +112,7 @@ describe 'apt::ppa', :type => :define do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
[ { :lsbdistcodename => 'natty',
|
[ { :lsbdistcodename => 'natty',
|
||||||
:package => 'python-software-properties' },
|
:package => 'python-software-properties' },
|
||||||
{ :lsbdistcodename => 'quantal',
|
{ :lsbdistcodename => 'quantal',
|
||||||
:package => 'software-properties-common'},
|
:package => 'software-properties-common'},
|
||||||
|
@ -121,7 +124,8 @@ describe 'apt::ppa', :type => :define do
|
||||||
'package { "#{platform[:package]}": }->Apt::Ppa["ppa"]'
|
'package { "#{platform[:package]}": }->Apt::Ppa["ppa"]'
|
||||||
end
|
end
|
||||||
let :facts do
|
let :facts do
|
||||||
{:lsbdistcodename => '#{platform[:lsbdistcodename]}'}
|
{:lsbdistcodename => '#{platform[:lsbdistcodename]}',
|
||||||
|
:operatingsystem => 'Ubuntu'}
|
||||||
end
|
end
|
||||||
let(:title) { "ppa" }
|
let(:title) { "ppa" }
|
||||||
let(:release) { "#{platform[:lsbdistcodename]}" }
|
let(:release) { "#{platform[:lsbdistcodename]}" }
|
||||||
|
|
Loading…
Reference in a new issue