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