From 77960641dd02fd676a1333c632c8dc0bb2a9e216 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Fri, 31 May 2019 00:28:42 +0100 Subject: [PATCH] test(locale): improve test using locale `en_US.UTF-8` --- pillar.example | 2 +- .../default/controls/command_spec.rb | 3 +- test/salt/pillar/postgres.sls | 34 +++++++++---------- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/pillar.example b/pillar.example index 108c38a..aa68a03 100644 --- a/pillar.example +++ b/pillar.example @@ -36,7 +36,7 @@ postgres: # The default `encoding` is derived from the `locale` so not recommended # to provide a value for it unless necessary cluster: - locale: en_GB.UTF-8 + locale: en_US.UTF-8 # encoding: UTF8 #'Alternatives system' priority incremental. 0 disables feature. diff --git a/test/integration/default/controls/command_spec.rb b/test/integration/default/controls/command_spec.rb index 3ab7035..3c3a3b6 100644 --- a/test/integration/default/controls/command_spec.rb +++ b/test/integration/default/controls/command_spec.rb @@ -9,7 +9,6 @@ control 'Postgres command' do # Can't use `%Q` here due to the `\` describe command(%q{su - postgres -c 'psql -p} + pg_port + %q{ -qtc "\l+ db2"'}) do - its(:stdout) { should match(/.*db2.*my_space/) } - # its(:stdout) { should match(/db2.*remoteUser.*UTF8.*en_US\.UTF-8.*en_US\.UTF-8.*my_space/) } + its(:stdout) { should match(/db2.*remoteUser.*UTF8.*en_US\.UTF-8.*en_US\.UTF-8.*my_space/) } end end diff --git a/test/salt/pillar/postgres.sls b/test/salt/pillar/postgres.sls index 2c55bfb..7e234f8 100644 --- a/test/salt/pillar/postgres.sls +++ b/test/salt/pillar/postgres.sls @@ -42,13 +42,13 @@ postgres: # - postgresql-contrib # - postgresql-plpython - # # CLUSTER - # # The default `encoding` is derived from the `locale` so not recommended - # # to provide a value for it unless necessary - # cluster: - # locale: en_GB.UTF-8 - # # encoding: UTF8 - # + # CLUSTER + # The default `encoding` is derived from the `locale` so not recommended + # to provide a value for it unless necessary + cluster: + locale: en_US.UTF-8 + # encoding: UTF8 + # #'Alternatives system' priority incremental. 0 disables feature. # linux: # altpriority: 30 @@ -166,20 +166,20 @@ postgres: # databases to be created databases: db1: - owner: 'localUser' - # template: 'template0' - # lc_ctype: 'en_US.UTF-8' - # lc_collate: 'en_US.UTF-8' + owner: localUser + template: template0 + lc_ctype: en_US.UTF-8 + lc_collate: en_US.UTF-8 db2: - owner: 'remoteUser' - # template: 'template0' - # lc_ctype: 'en_US.UTF-8' - # lc_collate: 'en_US.UTF-8' - tablespace: 'my_space' + owner: remoteUser + template: template0 + lc_ctype: en_US.UTF-8 + lc_collate: en_US.UTF-8 + tablespace: my_space # set custom schema schemas: public: - owner: 'localUser' + owner: localUser # enable per-db extension {%- if grains.os_family == 'Debian' and grains.osfinger != 'Debian-8' %} extensions: