Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed ppa and pin features, added force defines to site.pp

  • Loading branch information...
commit 023c4858807dfc77b951349ef76caa1f775e0210 1 parent bfbae2f
Matthaus Owens haus authored
13 features/manifests/site.pp
View
@@ -38,3 +38,16 @@
}
}
+node "define-force" {
+ apt::force { "force-default": }
+ apt::force { "force-params":
+ release => 'stable',
+ version => '123',
+ }
+}
+
+node "define-force-fail" {
+ apt::force { "force-fail":
+ fail => "probably",
+ }
+}
28 features/modules/apt/apt_force.feature
View
@@ -0,0 +1,28 @@
+Feature: force.pp
+ In order to have effective package management
+ The apt class should be able to use force to help manage packages
+
+ Scenario: Default define of apt::force
+ Given a node named "define-force"
+ When I compile the catalog
+ Then compilation should succeed
+ And all resource dependencies should resolve
+
+ And there should be a resource "Apt::Force[force-default]"
+ And the resource should have a "release" of "testing"
+ And the resource should have "version" set to "false"
+
+ And there should be a resource "Apt::Force[force-params]"
+ And the resource should have a "release" of "stable"
+ And the resource should have a "version" of "123"
+
+ And there should be a resource "Exec[/usr/bin/aptitude -y -t testing install force-default]"
+ And the exec should have an "unless" of "/usr/bin/dpkg -l | grep force-default"
+
+ And there should be a resource "Exec[/usr/bin/aptitude -y -t stable install force-params]"
+ And the exec should have an "unless" of "/usr/bin/dpkg -l | grep force-params | grep 123"
+
+ Scenario:
+ Given a node named "define-force-fail"
+ When I compile the catalog
+ Then the compilation should fail
7 features/modules/apt/apt_pin.feature
View
@@ -11,7 +11,12 @@ Feature: pin.pp
And there should be a resource "Class[Apt::Params]"
And there should be a resource "Apt::Pin[pin-default]"
+ And the resource should have a "packages" of "*"
+ And the resource should have a "priority" of "0"
+
And there should be a resource "Apt::Pin[pin-with-params]"
+ And the resource should have a "packages" of "mysql"
+ And the resource should have a "priority" of "788"
And there should be a resource "File[pin-default.pref]"
And the file should have an "owner" of "root"
@@ -19,7 +24,6 @@ Feature: pin.pp
And the file should have a "mode" of "644"
And the file should have an "ensure" of "file"
And the file should have a "name" of "/etc/apt/preferences.d/pin-default"
- And the file should have a "content" that includes "# pin-default"
And the file should have a "content" of "# pin-default\nPackage: *\nPin: release a=pin-default\nPin-Priority: 0"
And there should be a resource "File[pin-with-params.pref]"
@@ -28,6 +32,7 @@ Feature: pin.pp
And the file should have a "mode" of "644"
And the file should have an "ensure" of "file"
And the file should have a "name" of "/etc/apt/preferences.d/pin-with-params"
+ And the file should have a "content" of "# pin-with-params\nPackage: mysql\nPin: release a=pin-with-params\nPin-Priority: 788"
Scenario:
Given a node named "define-pin-fail"
8 features/modules/apt/apt_ppa.feature
View
@@ -1,14 +1,18 @@
Feature: ppa.pp
In order to have effective package management
- The apt class should be able to use pins to manage packages
+ The apt class should be able to use ppas to help manage packages
- Scenario: Default define of apt::pin
+ Scenario: Default define of apt::ppa
Given a node named "define-ppa"
When I compile the catalog
Then compilation should succeed
And all resource dependencies should resolve
And there should be a resource "Class[Apt]"
+ And the class should have a "before" of "[Apt::Ppa[default], Apt::Ppa[other]]"
+ And the class should have "disable_keys" set to "false"
+ And the class should have "always_apt_update" set to "false"
+
And there should be a resource "Apt::Ppa[default]"
And there should be a resource "Apt::Ppa[other]"
Please sign in to comment.
Something went wrong with that request. Please try again.