Merge pull request #237 from hunner/change_port
authorHunter Haugen <hunter@puppetlabs.com>
Fri, 21 Feb 2014 19:32:10 +0000 (11:32 -0800)
committerHunter Haugen <hunter@puppetlabs.com>
Fri, 21 Feb 2014 19:32:10 +0000 (11:32 -0800)
Port 8080 is a bad choice and bumps into puppetdb

Gemfile
manifests/params.pp
manifests/ppa.pp
spec/acceptance/apt_ppa_spec.rb
spec/acceptance/nodesets/ubuntu-server-10044-x64.yml [new file with mode: 0644]
spec/defines/ppa_spec.rb
spec/spec_helper_acceptance.rb

diff --git a/Gemfile b/Gemfile
index cd7fbc89b8b34018b9c9ac830299f7af65f9acd2..1e359d07b563e2c3d869945136c3ab01aa00b64e 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -2,6 +2,7 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org'
 
 group :development, :test do
   gem 'rake',                    :require => false
+  gem 'pry',                     :require => false
   gem 'rspec-puppet',            :require => false
   gem 'puppet-lint',             :require => false
   gem 'puppetlabs_spec_helper',  :require => false
index 955954fe89f65ea1e9e00f7aaaaf9fe5a5a610c5..51a01be91a9f07772a606a6afbc30801ccedbc34 100644 (file)
@@ -21,11 +21,17 @@ class apt::params {
     }
     'ubuntu': {
       case $::lsbdistcodename {
-        'hardy','lucid','maverick','natty','oneiric','precise': {
+        'hardy','maverick','natty','oneiric','precise': {
           $backports_location = 'http://us.archive.ubuntu.com/ubuntu'
+          $ppa_options = '-y'
+        }
+        'lucid': {
+          $backports_location = 'http://us.archive.ubuntu.com/ubuntu'
+          $ppa_options = undef
         }
         default: {
           $backports_location = 'http://old-releases.ubuntu.com/ubuntu'
+          $ppa_options = '-y'
         }
       }
     }
index caff436bdf542c7fbaa23a5752ef81feb7912158..7ec6b20375d37358a096fa7cc0765923fe78401f 100644 (file)
@@ -2,7 +2,7 @@
 
 define apt::ppa(
   $release = $::lsbdistcodename,
-  $options = '-y'
+  $options = $apt::params::ppa_options,
 ) {
   $ensure  = 'present'
   include apt::params
index 2b156bc53288138df583c5ab292b09bc6a82a644..60e6d4d4b2e605f8fc3859bdaa5b6021b31d89c2 100644 (file)
@@ -27,14 +27,13 @@ if fact('operatingsystem') == 'Ubuntu'
       end
     end
 
-    context 'readding a removed ppa.' do
+    context 'reading a removed ppa.' do
       it 'setup' do
-        shell('add-apt-repository -y ppa:raravena80/collectd5')
         # This leaves a blank file
-        shell('add-apt-repository --remove ppa:raravena80/collectd5')
+        shell('echo > /etc/apt/sources.list.d/raravena80-collectd5-$(lsb_release -c -s).list')
       end
 
-      it 'should readd it successfully' do
+      it 'should read it successfully' do
         pp = <<-EOS
         include '::apt'
         apt::ppa { 'ppa:raravena80/collectd5': }
@@ -71,30 +70,31 @@ if fact('operatingsystem') == 'Ubuntu'
       end
     end
 
-    context 'options' do
-      context '-y' do
-        it 'works without failure' do
-          pp = <<-EOS
-          include '::apt'
-          apt::ppa { 'ppa:canonical-kernel-team/ppa':
-            release => precise,
-            options => '-y',
-          }
-          EOS
-
-          shell('rm -rf /etc/apt/sources.list.d/canonical-kernel-team-ppa*', :acceptable_exit_codes => [0,1,2])
-          apply_manifest(pp, :catch_failures => true)
-        end
-
-        describe file('/etc/apt/sources.list.d/canonical-kernel-team-ppa-precise.list') do
-          it { should be_file }
+    if ! default[:platform].match(/10\.04/)
+      context 'options' do
+        context '-y' do
+          it 'works without failure' do
+            pp = <<-EOS
+            include '::apt'
+            apt::ppa { 'ppa:canonical-kernel-team/ppa':
+              release => precise,
+              options => '-y',
+            }
+            EOS
+
+            shell('rm -rf /etc/apt/sources.list.d/canonical-kernel-team-ppa*', :acceptable_exit_codes => [0,1,2])
+            apply_manifest(pp, :catch_failures => true)
+          end
+
+          describe file('/etc/apt/sources.list.d/canonical-kernel-team-ppa-precise.list') do
+            it { should be_file }
+          end
         end
       end
-    end
 
-    context 'reset' do
-      it { shell('rm -rf /etc/apt/sources.list.d/canonical-kernel-team-ppa*', :acceptable_exit_codes => [0,1,2]) }
+      context 'reset' do
+        it { shell('rm -rf /etc/apt/sources.list.d/canonical-kernel-team-ppa*', :acceptable_exit_codes => [0,1,2]) }
+      end
     end
-
   end
 end
diff --git a/spec/acceptance/nodesets/ubuntu-server-10044-x64.yml b/spec/acceptance/nodesets/ubuntu-server-10044-x64.yml
new file mode 100644 (file)
index 0000000..c1b8bdf
--- /dev/null
@@ -0,0 +1,11 @@
+HOSTS:
+  ubuntu-server-10044-x64:
+    roles:
+      - master
+    platform: ubuntu-10.04-amd64
+    box : ubuntu-server-10044-x64-vbox4210-nocm
+    box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-10044-x64-vbox4210-nocm.box
+    hypervisor : vagrant
+CONFIG:
+  log_level: debug
+  type: git
index dc1173b8970c3c88fc6cd8c01709c10dd6b5c917..6a571a81fbf858217cc0e8ab0c90cc18e7846fc4 100644 (file)
@@ -1,20 +1,28 @@
 require 'spec_helper'
 describe 'apt::ppa', :type => :define do
-  [ { :lsbdistrelease => '11.04',
+  [
+    {
+      :lsbdistrelease  => '11.04',
       :lsbdistcodename => 'natty',
       :operatingsystem => 'Ubuntu',
-      :package => 'python-software-properties'},
-    { :lsbdistrelease => '12.10',
+      :lsbdistid       => 'Ubuntu',
+      :package         => 'python-software-properties'
+    },
+    {
+      :lsbdistrelease  => '12.10',
       :lsbdistcodename => 'quantal',
       :operatingsystem => 'Ubuntu',
-      :package => 'software-properties-common'},
+      :lsbdistid       => 'Ubuntu',
+      :package         => 'software-properties-common'
+    },
   ].each do |platform|
     context "on #{platform[:lsbdistcodename]}" do
       let :facts do
         {
-          :lsbdistrelease => platform[:lsbdistrelease],
+          :lsbdistrelease  => platform[:lsbdistrelease],
           :lsbdistcodename => platform[:lsbdistcodename],
           :operatingsystem => platform[:operatingsystem],
+          :lsbdistid       => platform[:lsbdistid],
         }
       end
       let :release do
index a4fc1bd6a2073566a17b00ed0f3f50ec4ae02bc9..37afbfc1b750cd35c3eff86884f9c2d09e8eb005 100644 (file)
@@ -1,12 +1,19 @@
 require 'beaker-rspec'
 
-hosts.each do |host|
-  # Install Puppet
-  install_package host, 'rubygems'
-  on host, 'gem install puppet --no-ri --no-rdoc'
-  on host, "mkdir -p #{host['distmoduledir']}"
+# Install Puppet
+unless ENV['RS_PROVISION'] == 'no'
+  hosts.each do |host|
+    if host.is_pe?
+      install_pe
+    else
+      install_puppet
+      on host, "mkdir -p #{host['distmoduledir']}"
+    end
+  end
 end
 
+UNSUPPORTED_PLATFORMS = ['windows','aix','solaris',/el-(4|5|6)/]
+
 RSpec.configure do |c|
   # Project root
   proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))