Commit graph

103 commits

Author SHA1 Message Date
Hunter Haugen
87cc257545 Missing lsbdistid stub for apt module 2014-02-25 17:18:35 -08:00
Ashley Penney
48396f5729 This fixes this test to work in the face of oppressive SELinux! 2014-02-20 21:46:23 +00:00
Ashley Penney
a353e8e16d Convert rspec-system tests over to beaker.
This work converts all the tests over to beaker.  Some things are
done slightly different in beaker, we rely much more heavily on
catch_failures rather than explicitly laying out the exit codes we
want but I have attempted to preserve the spirit of all tests.
2014-01-23 19:07:04 -05:00
Ashley Penney
488e988a0c Merge pull request #322 from bcomnes/amazon
Added newline at end of file
2014-01-21 15:03:21 -08:00
Ashley Penney
301715b8a9 Merge pull request #256 from mnencia/patch-3
Add support to custom xlogdir parameter
2014-01-21 14:24:10 -08:00
Joshua Hoblitt
2f74feba2c update rspec-puppet tests to use contain_class() instead of include_class() 2014-01-07 15:16:09 -07:00
Aaron Blew
ce467633d1 Added xlogdir test to basic install/db creation validation test. Updated README 2013-12-15 12:54:53 +01:00
Marco Nenciarini
2b81d5cb63 Add support to custom xlogdir parameter
Having a custom xlogdir location is desiderable for performances in many production environments
2013-12-14 23:55:24 +01:00
Bret Comnes
b0f082c226 Added newline at end of file 2013-11-30 18:02:16 -08:00
Ashley Penney
878bf49617 (FM-486) Fix deprecated Puppet::Util::SUIDManager.run_and_capture
Puppet::Util::SUIDManager.run_and_capture recently changed to
Execution.execute, switch before it blows up and stops working.
2013-11-22 14:45:37 -08:00
Ken Barber
c114885a04 Merge pull request #310 from mcanevet/table_grant_fix
Fix table_grant_spec to show a bug
2013-11-15 08:40:16 -08:00
Mickaël Canévet
f0924df7c8 Can pass template at database creation 2013-11-14 18:01:30 +01:00
Mickaël Canévet
d433b283df Fix table_grant_spec to show a bug 2013-11-12 14:23:05 +01:00
Ken Barber
5df36cf1f7 (GH-198) Fix race condition on postgresql startup
This patch is a fix for the race condition that keeps occuring during
postgresql setup. Its very rare on its own, but when you are using this
module in a CI environment it happens quite frequently.

Basically what happens is that sometimes the service will announce the
database has started, but really it is still working in the background.
Sometimes the unix socket may not be listening, and sometimes the
system is still loading and you get a weird client error.

The fix itself is a modification to postgresql::validate_db_connection
so that it is able to connect on the local unix socket, plus retry
until the database is available.

This new and improved validate_db_connection can then be put into the
build pipeline (in the service class in particular) to ensure the
database is started before continuing on with the remaining steps.

This in effect blocks the puppet module from continuing until the
postgresql database is fully started and able to receive connections
which is perfect.

Tests and documentation provided.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-10-24 00:33:45 +01:00
Ashley Penney
712e5fc7f4 Merge pull request #284 from 3dna/conf_allows_dots
periods are valid in configuration variables also
2013-10-21 14:26:44 -07:00
Ashley Penney
922c29d3cd Merge pull request #275 from 3dna/feature/psql_search_path
add search_path attribute to postgresql_psql resource
2013-10-21 14:17:56 -07:00
Jeremy Kitchen
66ef240614 test and fix for dots breaking config keys 2013-10-18 23:02:11 +00:00
Jeremy Kitchen
9776602e49 periods are valid in configuration variables also
example:
http://www.postgresql.org/docs/9.2/static/auto-explain.html
2013-10-18 21:33:37 +00:00
Mickaël Canévet
6f614b0b37 Add a parameter to (un)manage pg_hba.conf 2013-10-16 14:58:08 +02:00
Jeremy Kitchen
38e82ede57 add search_path attribute to postgresql_psql resource
This allows you to set a schema search_path on postgresql_psql
resources, in case you have multiple schemas in your database and the
SQL you are trying to run requires a different path
2013-10-14 22:00:21 +00:00
Marek Hulan
5f026f1322 Tests for owner param 2013-10-10 17:44:52 +02:00
Ashley Penney
f28c355b26 Merge pull request #267 from neilnorthrop/master
fixed the rspec test to include 'sha1' in
2013-10-09 09:05:16 -07:00
Neil Northrop
f9e6046132 fixed the rspec test to include 'sha1' in 2013-10-04 15:14:10 -07:00
Bret Comnes
2718f14017 Special case for $datadir on Amazon
Closes #252
2013-10-02 12:48:44 -07:00
Kamil Szymanski
71e0236659 Validate authentication method against server version 2013-09-22 22:35:18 +02:00
Ken Barber
891b1d71a2 Rename contrib to server::contrib
Signed-off-by: Ken Barber <ken@bob.sh>
2013-09-20 14:35:24 +01:00
Ken Barber
56c10986a8 Ensure we use port 5432 for postgresql
Signed-off-by: Ken Barber <ken@bob.sh>
2013-09-20 01:17:43 +01:00
Ken Barber
809003d0f9 serverspec + some cleanup
Signed-off-by: Ken Barber <ken@bob.sh>
2013-09-19 16:30:15 +01:00
Ken Barber
e5562621ec Fix table_grant tests
Signed-off-by: Ken Barber <ken@bob.sh>
2013-09-18 23:11:10 +01:00
Ken Barber
c8d3ecde14 Various cleanups
Signed-off-by: Ken Barber <ken@bob.sh>
2013-09-18 22:25:51 +01:00
Ken Barber
1fbc9c6ece Add switch for service_name that works for centos
Signed-off-by: Ken Barber <ken@bob.sh>
2013-09-18 17:08:46 +01:00
Ken Barber
31e9b62a51 Correct some more failing tests
Signed-off-by: Ken Barber <ken@bob.sh>
2013-09-18 15:06:35 +01:00
Ken Barber
5370fbeb10 Fix selinux permissions for fedora tests
Signed-off-by: Ken Barber <ken@bob.sh>
2013-09-18 13:40:15 +01:00
Ken Barber
a8f86f9df1 Skip firewall tests for Fedora
Signed-off-by: Ken Barber <ken@bob.sh>
2013-09-18 01:32:00 +01:00
Ken Barber
cd2bc50cdf Fix repo removal for testing purposes
Signed-off-by: Ken Barber <ken@bob.sh>
2013-09-17 22:19:01 +01:00
Ken Barber
ce94eb348a Modify tests for postgresql::server to test for purged state
Since we are now forcing ensure => purged in places, some unit tests need to
be reworked to accept that.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-09-14 06:39:17 +01:00
Ken Barber
27c5cc0304 Provide package removal fixes for Debian tests
This patch provides fixes to help tests pass on Debian. The failures were in
relation to the lack of proper removal of the server and contrib parts. Setting
the ensure => purged parameter for removal seems to have solved a lot of this.

