fix(database): don't enforce client encoding
[arvados-formula.git] / test / integration / api / controls / config_spec.rb
1 # frozen_string_literal: true
2
3 api_stanza = <<-API_STANZA
4     API:
5 API_STANZA
6
7 rails_stanza = <<-RAILS_STANZA
8       RailsAPI:
9         InternalURLs:
10           http://api.internal:8004: {}
11 RAILS_STANZA
12
13 database_stanza = <<-DATABASE_STANZA
14     ### DATABASE CONFIGURATION
15     PostgreSQL:
16       ConnectionPool: 32
17       Connection:
18         # All parameters here are passed to the PG client library in a connection string;
19         # see https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-PARAMKEYWORDS
20         dbname: arvados
21         host: 127.0.0.1
22         password: "changeme_arvados"
23         user: arvados
24         client_encoding: UTF8
25 DATABASE_STANZA
26
27 group = case os[:name]
28         when 'centos'
29           'nginx'
30         when 'debian', 'ubuntu'
31           'www-data'
32         end
33
34 control 'arvados configuration' do
35   title 'should match desired api lines'
36
37   describe file('/etc/arvados/config.yml') do
38     it { should be_file }
39     it { should be_owned_by 'root' }
40     it { should be_grouped_into group }
41     its('mode') { should cmp '0640' }
42     its('content') do
43       should include(
44         'File managed by Salt at <salt://arvados/files/default/config.tmpl.jinja>.'
45       )
46     end
47     its('content') { should include(api_stanza) }
48     its('content') { should include(rails_stanza) }
49     its('content') { should include(database_stanza) }
50   end
51 end