Fix the non-defaults test failing to use UTF8
The non-default tests try to set UTF8 when UTF8 is not installed on the en_US machine. These are non-default settings anyway, but one should presume the correct locale should be set before this is attempted, this patch includes that step. In an ideal world we would use a locale module to do this. This patch also fixes an Ubuntu 10.04 issue where you need to be absolute about the locale and encoding as well. Signed-off-by: Ken Barber <ken@bob.sh>
This commit is contained in:
parent
27e40da908
commit
2676904608
2 changed files with 21 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,3 +4,4 @@ Gemfile.lock
|
|||
metadata.json
|
||||
spec/fixtures
|
||||
pkg/
|
||||
.rspec_system/
|
||||
|
|
|
@ -1,6 +1,22 @@
|
|||
require 'spec_helper_system'
|
||||
|
||||
describe 'non defaults:' do
|
||||
before :all do
|
||||
puppet_apply(<<-EOS)
|
||||
if($::operatingsystem =~ /Debian|Ubuntu/) {
|
||||
# Need to make sure the correct utf8 locale is ready for our
|
||||
# non-standard tests
|
||||
file { '/etc/locale.gen':
|
||||
content => "en_US ISO-8859-1\nen_NG UTF-8\nen_US UTF-8\n",
|
||||
}~>
|
||||
exec { '/usr/sbin/locale-gen':
|
||||
logoutput => true,
|
||||
refreshonly => true,
|
||||
}
|
||||
}
|
||||
EOS
|
||||
end
|
||||
|
||||
context 'test installing non-default version of postgresql' do
|
||||
after :each do
|
||||
# Cleanup
|
||||
|
@ -23,8 +39,10 @@ describe 'non defaults:' do
|
|||
# Configure version and manage_package_repo globally, install postgres
|
||||
# and then try to install a new database.
|
||||
class { "postgresql":
|
||||
version => "9.2",
|
||||
manage_package_repo => true,
|
||||
version => "9.2",
|
||||
manage_package_repo => true,
|
||||
charset => 'UTF8',
|
||||
locale => 'en_US.UTF-8',
|
||||
}->
|
||||
class { "postgresql::server": }->
|
||||
postgresql::db { "postgresql_test_db":
|
||||
|
|
Loading…
Reference in a new issue