]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Separate apt::pin for apt::backports to allow pin by release instead of origin
authorRichard Connon <richard@connon.me.uk>
Sun, 14 Dec 2014 21:54:17 +0000 (21:54 +0000)
committerRichard Connon <richard@connon.me.uk>
Wed, 28 Jan 2015 12:34:18 +0000 (12:34 +0000)
Updated tests for backports

manifests/backports.pp
spec/classes/backports_spec.rb

index ee462094d4a1f037b1c0d6a090054fd58313c8c6..a3ddb76e0078339b2721498f181866220cf1f6c9 100644 (file)
@@ -66,12 +66,17 @@ class apt::backports(
     'ubuntu' => 'main universe multiverse restricted',
   }
 
+  apt::pin { 'backports':
+    before   => Apt::Source['backports'],
+    release  => "${release_real}-backports",
+    priority => $pin_priority,
+  }
+
   apt::source { 'backports':
     location   => $location,
     release    => "${release_real}-backports",
     repos      => $repos,
     key        => $key,
     key_server => 'pgp.mit.edu',
-    pin        => $pin_priority,
   }
 }
index 18f6337aefda1ca5bd1b30682011de5058f41fa2..3c1f4385612f0b09a25a6da0d40ae6d8d8f4b2ce 100644 (file)
@@ -19,7 +19,12 @@ describe 'apt::backports', :type => :class do
           'repos'      => 'main universe multiverse restricted',
           'key'        => '437D05B5',
           'key_server' => 'pgp.mit.edu',
-          'pin'        => 500,
+        })
+      }
+
+      it { should contain_apt__pin('backports').with({
+          'release'  => 'karmic-backports',
+          'priority' => 500,
         })
       }
     end
@@ -48,7 +53,12 @@ describe 'apt::backports', :type => :class do
         'repos'      => 'main universe multiverse restricted',
         'key'        => '437D05B5',
         'key_server' => 'pgp.mit.edu',
-        'pin'        => 200,
+      })
+    }
+
+    it { should contain_apt__pin('backports').with({
+        'release'  => 'karmic-backports',
+        'priority' => 200,
       })
     }
   end
@@ -69,7 +79,12 @@ describe 'apt::backports', :type => :class do
         'repos'      => 'main contrib non-free',
         'key'        => '46925553',
         'key_server' => 'pgp.mit.edu',
-        'pin'        => 200,
+      })
+    }
+
+    it { should contain_apt__pin('backports').with({
+        'release'  => 'squeeze-backports',
+        'priority' => 200,
       })
     }
   end
@@ -90,7 +105,12 @@ describe 'apt::backports', :type => :class do
         'repos'      => 'main contrib non-free',
         'key'        => '46925553',
         'key_server' => 'pgp.mit.edu',
-        'pin'        => 200,
+      })
+    }
+
+    it { should contain_apt__pin('backports').with({
+        'release'  => 'wheezy-backports',
+        'priority' => 200,
       })
     }
   end
@@ -111,7 +131,12 @@ describe 'apt::backports', :type => :class do
         'repos'      => 'main universe multiverse restricted',
         'key'        => '437D05B5',
         'key_server' => 'pgp.mit.edu',
-        'pin'        => 200,
+      })
+    }
+
+    it { should contain_apt__pin('backports').with({
+        'release'  => 'trusty-backports',
+        'priority' => 200,
       })
     }
   end
@@ -140,7 +165,12 @@ describe 'apt::backports', :type => :class do
         'repos'      => 'main contrib non-free',
         'key'        => '46925553',
         'key_server' => 'pgp.mit.edu',
-        'pin'        => 200,
+      })
+    }
+
+    it { should contain_apt__pin('backports').with({
+        'release'  => 'squeeze-backports',
+        'priority' => 200,
       })
     }
   end