Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9313669
z_alternative_pgdata_spec.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
z_alternative_pgdata_spec.rb
View Options
require
'spec_helper_acceptance'
# These tests ensure that postgres can change itself to an alternative pgdata
# location properly.
# Allow postgresql to use /tmp/* as a datadir
if
fact
(
'osfamily'
)
==
'RedHat'
and
fact
(
'selinux'
)
==
'true'
shell
'setenforce 0'
end
describe
'postgresql::server'
,
:unless
=>
UNSUPPORTED_PLATFORMS
.
include?
(
fact
(
'osfamily'
))
do
it
'on an alternative pgdata location'
do
pp
=
<<-
EOS
#file { '/var/lib/pgsql': ensure => directory, } ->
# needs_initdb will be true by default for all OS's except Debian
# in order to change the datadir we need to tell it explicitly to call initdb
class { 'postgresql::server': datadir => '/tmp/data', needs_initdb => true }
EOS
apply_manifest
(
pp
,
:catch_failures
=>
true
)
apply_manifest
(
pp
,
:catch_changes
=>
true
)
end
describe
file
(
'/tmp/data'
)
do
it
{
should
be_directory
}
end
it
'can connect with psql'
do
psql
(
'--command="\l" postgres'
,
'postgres'
)
do
|
r
|
expect
(
r
.
stdout
)
.
to
match
(
/List of databases/
)
end
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Thu, Jul 3, 11:50 AM (3 d, 12 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3353882
Attached To
rSPPG PostgreSQL puppet module
Event Timeline
Log In to Comment