This repository has been archived by the owner on Aug 14, 2023. It is now read-only.
/
docker_spec.rb
81 lines (66 loc) · 1.94 KB
/
docker_spec.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
require 'spec_helper'
describe package('docker-hypriot') do
it { should be_installed }
end
describe command('dpkg -l docker-hypriot') do
its(:stdout) { should match /ii docker-hypriot/ }
its(:stdout) { should match /1.10.0-1/ }
its(:exit_status) { should eq 0 }
end
describe file('/usr/bin/docker') do
it { should be_file }
it { should be_mode 755 }
it { should be_owned_by 'root' }
end
describe file('/usr/lib/docker/dockerinit') do
it { should be_file }
it { should be_mode 755 }
it { should be_owned_by 'root' }
end
describe file('/etc/init.d/docker') do
it { should_not exist }
end
describe file('/etc/default/docker') do
it { should be_file }
it { should be_mode 644 }
it { should be_owned_by 'root' }
its(:content) { should match /--storage-driver=aufs/ }
end
describe file('/var/lib/docker') do
it { should be_directory }
it { should be_mode 701 }
it { should be_owned_by 'root' }
end
describe file('/etc/bash_completion.d/docker') do
it { should be_file }
it { should be_mode 755 }
it { should be_owned_by 'root' }
it { should be_file }
end
describe command('docker -v') do
its(:stdout) { should match /Docker version 1.10.0, build/ }
its(:exit_status) { should eq 0 }
end
describe command('docker version') do
its(:stdout) { should match /Client:. Version: 1.10.0. API version: 1.22/m }
its(:stdout) { should match /Server:. Version: 1.10.0. API version: 1.22/m }
its(:exit_status) { should eq 0 }
end
describe command('docker info') do
its(:stdout) { should match /Storage Driver: aufs/ }
its(:exit_status) { should eq 0 }
end
describe interface('lo') do
it { should exist }
end
describe interface('docker0') do
it { should exist }
end
describe service('docker') do
#it { should be_enabled }
it { should be_running }
end
describe command('grep docker /var/log/syslog') do
its(:stdout) { should match /Daemon has completed initialization/ }
its(:exit_status) { should eq 0 }
end