Commit graph

33 commits

Author SHA1 Message Date
Jarl Nicolson
ac86fab459 Changed PPA manifest and tests for new package which started in Quantal 2012-11-05 19:33:38 +10:00
Erik Dalén
75092fdbf1 (#16076) Ability to fill in pin explanation
Adds the ability to fill it in and sets a reasonable default.
2012-10-25 15:44:20 -04:00
Branan Purvine-Riley
bd68302783 Merge pull request #83 from dalen/pin_order
(#16070) Allow optional order parameter to apt::pin
2012-10-18 16:45:15 -07:00
Erik Dalén
40f8755217 (#16070) Allow optional order parameter to apt::pin
As the apt pinnings are parsed in ascending alphabetical order with
first match wins within a given scope it is useful to be able to specify
a ordering parameter. Then the name parameter can be kept to something
meaningful.
2012-08-23 11:25:17 +02:00
Steffen Zieger
d49dbb49ae fix check of release parameter 2012-07-10 01:39:53 +02:00
Branan Purvine-Riley
7450a5ffc0 Fix the spec test for apt::source
the $location paramater is meant to be a deb location, so it should be
formatted as a URI.
2012-05-25 15:32:49 -07:00
Branan Purvine-Riley
ebd05e5c51 Fix spec tests 2012-05-25 11:23:54 -07:00
Nan Liu
2ce47f0652 Fix apt::dep spec tests.
Some of the existing tests were not verifying anything useful. This
update replace them with more meaningful tests.
2012-05-09 12:22:28 -07:00
Nan Liu
e3784987fc Fix dependency issues introduced with anchor.
apt::ppa and apt::builddep requires apt class. The anchor introduced for
containment of apt-get update causes a dependency loop. apt::ppa appears
to depend on apt class sources.d direcory. While apt::builddep have no
clear reason for a dependency on apt class. This change refactor both
define type, so they no longer cause a dependency loop.
2012-05-09 12:04:17 -07:00
Nan Liu
e8977deea1 (#14321) apt::pin resource support release.
apt::pin release should default to title, but should be able to
override. This update removes unnecessary "" around $name, and add spec
tests.

Conflicts:

	spec/defines/pin_spec.rb
2012-05-04 13:56:35 -07:00
Thomas Broyer
0ffe484c7c Move Package['python-software-properties'] to apt:ppa
Also updates the apt-update in Apt::Ppa to use $apt::params::provider
instead of aptitude.
2012-05-04 13:46:08 -07:00
Nan Liu
f13f3cfac7 (#11966) Change apt update to apt_update.
Based on code review change exec from apt update to apt_update.
2012-05-04 13:35:25 -07:00
Nan Liu
82967a22fa (#11966) Update apt::ppa to use apt::update.
Change apt::ppa define type to also use the apt::update class to invoke
apt-get update once.
2012-05-04 13:35:25 -07:00
Nan Liu
3684f88372 (#11966) Only invoke apt-get update once.
Move apt-get update exec to a seperate class to minimize the number of
apt-get updates invoked by configuration changes.

* remove apt_update exec resource in apt class.
* remove apt-get-${name} in defines.
* apt::source notify Exec['apt update'].
* Remove dependency to Exec['apt_update'].
* fix rspec-puppet tests.

Conflicts:

	manifests/source.pp
2012-05-04 13:35:13 -07:00
Nan Liu
effb3f7ff3 (#14308) Add ensure=>absent for define resource.
Several apt::* define resource type does not support ensurable. This
update allows ensure=>absent to support the removal of these
configuration files.

* apt::conf
* apt::pin
* apt::source
2012-05-03 16:59:13 -07:00
Nan Liu
67023aa435 (#14138) Fix spec test for aptitude changes.
Fix spec test related to apttitude update -> apt-get update change,
2012-05-02 21:35:13 -07:00
Cody Herriges
644ed232a0 Tests to validate apt::{conf,backports}
This patch adds the appropriate spec tests to validate the changes
  introduced by e5f2dfe.  As a bonus it includes fixes to the manifests
  that were discovered while writing the tests.
2012-04-20 13:43:38 -07:00
Ken Barber
a758247f26 (#13289) Clean up style violations and fix corresponding tests 2012-03-21 13:21:11 +00:00
William Van Hevelingen
5148cbf5a6 (#13125) Apt keys should be case insensitive
Previously lowercase keys would be installed every
puppet run because apt-key list returns an uppercase
key. This commit makes the comparison case insensitive.
2012-03-15 00:06:27 -07:00
Reid Vandewiele
b9607a440d Convert apt::key to use anchors
Previously, apt::key used a noop exec hack to do exactly what anchors were
intended to be used for. This commit removes the exec hack and achieves the
same end using Anchor resources from the puppetlabs/stdlib module.
2012-03-07 14:20:34 -08:00
Reid Vandewiele
d4fec561f3 Modify apt::source release parameter test
This commit modifies the release parameter test in apt::source to work
correctly within puppet-rspec for edge-case resource definitions. Previously,
the test for the $release parameter was written as

`if ! $release { fail() }`

This commit updates the test to be written as

`if $release == undef { fail() }`

Additionally, the tests for correct behavior in the presence or absence of a
$release parameter have been beefed up.

The reason for making this change relates to examples such as the following
resource definition:

apt::source { "jenkins":
  location    => "http://pkg.jenkins-ci.org/debian",
  release     => "",
  repos       => "binary/",
  key         => "D50582E6",
  key_source  => "http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key",
  include_src => false,
}

Note that the $release parameter is given as the empty string. In practice,
this is perfectly valid and everything will work great. However, it seems that
the empty string gets interpreted by something in puppet-rspec as something
equivalent to "False", and thus when testing, the above resource definition
would fail with "Puppet::Error: lsbdistcodename fact not available: release
parameter required" even though the $release parameter has been explicitely
specified (as the empty string).

See also: https://github.com/rtyler/puppet-jenkins/issues/9
2012-03-07 10:10:46 -08:00
Ryan Coleman
76dbf992e0 Merge pull request #26 from pdxcat/ticket_12823_aptkey_defined_type
(#12823) Add apt::key defined type and modify apt::source to use it

Reviewed and tested by Ryan Coleman (ryan@puppetlabs.com)
2012-03-01 14:40:44 -08:00
Reid Vandewiele
8cdaf855a1 (#12823) Add apt::key defined type and modify apt::source to use it
Adding this defined type allows puppet to add keys to the apt keystore without
needing to add a corresponding source; it also adds the "key_source" parameter
for wget'ing keys from arbitrary URLs, and allows for keys to be explicity
removed.

apt::key allows a key to be ensured present multiple times to account for
apt::source resources that all reference the same key. However, this means
that it is possible for a given key to be defined multiple times with
differing source parameters. e.g.

apt::key { "Add key: 4BD6EC30 from Apt::Source bunny":
  key        => "4BD6EC30",
  key_server => "pgp.mit.edu",
}

apt::key { "Add key: 4BD6EC30 from Apt::Source rabbit":
  key        => "4BD6EC30",
  key_server => "keyserver.ubuntu.com",
}

The defined type will accept both definitions and will create multiple exec
resources. This was deemed preferable to the alternative (creating only one
exec resource) in that one broken definition won't hose an entire catalog. If
one definition fails to install the key because of a bad "key_server", the
next apt::key that uses the key will get it done.
2012-03-01 14:15:52 -08:00
William Van Hevelingen
7c0d10b392 (#12809) $release should use $lsbdistcodename and fall back to manual input
This commit changes $release to default to Facter's $lsbdistcodename
and fall back to a Parse Error if $release is not set and $lsbdistcodename
does not exist. Previously $release was hardcoded to karmic.

This commit also modifies apt::ppa to use $release and sets the
files to be ensured so that they are not purged when purge_sources_list_d
is set to true.
2012-03-01 11:15:02 -08:00
Ryan Coleman
fab62e6de7 Merge pull request #22 from haus/unique_required_packages
Allow duplicate required_packages between sources

Reviewed and tested by Ryan Coleman (ryan@puppetlabs.com)
2012-02-24 11:12:39 -08:00
Matthaus Litteken
9059c4e2a8 Fix source specs to test all key permutations
Previously only one should in each block was being evaluated. This moves each
should to its own block so that all values are tested. It also adds another set
of params so that all useful permutations of key, key_server, and key_content
are generated. It also replaces the previous ternary assignment for param_set
with a hash merge.
2012-02-23 22:14:38 -08:00
Matthaus Litteken
1dcbf3d303 Add tests for required_packages change
This updates the tests for the apt::source defined type to use the new name for
the exec resource and the new parameter for the same exec.
2012-02-23 21:04:57 -08:00
Matthaus Litteken
74c8371533 (#12430) Add tests for changes to apt module
This update reflects the changes to the apt module to allow duplicate keys. It
mostly involves tests for changes to the resource names to make them unique
between defines.
2012-02-23 20:51:27 -08:00
Matthaus Litteken
d522877cdd (#12094) Replace chained .with_* with a hash
The hash passing to the with method is cleaner and closer to puppet code, so
all of the with_$param have been replaced with with($hash). This also
includes two minor whitspace changes to unstable.pp and source.pp.
This also replaces the ternary switch on param_set with a hash merge,
which is cleaner and will support more use cases.
2012-02-08 09:24:43 -08:00
Matthaus Litteken
2d688f4cdc (#12094) Add rspec-puppet tests for apt
This commit adds full coverage for the apt module as it currently exists. It
adds rspec-puppet tests for the defines (apt::builddep, apt::force, apt::pin,
apt::ppa, apt::source) and classes (apt, debian::testing, debian::unstable,
apt::params, apt::release).
2012-01-23 13:37:42 -08:00
Matthaus Litteken
f759bc039a (#11953) Apt::force passes $version to aptitude
Previously, even if $version were passed to apt::force, aptitude would just
install the default version of the package available. This updates the aptitude
call to use the version string if it exists. If no version is passed, or if it
is false, no version is added to the aptitude call.  This also updates the
rspec-puppet tests for the define, to reflect the changes to the exec.
2012-01-13 15:29:47 -08:00
Dan Bode
f71db53130 (#11413) Add spec test for apt::force to verify changes to unless
In the Previous commits, the query being done by the
apt::force install command was not strict enough and
could lead to false positives.

These queries represented by the unless parameter have been
resolved in another commit. This commit accompanies that commit
and adds basic unit tests to correspond to the changes.
2012-01-13 12:04:09 -08:00
Dan Bode
cf6caa1f15 (#10451) Add test coverage to apt::ppa
This commit adds test coverage for apt::ppa.

This test coverage is suficient to verify the
code changes that resolve the issue with
aptitude update not being called when ppas were
added (#10451).
2012-01-03 17:03:24 -08:00