f8be4d469870425ba9cbf97bbbccf0b8f96c3bea
[arvados-formula.git] / test / integration / workbench / controls / config_spec.rb
1 # frozen_string_literal: true
2
3 workbench_config = <<-WORKBENCH_STANZA
4     Workbench:
5       SecretKeyBase: "changeme_workbench_secret_key"
6       SiteName: FIXME
7 WORKBENCH_STANZA
8
9 workbench_service = <<-WORKBENCH_SERVICE_STANZA
10       Workbench1:
11         ExternalURL: https://workbench.fixme.example.net
12 WORKBENCH_SERVICE_STANZA
13
14 group = case os[:name]
15         when 'centos'
16           'nginx'
17         when 'debian', 'ubuntu'
18           'www-data'
19         end
20
21 control 'arvados configuration' do
22   title 'should match desired workbench lines'
23
24   describe file('/etc/arvados/config.yml') do
25     it { should be_file }
26     it { should be_owned_by 'root' }
27     it { should be_grouped_into group }
28     its('mode') { should cmp '0640' }
29     its('content') do
30       should include(
31         'File managed by Salt at <salt://arvados/files/default/config.tmpl.jinja>.'
32       )
33     end
34     its('content') { should include(workbench_config) }
35     its('content') { should include(workbench_service) }
36   end
37 end