Commit graph

53 commits

Author SHA1 Message Date
Dean Reilly
d8e2cf24a5 Add spec test for removing proxy configuration. 2013-06-02 18:51:27 +01:00
Ken Barber
a7e6048103 Remove deprecation warnings for pin.pref.erb as well
Signed-off-by: Ken Barber <ken@bob.sh>
2013-06-02 18:24:33 +01:00
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
Jonathan Araña Cruz
145a2853d4 Add «main» to Ubuntu backports repos. 2012-06-29 13:15:13 +02:00
Branan Purvine-Riley
918a3767ff Switch to the new puppetlabs_spec_helper gem 2012-05-31 15:32:03 -07: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
Branan Purvine-Riley
a4e1ee7508 fallback to the puppet modulepath if a module is missing from fixtures 2012-05-22 13:27:28 -07:00
Branan Purvine-Riley
fbe44e8b27 Remove recursive symlink from fixtures 2012-05-22 13:27:20 -07:00
Dan Bode
cdfad26d83 Merge pull request #56 from branan/travisci
Add files for travis CI
2012-05-22 09:21:52 -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
Branan Purvine-Riley
05fba437a3 Add configuration for Travis CI 2012-05-08 11:01:31 -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
Nan Liu
51a7596b03 Merge pull request #41 from tbroyer/install-proxy-first
Make sure we configure the proxy before doing apt-get update.
2012-05-02 17:31:57 -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
Thomas Broyer
e656c65818 Make sure we configure the proxy before doing apt-get update. 2012-03-30 17:48:31 +02:00
Ken Barber
0ea4ffa9a2 (#13289) Change test scaffolding to use a module & manifest dir fixture path
This removes the need for depending on a global site.pp, and depending on the
checked out apt module to be called 'apt' as well.

It pulls in stdlib via sub-modules as I don't have a better way to deal with
dependencies yet. It has pinned the revision for stdlib to 2.2.1 which is the
minimum required version for apt to work.
2012-03-21 13:21:50 +00: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
b1eb28956e Merge pull request #23 from haus/python_properties
Check if python-software-properties is defined before attempting to define it.

Reviewed and tested by Ryan Coleman (ryan@puppetlabs.com)
2012-02-24 11:20:52 -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
Ryan Coleman
2a57cbb8ca Merge pull request #24 from haus/fix_source_key_tests
Fix source specs to test all key permutations

Reviewed and tested by Ryan Coleman (ryan@puppetlabs.com)
2012-02-24 10:56:55 -08:00
Ryan Coleman
be2cc3ec1b (#12522) Adjust spec test for splitting purge
Now that the purge parameter is split into two, the spec test needs
adjusted. This commit makes that adjustment.
2012-02-24 10:17:26 -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
8acb202685 Add test for python-software-properties package
This test adds the precondition that the python-software-packages package be
installed before the apt class is synced. If the defined function were not
called around the package resource, this test would fail with a duplicate
package resource error.
2012-02-23 21:40:42 -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
8171d35470 Merge branch 'allow-same-key' 2012-02-23 20:54:10 -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
William Van Hevelingen
1160bcd6d1 (#12526) Add ability to reverse apt { disable_keys => true }
The setting `disable_keys => true` parameter in the apt module creates
/etc/apt/apt.conf.d/99unauth with the contents
"APT::Get::AllowUnauthenticated 1;". Changing `disable_keys`
does not remove this file. This patch makes it so that
`disable_keys => false` will remove /etc/apt/apt.conf.d/99unauth.
2012-02-23 14:37:04 -08:00
William Van Hevelingen
8c279636f5 (#12522) Adding purge option to apt class
Adds a purge option to the apt class to remove repositories
that are not managed by apt::source
2012-02-14 10:51:56 -08:00
Dan Bode
997c9fdc40 (#12529) Add unit test for apt proxy settings
This commit adds unit tests to validate that the
apt proxy is configured as expected when the class
parameter proxy_host is set as a class parameter for
the apt class.
2012-02-13 09:58:30 -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
8cf1bd0289 (#12094) Remove deprecated spec.opts file
Rspec no longer uses the spec.opts file, and this particular file also uses
options for rspec that are no longer honored or available, like loadby. So this
commit removes the file. Users that want to customize rspec behavior should use
a .rspec file in the repository root or in their home directory.
2012-01-23 13:38:09 -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