-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_default.rb
67 lines (58 loc) · 1.68 KB
/
test_default.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Test Integration For Users
# frozen_string_literal: true
describe user('tom') do
it { should exist }
its('group') { should eq 'tom' }
its('groups') { should eq %w[tom sysadmin] }
its('home') { should eq '/home/tom' }
its('shell') { should eq '/bin/bash' }
end
describe user('mike') do
it { should exist }
its('group') { should eq 'mike' }
its('groups') { should eq %w[mike webadmin] }
its('home') { should eq '/home/mike' }
its('shell') { should eq '/sbin/nologin' }
end
describe file('/home/tom/.ssh') do
it { should be_a_directory }
it { should exist }
its('mode') { should cmp '0700' }
its('owner') { should eq 'tom' }
its('group') { should eq 'tom' }
end
describe file('/home/mike/.ssh') do
it { should be_a_directory }
it { should exist }
its('mode') { should cmp '0700' }
its('owner') { should eq 'mike' }
its('group') { should eq 'mike' }
end
describe file('/home/tom/.ssh/authorized_keys') do
it { should be_a_file }
it { should exist }
its('mode') { should cmp '0600' }
its('owner') { should eq 'tom' }
its('group') { should eq 'tom' }
end
describe file('/home/mike/.ssh/authorized_keys') do
it { should be_a_file }
it { should exist }
its('mode') { should cmp '0600' }
its('owner') { should eq 'mike' }
its('group') { should eq 'mike' }
end
describe file('/home/tom/.bashrc') do
it { should be_a_file }
it { should exist }
its('mode') { should cmp '0644' }
its('owner') { should eq 'tom' }
its('group') { should eq 'tom' }
end
describe file('/home/mike/.bash_profile') do
it { should be_a_file }
it { should exist }
its('mode') { should cmp '0644' }
its('owner') { should eq 'mike' }
its('group') { should eq 'mike' }
end