Merge pull request #4 from netmanagers/refactor-config-add-service
[arvados-formula.git] / test / integration / shell / controls / config_spec.rb
1 # frozen_string_literal: true
2
3 siab_stanza = <<~SIAB_STANZA
4   SHELLINABOX_PORT=4200
5   # SSL is disabled because it is terminated in Nginx. Adjust as needed.
6   SHELLINABOX_ARGS="--disable-ssl --no-beep --service=/shell.fixme.example.net:AUTH:HOME:SHELL"
7 SIAB_STANZA
8
9 libpam_stanza = <<~LIBPAM_STANZA
10   auth [success=1 default=ignore] /usr/lib/pam_arvados.so fixme.example.net shell.fixme.example.net
11 LIBPAM_STANZA
12
13 control 'shellinabox configuration' do
14   title 'should match desired lines'
15
16   describe file('/etc/default/shellinabox') do
17     it { should be_file }
18     it { should be_owned_by 'root' }
19     it { should be_grouped_into 'root' }
20     its('mode') { should cmp '0644' }
21     its('content') do
22       should include(
23         # rubocop:disable Metrics/LineLength
24         'File managed by Salt at <salt://arvados/shell/config/files/default/shell-shellinabox.tmpl.jinja>.'
25         # rubocop:enable Metrics/LineLength
26       )
27     end
28     its('content') { should include(siab_stanza) }
29   end
30 end
31
32 control 'libpam-arvados configuration' do
33   title 'should match desired lines'
34
35   describe file('/etc/pam.d/arvados') do
36     it { should be_file }
37     it { should be_owned_by 'root' }
38     it { should be_grouped_into 'root' }
39     its('mode') { should cmp '0644' }
40     its('content') do
41       should include(
42         # rubocop:disable Metrics/LineLength
43         'File managed by Salt at <salt://arvados/shell/config/files/default/shell-libpam-arvados.tmpl.jinja>.'
44         # rubocop:enable Metrics/LineLength
45       )
46     end
47     its('content') { should include(libpam_stanza) }
48   end
49 end