18663: add keep-balance app management
[arvados-formula.git] / test / integration / keepbalance / controls / config_spec.rb
1 # frozen_string_literal: true
2
3 keepbalance_stanza = <<-KEEPBALANCE_STANZA
4       Keepbalance:
5         InternalURLs:
6           http://fixme.example.net:9005: {}
7 KEEPBALANCE_STANZA
8
9 collections_stanza = <<-COLLECTIONS_STANZA
10     Collections:
11       BlobSigningKey: "blobsigningkeymushaveatleast32characters"
12       BlobTrash: true
13 COLLECTIONS_STANZA
14
15 group = case os[:name]
16         when 'centos'
17           'nginx'
18         when 'debian', 'ubuntu'
19           'www-data'
20         end
21
22 control 'arvados configuration' do
23   title 'should match desired keepbalance lines'
24
25   describe file('/etc/arvados/config.yml') do
26     it { should be_file }
27     it { should be_owned_by 'root' }
28     # We're testing it in the API instance, so group will be nginx's
29     it { should be_grouped_into group }
30     its('mode') { should cmp '0640' }
31     its('content') do
32       should include(
33         'File managed by Salt at <salt://arvados/files/default/config.tmpl.jinja>.'
34       )
35     end
36     its('content') { should include(keepbalance_stanza) }
37     its('content') { should include(collections_stanza) }
38   end
39 end