Also, the ordering for contrib being (un)installed needed some work.

I've also made sure we use 'purged' a lot more in tests to make sure we clean
up after ourselves properly.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-09-14 06:39:17 +01:00
Ken Barber
402a6b9608 Include firewall class in firewall based test
Signed-off-by: Ken Barber <ken@bob.sh>
2013-09-14 06:39:17 +01:00
Ken Barber
59c1cbfbf8 Major rewrite to solve order dependencies and unclear public API
This is a very very large change to the module. It started out as a fix to add
postgresl::server::config_entry, and quickly became a rewrite to fix a lot of
ordering issues inherent in the API.

Since this changes the Public API it is considered a backwards compatible
change.

See the upgrading guide in README.md for more details as to what has been
modified in this patch.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-09-14 06:39:15 +01:00
Rahul Gopinath
1dce6454c8 Pulling in pgconf module from camptocamp/puppet-pgconf
This includes the following changes:
  - Hooking up pgconf module to postgresql to manage postgresql.conf
   - pgconf includes a type and provider for postgresql.conf the provider
     is a simple parsed file following basic ini parsing.
  - Add config_entry.pp which wraps the pgconf module.
  - Replace file_line resources by postgresql::config_entry in beforeservice.pp
  - Adding unit tests for the newly introduced functionality
2013-09-14 06:38:53 +01:00
Hunter Haugen
b85a118b57 Add specs for psql Type and Provider 2013-08-13 16:18:02 -07:00
Hunter Haugen
b2b9b13df8 Merge pull request #218 from fiddyspence/set_postgres_postgrespw
Alter escaping in postgresql::config::afterservice
2013-08-13 16:13:18 -07:00
Ken Barber
9c2dab95aa (GH-216) Alter role call not idempotent with cleartext passwords
The postgresql::role defined type was not idempotent when passed cleartext
passwords. This is because we were comparing it with its md5 equivalent in
the db.

This patch converts any cleartext passwords to md5 before comparison, but
only if they are cleartext (ie. not starting with md5).

I also bumped the version of rspec-system-puppet to get use of the refresh
method, plus did some cleanup because the old tests were a bit dusty, again
taking advantage of refresh plus changing some matchers for clarity.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-08-01 03:18:46 +01:00
fiddyspence
eadfe3bf00 modified tests 2013-07-23 15:13:15 +01:00
fiddyspence
2eb03efc29 Alter escaping in postgresql::config::afterservice
This allows non-standard users (pe-postgres) to change passwords. Also
added a function to do escaping of the password, added system tests
and rspec tests for the function.
2013-07-23 13:04:46 +01:00
Hunter Haugen
847f54ce6c Merge pull request #204 from mcanevet/set_istemplate
Add support for istemplate parameter where creating db
2013-07-19 12:55:16 -07:00
Hunter Haugen
95452ceb90 Merge pull request #205 from mcanevet/plperl
Add support for installing PL/Perl
2013-07-19 12:49:21 -07:00
Hunter Haugen
6890a56eb7 Reindent postgresql::database_grant spec 2013-07-16 14:31:28 -07:00
Hunter Haugen
a37eaa053b Split database_grant up
The code to grant permissions databases and their objects has been
abstracted to `postgresql::grant` and is used by both
`postgresql::database_grant` and `postgresql::table_grant`
2013-07-16 14:31:28 -07:00
Mickaël Canévet
5ff47cf1b8 Test plperl only on non standard installation as it does not work on redhat5 2013-07-16 16:06:12 +02:00