serverspec 0.2.13 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +3 -7
- data/lib/serverspec/commands/base.rb +4 -0
- data/lib/serverspec/matchers.rb +3 -0
- data/lib/serverspec/matchers/be_disabled.rb +5 -0
- data/lib/serverspec/matchers/be_enforcing.rb +5 -0
- data/lib/serverspec/matchers/be_permissive.rb +5 -0
- data/lib/serverspec/version.rb +1 -1
- data/spec/debian/commands_spec.rb +81 -36
- data/spec/debian/matchers_spec.rb +0 -2
- data/spec/gentoo/commands_spec.rb +80 -36
- data/spec/gentoo/matchers_spec.rb +0 -2
- data/spec/redhat/commands_spec.rb +80 -36
- data/spec/redhat/matchers_spec.rb +4 -2
- data/spec/solaris/commands_spec.rb +81 -58
- data/spec/solaris/matchers_spec.rb +0 -1
- data/spec/support/shared_matcher_examples.rb +18 -16
- metadata +93 -98
data/README.md
CHANGED
@@ -75,14 +75,10 @@ end
|
|
75
75
|
|
76
76
|
You can write spec for testing servers like this.
|
77
77
|
|
78
|
-
|
78
|
+
Serverspec with SSH backend logs in to target servers as a user configured in ``~/.ssh/config`` or a current user.If you'd lile to change the user, please edit the below line in ``spec/spec_helper.rb``.
|
79
79
|
|
80
|
-
```
|
81
|
-
|
82
|
-
User root
|
83
|
-
IdentityFile ~/.ssh/id_rsa
|
84
|
-
StrictHostKeyChecking no
|
85
|
-
UserKnownHostsFile /dev/null
|
80
|
+
```ruby
|
81
|
+
user = options[:user] || Etc.getlogin
|
86
82
|
```
|
87
83
|
|
88
84
|
Run tests.
|
data/lib/serverspec/matchers.rb
CHANGED
@@ -20,6 +20,9 @@ require 'serverspec/matchers/be_zfs'
|
|
20
20
|
require 'serverspec/matchers/be_readable'
|
21
21
|
require 'serverspec/matchers/be_writable'
|
22
22
|
require 'serverspec/matchers/be_executable'
|
23
|
+
require 'serverspec/matchers/be_enforcing'
|
24
|
+
require 'serverspec/matchers/be_permissive'
|
25
|
+
require 'serverspec/matchers/be_disabled'
|
23
26
|
require 'serverspec/matchers/have_ipfilter_rule'
|
24
27
|
require 'serverspec/matchers/have_ipnat_rule'
|
25
28
|
require 'serverspec/matchers/have_svcprop'
|
data/lib/serverspec/version.rb
CHANGED
@@ -1,103 +1,148 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
describe commands.check_enabled('httpd') do
|
3
|
+
describe 'check_enabled', :os => :debian do
|
4
|
+
subject { commands.check_enabled('httpd') }
|
6
5
|
it { should eq 'ls /etc/rc3.d/ | grep httpd' }
|
7
6
|
end
|
8
7
|
|
9
|
-
describe
|
8
|
+
describe 'check_file', :os => :debian do
|
9
|
+
subject { commands.check_file('/etc/passwd') }
|
10
10
|
it { should eq 'test -f /etc/passwd' }
|
11
11
|
end
|
12
12
|
|
13
|
-
describe
|
13
|
+
describe 'check_directory', :os => :debian do
|
14
|
+
subject { commands.check_directory('/var/log') }
|
14
15
|
it { should eq 'test -d /var/log' }
|
15
16
|
end
|
16
17
|
|
17
|
-
describe
|
18
|
+
describe 'check_user', :os => :debian do
|
19
|
+
subject { commands.check_user('root') }
|
18
20
|
it { should eq 'id root' }
|
19
21
|
end
|
20
22
|
|
21
|
-
describe
|
23
|
+
describe 'check_group', :os => :debian do
|
24
|
+
subject { commands.check_group('wheel') }
|
22
25
|
it { should eq 'getent group | grep -wq wheel' }
|
23
26
|
end
|
24
27
|
|
25
|
-
describe
|
28
|
+
describe 'check_installed', :os => :debian do
|
29
|
+
subject { commands.check_installed('httpd') }
|
26
30
|
it { should eq 'dpkg -s httpd' }
|
27
31
|
end
|
28
32
|
|
29
|
-
describe
|
33
|
+
describe 'check_listening', :os => :debian do
|
34
|
+
subject { commands.check_listening(80) }
|
30
35
|
it { should eq "netstat -tunl | grep ':80 '" }
|
31
36
|
end
|
32
37
|
|
33
|
-
describe
|
38
|
+
describe 'check_running', :os => :debian do
|
39
|
+
subject { commands.check_running('httpd') }
|
34
40
|
it { should eq 'service httpd status' }
|
35
41
|
end
|
36
42
|
|
37
|
-
|
43
|
+
|
44
|
+
describe 'check_running_under_supervisor', :os => :debian do
|
45
|
+
subject { commands.check_running_under_supervisor('httpd') }
|
38
46
|
it { should eq 'supervisorctl status httpd' }
|
39
47
|
end
|
40
48
|
|
41
|
-
describe
|
49
|
+
describe 'check_process', :os => :debian do
|
50
|
+
subject { commands.check_process('httpd') }
|
42
51
|
it { should eq 'ps aux | grep -w httpd | grep -qv grep' }
|
43
52
|
end
|
44
53
|
|
45
|
-
describe
|
54
|
+
describe 'check_file_contain', :os => :debian do
|
55
|
+
subject { commands.check_file_contain('/etc/passwd', 'root') }
|
46
56
|
it { should eq "grep -q 'root' /etc/passwd" }
|
47
57
|
end
|
48
58
|
|
49
|
-
describe
|
50
|
-
|
51
|
-
|
59
|
+
describe 'check_file_contain_within', :os => :debian do
|
60
|
+
context 'contain a pattern in the file' do
|
61
|
+
subject { commands.check_file_contain_within('Gemfile', 'rspec') }
|
62
|
+
it { should eq "sed -n '1,$p' Gemfile | grep -q 'rspec' -" }
|
63
|
+
end
|
52
64
|
|
53
|
-
|
54
|
-
|
55
|
-
|
65
|
+
context 'contain a pattern after a line in a file' do
|
66
|
+
subject { commands.check_file_contain_within('Gemfile', 'rspec', '/^group :test do/') }
|
67
|
+
it { should eq "sed -n '/^group :test do/,$p' Gemfile | grep -q 'rspec' -" }
|
68
|
+
end
|
56
69
|
|
57
|
-
|
58
|
-
|
59
|
-
end
|
70
|
+
context 'contain a pattern before a line in a file' do
|
71
|
+
subject {commands.check_file_contain_within('Gemfile', 'rspec', nil, '/^end/') }
|
72
|
+
it { should eq "sed -n '1,/^end/p' Gemfile | grep -q 'rspec' -" }
|
73
|
+
end
|
60
74
|
|
61
|
-
|
62
|
-
|
75
|
+
context 'contain a pattern from within a line and another line in a file' do
|
76
|
+
subject { commands.check_file_contain_within('Gemfile', 'rspec', '/^group :test do/', '/^end/') }
|
77
|
+
it { should eq "sed -n '/^group :test do/,/^end/p' Gemfile | grep -q 'rspec' -" }
|
78
|
+
end
|
63
79
|
end
|
64
80
|
|
65
|
-
describe
|
81
|
+
describe 'check_mode', :os => :debian do
|
82
|
+
subject { commands.check_mode('/etc/sudoers', 440) }
|
66
83
|
it { should eq 'stat -c %a /etc/sudoers | grep \'^440$\'' }
|
67
84
|
end
|
68
85
|
|
69
|
-
describe
|
86
|
+
describe 'check_owner', :os => :debian do
|
87
|
+
subject { commands.check_owner('/etc/passwd', 'root') }
|
70
88
|
it { should eq 'stat -c %U /etc/passwd | grep \'^root$\'' }
|
71
89
|
end
|
72
90
|
|
73
|
-
describe
|
91
|
+
describe 'check_grouped', :os => :debian do
|
92
|
+
subject { commands.check_grouped('/etc/passwd', 'wheel') }
|
74
93
|
it { should eq 'stat -c %G /etc/passwd | grep \'^wheel$\'' }
|
75
94
|
end
|
76
95
|
|
77
|
-
describe
|
96
|
+
describe 'check_cron_entry', :os => :debian do
|
97
|
+
subject { commands.check_cron_entry('root', '* * * * * /usr/local/bin/batch.sh') }
|
78
98
|
it { should eq 'crontab -u root -l | grep "\* \* \* \* \* /usr/local/bin/batch.sh"' }
|
79
99
|
end
|
80
100
|
|
81
|
-
describe
|
101
|
+
describe 'check_link', :os => :debian do
|
102
|
+
subject { commands.check_link('/etc/system-release', '/etc/redhat-release') }
|
82
103
|
it { should eq 'stat -c %N /etc/system-release | grep /etc/redhat-release' }
|
83
104
|
end
|
84
105
|
|
85
|
-
describe
|
106
|
+
describe 'check_installed_by_gem', :os => :debian do
|
107
|
+
subject { commands.check_installed_by_gem('jekyll') }
|
86
108
|
it { should eq 'gem list --local | grep \'^jekyll \'' }
|
87
109
|
end
|
88
110
|
|
89
|
-
describe
|
111
|
+
describe 'check_belonging_group', :os => :debian do
|
112
|
+
subject { commands.check_belonging_group('root', 'wheel') }
|
90
113
|
it { should eq "id root | awk '{print $3}' | grep wheel" }
|
91
114
|
end
|
92
115
|
|
93
|
-
describe
|
94
|
-
|
116
|
+
describe 'check_ipatbles', :os => :debian do
|
117
|
+
context 'check a rule without a table and a chain' do
|
118
|
+
subject { commands.check_iptables_rule('-P INPUT ACCEPT') }
|
119
|
+
it { should eq "iptables -S | grep '\\-P INPUT ACCEPT'" }
|
120
|
+
end
|
121
|
+
|
122
|
+
context 'chack a rule with a table and a chain' do
|
123
|
+
subject { commands.check_iptables_rule('-P INPUT ACCEPT', 'mangle', 'INPUT') }
|
124
|
+
it { should eq "iptables -t mangle -S INPUT | grep '\\-P INPUT ACCEPT'" }
|
125
|
+
end
|
95
126
|
end
|
96
127
|
|
97
|
-
describe
|
98
|
-
|
128
|
+
describe 'check_selinux', :os => :debian do
|
129
|
+
context 'enforcing' do
|
130
|
+
subject { commands.check_selinux('enforcing') }
|
131
|
+
it { should eq "/usr/sbin/getenforce | grep -i 'enforcing'" }
|
132
|
+
end
|
133
|
+
|
134
|
+
context 'permissive' do
|
135
|
+
subject { commands.check_selinux('permissive') }
|
136
|
+
it { should eq "/usr/sbin/getenforce | grep -i 'permissive'" }
|
137
|
+
end
|
138
|
+
|
139
|
+
context 'disabled' do
|
140
|
+
subject { commands.check_selinux('disabled') }
|
141
|
+
it { should eq "/usr/sbin/getenforce | grep -i 'disabled'" }
|
142
|
+
end
|
99
143
|
end
|
100
144
|
|
101
|
-
describe
|
145
|
+
describe 'get_mode', :os => :debian do
|
146
|
+
subject { commands.get_mode('/dev') }
|
102
147
|
it { should eq 'stat -c %a /dev' }
|
103
148
|
end
|
@@ -35,8 +35,6 @@ describe 'Serverspec matchers of Debian family', :os => :debian do
|
|
35
35
|
it_behaves_like 'support have_iptables_rule matcher', '-P INPUT ACCEPT'
|
36
36
|
it_behaves_like 'support have_iptables_rule.with_table.with_chain matcher', '-P INPUT ACCEPT', 'mangle', 'INPUT'
|
37
37
|
|
38
|
-
it_behaves_like 'support get_stdout matcher', 'whoami', 'root'
|
39
|
-
|
40
38
|
it_behaves_like 'support be_readable matcher', '/dev'
|
41
39
|
it_behaves_like 'support be_readable_by_owner matcher', '/dev'
|
42
40
|
it_behaves_like 'support be_readable_by_group matcher', '/dev'
|
@@ -1,103 +1,147 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
describe commands.check_enabled('httpd') do
|
3
|
+
describe 'check_enabled', :os => :gentoo do
|
4
|
+
subject { commands.check_enabled('httpd') }
|
6
5
|
it { should eq "/sbin/rc-update show | grep '^\\s*httpd\\s*|\\s*\\(boot\\|default\\)'" }
|
7
6
|
end
|
8
7
|
|
9
|
-
describe
|
8
|
+
describe 'check_file', :os => :gentoo do
|
9
|
+
subject { commands.check_file('/etc/passwd') }
|
10
10
|
it { should eq 'test -f /etc/passwd' }
|
11
11
|
end
|
12
12
|
|
13
|
-
describe
|
13
|
+
describe 'check_directory', :os => :gentoo do
|
14
|
+
subject { commands.check_directory('/var/log') }
|
14
15
|
it { should eq 'test -d /var/log' }
|
15
16
|
end
|
16
17
|
|
17
|
-
describe
|
18
|
+
describe 'check_user', :os => :gentoo do
|
19
|
+
subject { commands.check_user('root') }
|
18
20
|
it { should eq 'id root' }
|
19
21
|
end
|
20
22
|
|
21
|
-
describe
|
23
|
+
describe 'check_group', :os => :gentoo do
|
24
|
+
subject { commands.check_group('wheel') }
|
22
25
|
it { should eq 'getent group | grep -wq wheel' }
|
23
26
|
end
|
24
27
|
|
25
|
-
describe
|
28
|
+
describe 'check_installed', :os => :gentoo do
|
29
|
+
subject { commands.check_installed('httpd') }
|
26
30
|
it { should eq '/usr/bin/eix httpd --installed' }
|
27
31
|
end
|
28
32
|
|
29
|
-
describe
|
33
|
+
describe 'check_listening', :os => :gentoo do
|
34
|
+
subject { commands.check_listening(80) }
|
30
35
|
it { should eq "netstat -tunl | grep ':80 '" }
|
31
36
|
end
|
32
37
|
|
33
|
-
describe
|
38
|
+
describe 'check_running', :os => :gentoo do
|
39
|
+
subject { commands.check_running('httpd') }
|
34
40
|
it { should eq 'service httpd status' }
|
35
41
|
end
|
36
42
|
|
37
|
-
describe
|
43
|
+
describe 'check_running_under_supervisor', :os => :gentoo do
|
44
|
+
subject { commands.check_running_under_supervisor('httpd') }
|
38
45
|
it { should eq 'supervisorctl status httpd' }
|
39
46
|
end
|
40
47
|
|
41
|
-
describe
|
48
|
+
describe 'check_process', :os => :gentoo do
|
49
|
+
subject { commands.check_process('httpd') }
|
42
50
|
it { should eq 'ps aux | grep -w httpd | grep -qv grep' }
|
43
51
|
end
|
44
52
|
|
45
|
-
describe
|
53
|
+
describe 'check_file_contain', :os => :gentoo do
|
54
|
+
subject { commands.check_file_contain('/etc/passwd', 'root') }
|
46
55
|
it { should eq "grep -q 'root' /etc/passwd" }
|
47
56
|
end
|
48
57
|
|
49
|
-
describe
|
50
|
-
|
51
|
-
|
58
|
+
describe 'check_file_contain_within', :os => :gentoo do
|
59
|
+
context 'contain a pattern in the file' do
|
60
|
+
subject { commands.check_file_contain_within('Gemfile', 'rspec') }
|
61
|
+
it { should eq "sed -n '1,$p' Gemfile | grep -q 'rspec' -" }
|
62
|
+
end
|
52
63
|
|
53
|
-
|
54
|
-
|
55
|
-
|
64
|
+
context 'contain a pattern after a line in a file' do
|
65
|
+
subject { commands.check_file_contain_within('Gemfile', 'rspec', '/^group :test do/') }
|
66
|
+
it { should eq "sed -n '/^group :test do/,$p' Gemfile | grep -q 'rspec' -" }
|
67
|
+
end
|
56
68
|
|
57
|
-
|
58
|
-
|
59
|
-
end
|
69
|
+
context 'contain a pattern before a line in a file' do
|
70
|
+
subject {commands.check_file_contain_within('Gemfile', 'rspec', nil, '/^end/') }
|
71
|
+
it { should eq "sed -n '1,/^end/p' Gemfile | grep -q 'rspec' -" }
|
72
|
+
end
|
60
73
|
|
61
|
-
|
62
|
-
|
74
|
+
context 'contain a pattern from within a line and another line in a file' do
|
75
|
+
subject { commands.check_file_contain_within('Gemfile', 'rspec', '/^group :test do/', '/^end/') }
|
76
|
+
it { should eq "sed -n '/^group :test do/,/^end/p' Gemfile | grep -q 'rspec' -" }
|
77
|
+
end
|
63
78
|
end
|
64
79
|
|
65
|
-
describe
|
80
|
+
describe 'check_mode', :os => :gentoo do
|
81
|
+
subject { commands.check_mode('/etc/sudoers', 440) }
|
66
82
|
it { should eq 'stat -c %a /etc/sudoers | grep \'^440$\'' }
|
67
83
|
end
|
68
84
|
|
69
|
-
describe
|
85
|
+
describe 'check_owner', :os => :gentoo do
|
86
|
+
subject { commands.check_owner('/etc/passwd', 'root') }
|
70
87
|
it { should eq 'stat -c %U /etc/passwd | grep \'^root$\'' }
|
71
88
|
end
|
72
89
|
|
73
|
-
describe
|
90
|
+
describe 'check_grouped', :os => :gentoo do
|
91
|
+
subject { commands.check_grouped('/etc/passwd', 'wheel') }
|
74
92
|
it { should eq 'stat -c %G /etc/passwd | grep \'^wheel$\'' }
|
75
93
|
end
|
76
94
|
|
77
|
-
describe
|
95
|
+
describe 'check_cron_entry', :os => :gentoo do
|
96
|
+
subject { commands.check_cron_entry('root', '* * * * * /usr/local/bin/batch.sh') }
|
78
97
|
it { should eq 'crontab -u root -l | grep "\* \* \* \* \* /usr/local/bin/batch.sh"' }
|
79
98
|
end
|
80
99
|
|
81
|
-
describe
|
100
|
+
describe 'check_link', :os => :gentoo do
|
101
|
+
subject { commands.check_link('/etc/system-release', '/etc/redhat-release') }
|
82
102
|
it { should eq 'stat -c %N /etc/system-release | grep /etc/redhat-release' }
|
83
103
|
end
|
84
104
|
|
85
|
-
describe
|
105
|
+
describe 'check_installed_by_gem', :os => :gentoo do
|
106
|
+
subject { commands.check_installed_by_gem('jekyll') }
|
86
107
|
it { should eq 'gem list --local | grep \'^jekyll \'' }
|
87
108
|
end
|
88
109
|
|
89
|
-
describe
|
110
|
+
describe 'check_belonging_group', :os => :gentoo do
|
111
|
+
subject { commands.check_belonging_group('root', 'wheel') }
|
90
112
|
it { should eq "id root | awk '{print $3}' | grep wheel" }
|
91
113
|
end
|
92
114
|
|
93
|
-
describe
|
94
|
-
|
115
|
+
describe 'check_ipatbles', :os => :gentoo do
|
116
|
+
context 'check a rule without a table and a chain' do
|
117
|
+
subject { commands.check_iptables_rule('-P INPUT ACCEPT') }
|
118
|
+
it { should eq "iptables -S | grep '\\-P INPUT ACCEPT'" }
|
119
|
+
end
|
120
|
+
|
121
|
+
context 'chack a rule with a table and a chain' do
|
122
|
+
subject { commands.check_iptables_rule('-P INPUT ACCEPT', 'mangle', 'INPUT') }
|
123
|
+
it { should eq "iptables -t mangle -S INPUT | grep '\\-P INPUT ACCEPT'" }
|
124
|
+
end
|
95
125
|
end
|
96
126
|
|
97
|
-
describe
|
98
|
-
|
127
|
+
describe 'check_selinux', :os => :gentoo do
|
128
|
+
context 'enforcing' do
|
129
|
+
subject { commands.check_selinux('enforcing') }
|
130
|
+
it { should eq "/usr/sbin/getenforce | grep -i 'enforcing'" }
|
131
|
+
end
|
132
|
+
|
133
|
+
context 'permissive' do
|
134
|
+
subject { commands.check_selinux('permissive') }
|
135
|
+
it { should eq "/usr/sbin/getenforce | grep -i 'permissive'" }
|
136
|
+
end
|
137
|
+
|
138
|
+
context 'disabled' do
|
139
|
+
subject { commands.check_selinux('disabled') }
|
140
|
+
it { should eq "/usr/sbin/getenforce | grep -i 'disabled'" }
|
141
|
+
end
|
99
142
|
end
|
100
143
|
|
101
|
-
describe
|
144
|
+
describe 'get_mode', :os => :gentoo do
|
145
|
+
subject { commands.get_mode('/dev') }
|
102
146
|
it { should eq 'stat -c %a /dev' }
|
103
147
|
end
|
@@ -36,8 +36,6 @@ describe 'Serverspec matchers of Gentoo family', :os => :gentoo do
|
|
36
36
|
it_behaves_like 'support have_iptables_rule matcher', '-P INPUT ACCEPT'
|
37
37
|
it_behaves_like 'support have_iptables_rule.with_table.with_chain matcher', '-P INPUT ACCEPT', 'mangle', 'INPUT'
|
38
38
|
|
39
|
-
it_behaves_like 'support get_stdout matcher', 'whoami', 'root'
|
40
|
-
|
41
39
|
it_behaves_like 'support be_readable matcher', '/dev'
|
42
40
|
it_behaves_like 'support be_readable_by_owner matcher', '/dev'
|
43
41
|
it_behaves_like 'support be_readable_by_group matcher', '/dev'
|
@@ -1,103 +1,147 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
describe commands.check_enabled('httpd') do
|
3
|
+
describe 'check_enabled', :os => :redhat do
|
4
|
+
subject { commands.check_enabled('httpd') }
|
6
5
|
it { should eq 'chkconfig --list httpd | grep 3:on' }
|
7
6
|
end
|
8
7
|
|
9
|
-
describe
|
8
|
+
describe 'check_file', :os => :redhat do
|
9
|
+
subject { commands.check_file('/etc/passwd') }
|
10
10
|
it { should eq 'test -f /etc/passwd' }
|
11
11
|
end
|
12
12
|
|
13
|
-
describe
|
13
|
+
describe 'check_directory', :os => :redhat do
|
14
|
+
subject { commands.check_directory('/var/log') }
|
14
15
|
it { should eq 'test -d /var/log' }
|
15
16
|
end
|
16
17
|
|
17
|
-
describe
|
18
|
+
describe 'check_user', :os => :redhat do
|
19
|
+
subject { commands.check_user('root') }
|
18
20
|
it { should eq 'id root' }
|
19
21
|
end
|
20
22
|
|
21
|
-
describe
|
23
|
+
describe 'check_group', :os => :redhat do
|
24
|
+
subject { commands.check_group('wheel') }
|
22
25
|
it { should eq 'getent group | grep -wq wheel' }
|
23
26
|
end
|
24
27
|
|
25
|
-
describe
|
28
|
+
describe 'check_installed', :os => :redhat do
|
29
|
+
subject { commands.check_installed('httpd') }
|
26
30
|
it { should eq 'rpm -q httpd' }
|
27
31
|
end
|
28
32
|
|
29
|
-
describe
|
33
|
+
describe 'check_listening', :os => :redhat do
|
34
|
+
subject { commands.check_listening(80) }
|
30
35
|
it { should eq "netstat -tunl | grep ':80 '" }
|
31
36
|
end
|
32
37
|
|
33
|
-
describe
|
38
|
+
describe 'check_running', :os => :redhat do
|
39
|
+
subject { commands.check_running('httpd') }
|
34
40
|
it { should eq 'service httpd status' }
|
35
41
|
end
|
36
42
|
|
37
|
-
describe
|
43
|
+
describe 'check_running_under_supervisor', :os => :redhat do
|
44
|
+
subject { commands.check_running_under_supervisor('httpd') }
|
38
45
|
it { should eq 'supervisorctl status httpd' }
|
39
46
|
end
|
40
47
|
|
41
|
-
describe
|
48
|
+
describe 'check_process', :os => :redhat do
|
49
|
+
subject { commands.check_process('httpd') }
|
42
50
|
it { should eq 'ps aux | grep -w httpd | grep -qv grep' }
|
43
51
|
end
|
44
52
|
|
45
|
-
describe
|
53
|
+
describe 'check_file_contain', :os => :redhat do
|
54
|
+
subject { commands.check_file_contain('/etc/passwd', 'root') }
|
46
55
|
it { should eq "grep -q 'root' /etc/passwd" }
|
47
56
|
end
|
48
57
|
|
49
|
-
describe
|
50
|
-
|
51
|
-
|
58
|
+
describe 'check_file_contain_within', :os => :redhat do
|
59
|
+
context 'contain a pattern in the file' do
|
60
|
+
subject { commands.check_file_contain_within('Gemfile', 'rspec') }
|
61
|
+
it { should eq "sed -n '1,$p' Gemfile | grep -q 'rspec' -" }
|
62
|
+
end
|
52
63
|
|
53
|
-
|
54
|
-
|
55
|
-
|
64
|
+
context 'contain a pattern after a line in a file' do
|
65
|
+
subject { commands.check_file_contain_within('Gemfile', 'rspec', '/^group :test do/') }
|
66
|
+
it { should eq "sed -n '/^group :test do/,$p' Gemfile | grep -q 'rspec' -" }
|
67
|
+
end
|
56
68
|
|
57
|
-
|
58
|
-
|
59
|
-
end
|
69
|
+
context 'contain a pattern before a line in a file' do
|
70
|
+
subject {commands.check_file_contain_within('Gemfile', 'rspec', nil, '/^end/') }
|
71
|
+
it { should eq "sed -n '1,/^end/p' Gemfile | grep -q 'rspec' -" }
|
72
|
+
end
|
60
73
|
|
61
|
-
|
62
|
-
|
74
|
+
context 'contain a pattern from within a line and another line in a file' do
|
75
|
+
subject { commands.check_file_contain_within('Gemfile', 'rspec', '/^group :test do/', '/^end/') }
|
76
|
+
it { should eq "sed -n '/^group :test do/,/^end/p' Gemfile | grep -q 'rspec' -" }
|
77
|
+
end
|
63
78
|
end
|
64
79
|
|
65
|
-
describe
|
80
|
+
describe 'check_mode', :os => :redhat do
|
81
|
+
subject { commands.check_mode('/etc/sudoers', 440) }
|
66
82
|
it { should eq 'stat -c %a /etc/sudoers | grep \'^440$\'' }
|
67
83
|
end
|
68
84
|
|
69
|
-
describe
|
85
|
+
describe 'check_owner', :os => :redhat do
|
86
|
+
subject { commands.check_owner('/etc/passwd', 'root') }
|
70
87
|
it { should eq 'stat -c %U /etc/passwd | grep \'^root$\'' }
|
71
88
|
end
|
72
89
|
|
73
|
-
describe
|
90
|
+
describe 'check_grouped', :os => :redhat do
|
91
|
+
subject { commands.check_grouped('/etc/passwd', 'wheel') }
|
74
92
|
it { should eq 'stat -c %G /etc/passwd | grep \'^wheel$\'' }
|
75
93
|
end
|
76
94
|
|
77
|
-
describe
|
95
|
+
describe 'check_cron_entry', :os => :redhat do
|
96
|
+
subject { commands.check_cron_entry('root', '* * * * * /usr/local/bin/batch.sh') }
|
78
97
|
it { should eq 'crontab -u root -l | grep "\* \* \* \* \* /usr/local/bin/batch.sh"' }
|
79
98
|
end
|
80
99
|
|
81
|
-
describe
|
100
|
+
describe 'check_link', :os => :redhat do
|
101
|
+
subject { commands.check_link('/etc/system-release', '/etc/redhat-release') }
|
82
102
|
it { should eq 'stat -c %N /etc/system-release | grep /etc/redhat-release' }
|
83
103
|
end
|
84
104
|
|
85
|
-
describe
|
105
|
+
describe 'check_installed_by_gem', :os => :redhat do
|
106
|
+
subject { commands.check_installed_by_gem('jekyll') }
|
86
107
|
it { should eq 'gem list --local | grep \'^jekyll \'' }
|
87
108
|
end
|
88
109
|
|
89
|
-
describe
|
110
|
+
describe 'check_belonging_group', :os => :redhat do
|
111
|
+
subject { commands.check_belonging_group('root', 'wheel') }
|
90
112
|
it { should eq "id root | awk '{print $3}' | grep wheel" }
|
91
113
|
end
|
92
114
|
|
93
|
-
describe
|
94
|
-
|
115
|
+
describe 'check_ipatbles', :os => :redhat do
|
116
|
+
context 'check a rule without a table and a chain' do
|
117
|
+
subject { commands.check_iptables_rule('-P INPUT ACCEPT') }
|
118
|
+
it { should eq "iptables -S | grep '\\-P INPUT ACCEPT'" }
|
119
|
+
end
|
120
|
+
|
121
|
+
context 'chack a rule with a table and a chain' do
|
122
|
+
subject { commands.check_iptables_rule('-P INPUT ACCEPT', 'mangle', 'INPUT') }
|
123
|
+
it { should eq "iptables -t mangle -S INPUT | grep '\\-P INPUT ACCEPT'" }
|
124
|
+
end
|
95
125
|
end
|
96
126
|
|
97
|
-
describe
|
98
|
-
|
127
|
+
describe 'check_selinux', :os => :redhat do
|
128
|
+
context 'enforcing' do
|
129
|
+
subject { commands.check_selinux('enforcing') }
|
130
|
+
it { should eq "/usr/sbin/getenforce | grep -i 'enforcing'" }
|
131
|
+
end
|
132
|
+
|
133
|
+
context 'permissive' do
|
134
|
+
subject { commands.check_selinux('permissive') }
|
135
|
+
it { should eq "/usr/sbin/getenforce | grep -i 'permissive'" }
|
136
|
+
end
|
137
|
+
|
138
|
+
context 'disabled' do
|
139
|
+
subject { commands.check_selinux('disabled') }
|
140
|
+
it { should eq "/usr/sbin/getenforce | grep -i 'disabled'" }
|
141
|
+
end
|
99
142
|
end
|
100
143
|
|
101
|
-
describe
|
144
|
+
describe 'get_mode', :os => :redhat do
|
145
|
+
subject { commands.get_mode('/dev') }
|
102
146
|
it { should eq 'stat -c %a /dev' }
|
103
147
|
end
|
@@ -37,8 +37,6 @@ describe 'Serverspec matchers of Red Hat family', :os => :redhat do
|
|
37
37
|
it_behaves_like 'support have_iptables_rule matcher', '-P INPUT ACCEPT'
|
38
38
|
it_behaves_like 'support have_iptables_rule.with_table.with_chain matcher', '-P INPUT ACCEPT', 'mangle', 'INPUT'
|
39
39
|
|
40
|
-
it_behaves_like 'support get_stdout matcher', 'whoami', 'root'
|
41
|
-
|
42
40
|
it_behaves_like 'support be_readable matcher', '/dev'
|
43
41
|
it_behaves_like 'support be_readable_by_owner matcher', '/dev'
|
44
42
|
it_behaves_like 'support be_readable_by_group matcher', '/dev'
|
@@ -54,6 +52,10 @@ describe 'Serverspec matchers of Red Hat family', :os => :redhat do
|
|
54
52
|
it_behaves_like 'support be_executable_by_group matcher', '/dev'
|
55
53
|
it_behaves_like 'support be_executable_by_others matcher', '/dev'
|
56
54
|
|
55
|
+
it_behaves_like 'support be_enforcing matcher', 'selinux'
|
56
|
+
it_behaves_like 'support be_permissive matcher', 'selinux'
|
57
|
+
it_behaves_like 'support be_disabled matcher', 'selinux'
|
58
|
+
|
57
59
|
it_behaves_like 'support return_exit_status matcher', 'ls /tmp', 0
|
58
60
|
|
59
61
|
it_behaves_like 'support return_stdout matcher', 'cat /etc/resolv.conf', 'localhost'
|
@@ -1,139 +1,162 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
describe commands.check_enabled('httpd') do
|
3
|
+
describe 'check_enabled', :os => :solaris do
|
4
|
+
subject { commands.check_enabled('httpd') }
|
6
5
|
it { should eq "svcs -l httpd 2> /dev/null | grep 'enabled true'" }
|
7
6
|
end
|
8
7
|
|
9
|
-
describe
|
8
|
+
describe 'check_file', :os => :solaris do
|
9
|
+
subject { commands.check_file('/etc/passwd') }
|
10
10
|
it { should eq 'test -f /etc/passwd' }
|
11
11
|
end
|
12
12
|
|
13
|
-
describe
|
13
|
+
describe 'check_directory', :os => :solaris do
|
14
|
+
subject { commands.check_directory('/var/log') }
|
14
15
|
it { should eq 'test -d /var/log' }
|
15
16
|
end
|
16
17
|
|
17
|
-
describe
|
18
|
+
describe 'check_user', :os => :solaris do
|
19
|
+
subject { commands.check_user('root') }
|
18
20
|
it { should eq 'id root' }
|
19
21
|
end
|
20
22
|
|
21
|
-
describe
|
23
|
+
describe 'check_group', :os => :solaris do
|
24
|
+
subject { commands.check_group('wheel') }
|
22
25
|
it { should eq 'getent group | grep -wq wheel' }
|
23
26
|
end
|
24
27
|
|
25
|
-
describe
|
28
|
+
describe 'check_installed', :os => :solaris do
|
29
|
+
subject { commands.check_installed('httpd') }
|
26
30
|
it { should eq 'pkg list -H httpd 2> /dev/null' }
|
27
31
|
end
|
28
32
|
|
29
|
-
describe
|
33
|
+
describe 'check_listening', :os => :solaris do
|
34
|
+
subject { commands.check_listening(80) }
|
30
35
|
it { should eq "netstat -an 2> /dev/null | egrep 'LISTEN|Idle' | grep '.80 '" }
|
31
36
|
end
|
32
37
|
|
33
|
-
describe
|
38
|
+
describe 'check_running', :os => :solaris do
|
39
|
+
subject { commands.check_running('httpd') }
|
34
40
|
it { should eq "svcs -l httpd status 2> /dev/null |grep 'state online'" }
|
35
41
|
end
|
36
42
|
|
37
|
-
describe
|
43
|
+
describe 'check_running_under_supervisor', :os => :solaris do
|
44
|
+
subject { commands.check_running_under_supervisor('httpd') }
|
38
45
|
it { should eq 'supervisorctl status httpd' }
|
39
46
|
end
|
40
47
|
|
41
|
-
describe
|
48
|
+
describe 'check_process', :os => :solaris do
|
49
|
+
subject { commands.check_process('httpd') }
|
42
50
|
it { should eq 'ps aux | grep -w httpd | grep -qv grep' }
|
43
51
|
end
|
44
52
|
|
45
|
-
describe
|
53
|
+
describe 'check_file_contain', :os => :solaris do
|
54
|
+
subject { commands.check_file_contain('/etc/passwd', 'root') }
|
46
55
|
it { should eq "grep -q 'root' /etc/passwd" }
|
47
56
|
end
|
48
57
|
|
49
|
-
describe
|
50
|
-
|
51
|
-
|
58
|
+
describe 'check_file_contain_within', :os => :solaris do
|
59
|
+
context 'contain a pattern in the file' do
|
60
|
+
subject { commands.check_file_contain_within('Gemfile', 'rspec') }
|
61
|
+
it { should eq "sed -n '1,$p' Gemfile | grep -q 'rspec' -" }
|
62
|
+
end
|
52
63
|
|
53
|
-
|
54
|
-
|
55
|
-
|
64
|
+
context 'contain a pattern after a line in a file' do
|
65
|
+
subject { commands.check_file_contain_within('Gemfile', 'rspec', '/^group :test do/') }
|
66
|
+
it { should eq "sed -n '/^group :test do/,$p' Gemfile | grep -q 'rspec' -" }
|
67
|
+
end
|
56
68
|
|
57
|
-
|
58
|
-
|
59
|
-
end
|
69
|
+
context 'contain a pattern before a line in a file' do
|
70
|
+
subject {commands.check_file_contain_within('Gemfile', 'rspec', nil, '/^end/') }
|
71
|
+
it { should eq "sed -n '1,/^end/p' Gemfile | grep -q 'rspec' -" }
|
72
|
+
end
|
60
73
|
|
61
|
-
|
62
|
-
|
74
|
+
context 'contain a pattern from within a line and another line in a file' do
|
75
|
+
subject { commands.check_file_contain_within('Gemfile', 'rspec', '/^group :test do/', '/^end/') }
|
76
|
+
it { should eq "sed -n '/^group :test do/,/^end/p' Gemfile | grep -q 'rspec' -" }
|
77
|
+
end
|
63
78
|
end
|
64
79
|
|
65
|
-
describe
|
80
|
+
describe 'check_mode', :os => :solaris do
|
81
|
+
subject { commands.check_mode('/etc/sudoers', 440) }
|
66
82
|
it { should eq 'stat -c %a /etc/sudoers | grep \'^440$\'' }
|
67
83
|
end
|
68
84
|
|
69
|
-
describe
|
85
|
+
describe 'check_owner', :os => :solaris do
|
86
|
+
subject { commands.check_owner('/etc/passwd', 'root') }
|
70
87
|
it { should eq 'stat -c %U /etc/passwd | grep \'^root$\'' }
|
71
88
|
end
|
72
89
|
|
73
|
-
describe
|
90
|
+
describe 'check_grouped', :os => :solaris do
|
91
|
+
subject { commands.check_grouped('/etc/passwd', 'wheel') }
|
74
92
|
it { should eq 'stat -c %G /etc/passwd | grep \'^wheel$\'' }
|
75
93
|
end
|
76
94
|
|
77
|
-
describe
|
95
|
+
describe 'check_cron_entry', :os => :solaris do
|
96
|
+
subject { commands.check_cron_entry('root', '* * * * * /usr/local/bin/batch.sh') }
|
78
97
|
it { should eq "crontab -l root | grep '\\* \\* \\* \\* \\* /usr/local/bin/batch.sh'" }
|
79
98
|
end
|
80
99
|
|
81
|
-
describe
|
100
|
+
describe 'check_link', :os => :solaris do
|
101
|
+
subject { commands.check_link('/etc/system-release', '/etc/redhat-release') }
|
82
102
|
it { should eq 'stat -c %N /etc/system-release | grep /etc/redhat-release' }
|
83
103
|
end
|
84
104
|
|
85
|
-
describe
|
105
|
+
describe 'check_installed_by_gem', :os => :solaris do
|
106
|
+
subject { commands.check_installed_by_gem('jekyll') }
|
86
107
|
it { should eq 'gem list --local | grep \'^jekyll \'' }
|
87
108
|
end
|
88
109
|
|
89
|
-
describe
|
110
|
+
describe 'check_belonging_group', :os => :solaris do
|
111
|
+
subject { commands.check_belonging_group('root', 'wheel') }
|
90
112
|
it { should eq "id root | awk '{print $3}' | grep wheel" }
|
91
113
|
end
|
92
114
|
|
93
|
-
describe commands.check_zfs('rpool') do
|
94
|
-
it { should eq "/sbin/zfs list -H rpool" }
|
95
|
-
end
|
96
|
-
|
97
|
-
describe commands.check_zfs('rpool', { 'mountpoint' => '/rpool' }) do
|
98
|
-
it { should eq "/sbin/zfs list -H -o mountpoint rpool | grep ^/rpool$" }
|
99
|
-
end
|
100
115
|
|
101
|
-
describe
|
102
|
-
|
103
|
-
|
116
|
+
describe 'check_zfs', :os => :solaris do
|
117
|
+
context 'check without properties' do
|
118
|
+
subject { commands.check_zfs('rpool') }
|
119
|
+
it { should eq "/sbin/zfs list -H rpool" }
|
120
|
+
end
|
104
121
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
122
|
+
context 'check with a property' do
|
123
|
+
subject { commands.check_zfs('rpool', { 'mountpoint' => '/rpool' }) }
|
124
|
+
it { should eq "/sbin/zfs list -H -o mountpoint rpool | grep ^/rpool$" }
|
125
|
+
end
|
109
126
|
|
110
|
-
|
111
|
-
|
127
|
+
context 'check with multiple properties' do
|
128
|
+
subject { commands.check_zfs('rpool', { 'mountpoint' => '/rpool', 'compression' => 'off' }) }
|
129
|
+
it { should eq "/sbin/zfs list -H -o compression rpool | grep ^off$ && /sbin/zfs list -H -o mountpoint rpool | grep ^/rpool$" }
|
130
|
+
end
|
112
131
|
end
|
113
132
|
|
114
|
-
describe
|
133
|
+
describe 'get_mode', :os => :solaris do
|
134
|
+
subject { commands.get_mode('/dev') }
|
115
135
|
it { should eq 'stat -c %a /dev' }
|
116
136
|
end
|
117
137
|
|
118
|
-
describe
|
138
|
+
describe 'check_ip_filter_rule', :os => :solaris do
|
139
|
+
subject { commands.check_ipfilter_rule('pass in quick on lo0 all') }
|
119
140
|
it { should eq "/sbin/ipfstat -io 2> /dev/null | grep 'pass in quick on lo0 all'" }
|
120
141
|
end
|
121
142
|
|
122
|
-
describe
|
143
|
+
describe 'check_ipnat_rule', :os => :solaris do
|
144
|
+
subject { commands.check_ipnat_rule('map net1 192.168.0.0/24 -> 0.0.0.0/32') }
|
123
145
|
it { should eq "/sbin/ipnat -l 2> /dev/null | grep '^map net1 192.168.0.0/24 -> 0.0.0.0/32$'" }
|
124
146
|
end
|
125
147
|
|
126
|
-
|
127
|
-
|
128
|
-
describe commands.check_svcprop('svc:/network/http:apache22',
|
129
|
-
'httpd/enable_64bit','false') do
|
148
|
+
describe 'check_svcprop', :os => :solaris do
|
149
|
+
subject { commands.check_svcprop('svc:/network/http:apache22', 'httpd/enable_64bit','false') }
|
130
150
|
it { should eq "svcprop -p httpd/enable_64bit svc:/network/http:apache22 | grep ^false$" }
|
131
151
|
end
|
132
152
|
|
133
|
-
describe
|
134
|
-
|
135
|
-
|
136
|
-
|
153
|
+
describe 'check_svcprops', :os => :solaris do
|
154
|
+
subject {
|
155
|
+
commands.check_svcprops('svc:/network/http:apache22', {
|
156
|
+
'httpd/enable_64bit' => 'false',
|
157
|
+
'httpd/server_type' => 'worker',
|
158
|
+
})
|
159
|
+
}
|
137
160
|
it { should eq "svcprop -p httpd/enable_64bit svc:/network/http:apache22 | grep ^false$ && svcprop -p httpd/server_type svc:/network/http:apache22 | grep ^worker$" }
|
138
161
|
end
|
139
162
|
|
@@ -33,7 +33,6 @@ describe 'Serverspec matchers of Solaris family', :os => :solaris do
|
|
33
33
|
|
34
34
|
it_behaves_like 'support belong_to_group matcher', 'root', 'root'
|
35
35
|
|
36
|
-
it_behaves_like 'support get_stdout matcher', 'whoami', 'root'
|
37
36
|
it_behaves_like 'support be_zfs matcher', 'rpool'
|
38
37
|
it_behaves_like 'support be_zfs.property matcher', 'rpool', { 'mountpoint' => '/rpool' }
|
39
38
|
|
@@ -226,6 +226,24 @@ shared_examples_for 'support be_grouped_into matcher' do |valid_file, group|
|
|
226
226
|
end
|
227
227
|
end
|
228
228
|
|
229
|
+
shared_examples_for 'support be_enforcing matcher' do |selinux|
|
230
|
+
describe selinux do
|
231
|
+
it { should be_enforcing }
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
235
|
+
shared_examples_for 'support be_permissive matcher' do |selinux|
|
236
|
+
describe selinux do
|
237
|
+
it { should be_permissive }
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
shared_examples_for 'support be_disabled matcher' do |selinux|
|
242
|
+
describe selinux do
|
243
|
+
it { should be_disabled }
|
244
|
+
end
|
245
|
+
end
|
246
|
+
|
229
247
|
shared_examples_for 'support have_cron_entry matcher' do |title, entry|
|
230
248
|
describe 'have_cron_entry' do
|
231
249
|
describe title do
|
@@ -328,22 +346,6 @@ shared_examples_for 'support have_iptables_rule.with_table.with_chain matcher' d
|
|
328
346
|
end
|
329
347
|
end
|
330
348
|
|
331
|
-
shared_examples_for 'support get_stdout matcher' do |command, output|
|
332
|
-
before :all do
|
333
|
-
RSpec.configure do |c|
|
334
|
-
c.stdout = "#{output}\r\n"
|
335
|
-
end
|
336
|
-
end
|
337
|
-
|
338
|
-
describe command do
|
339
|
-
it { should get_stdout output }
|
340
|
-
end
|
341
|
-
|
342
|
-
describe command do
|
343
|
-
it { should_not get_stdout 'invalid-output' }
|
344
|
-
end
|
345
|
-
end
|
346
|
-
|
347
349
|
shared_examples_for 'support be_zfs matcher' do |zfs|
|
348
350
|
describe 'be_zfs' do
|
349
351
|
describe zfs do
|
metadata
CHANGED
@@ -1,104 +1,105 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: serverspec
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 13
|
10
|
-
version: 0.2.13
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.14
|
5
|
+
prerelease:
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Gosuke Miyashita
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2013-04-27 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: net-ssh
|
23
|
-
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
25
17
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
version: "0"
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
33
22
|
type: :runtime
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: rspec
|
37
23
|
prerelease: false
|
38
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rspec
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
39
33
|
none: false
|
40
|
-
requirements:
|
41
|
-
- -
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
44
|
-
segments:
|
45
|
-
- 0
|
46
|
-
version: "0"
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
47
38
|
type: :runtime
|
48
|
-
version_requirements: *id002
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
name: highline
|
51
39
|
prerelease: false
|
52
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: highline
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
53
49
|
none: false
|
54
|
-
requirements:
|
55
|
-
- -
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
|
58
|
-
segments:
|
59
|
-
- 0
|
60
|
-
version: "0"
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
61
54
|
type: :runtime
|
62
|
-
version_requirements: *id003
|
63
|
-
- !ruby/object:Gem::Dependency
|
64
|
-
name: bundler
|
65
55
|
prerelease: false
|
66
|
-
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
57
|
none: false
|
68
|
-
requirements:
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: bundler
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
69
67
|
- - ~>
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
|
72
|
-
segments:
|
73
|
-
- 1
|
74
|
-
- 3
|
75
|
-
version: "1.3"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '1.3'
|
76
70
|
type: :development
|
77
|
-
version_requirements: *id004
|
78
|
-
- !ruby/object:Gem::Dependency
|
79
|
-
name: rake
|
80
71
|
prerelease: false
|
81
|
-
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '1.3'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rake
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
82
81
|
none: false
|
83
|
-
requirements:
|
84
|
-
- -
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
|
87
|
-
segments:
|
88
|
-
- 0
|
89
|
-
version: "0"
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
90
86
|
type: :development
|
91
|
-
|
92
|
-
|
93
|
-
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
description: RSpec tests for your servers provisioned by Puppet, Chef or anything
|
95
|
+
else
|
96
|
+
email:
|
94
97
|
- gosukenator@gmail.com
|
95
|
-
executables:
|
98
|
+
executables:
|
96
99
|
- serverspec-init
|
97
100
|
extensions: []
|
98
|
-
|
99
101
|
extra_rdoc_files: []
|
100
|
-
|
101
|
-
files:
|
102
|
+
files:
|
102
103
|
- .gitignore
|
103
104
|
- .travis.yml
|
104
105
|
- Gemfile
|
@@ -128,7 +129,9 @@ files:
|
|
128
129
|
- lib/serverspec/helper/ssh.rb
|
129
130
|
- lib/serverspec/matchers.rb
|
130
131
|
- lib/serverspec/matchers/be_directory.rb
|
132
|
+
- lib/serverspec/matchers/be_disabled.rb
|
131
133
|
- lib/serverspec/matchers/be_enabled.rb
|
134
|
+
- lib/serverspec/matchers/be_enforcing.rb
|
132
135
|
- lib/serverspec/matchers/be_executable.rb
|
133
136
|
- lib/serverspec/matchers/be_file.rb
|
134
137
|
- lib/serverspec/matchers/be_group.rb
|
@@ -139,6 +142,7 @@ files:
|
|
139
142
|
- lib/serverspec/matchers/be_listening.rb
|
140
143
|
- lib/serverspec/matchers/be_mode.rb
|
141
144
|
- lib/serverspec/matchers/be_owned_by.rb
|
145
|
+
- lib/serverspec/matchers/be_permissive.rb
|
142
146
|
- lib/serverspec/matchers/be_readable.rb
|
143
147
|
- lib/serverspec/matchers/be_running.rb
|
144
148
|
- lib/serverspec/matchers/be_user.rb
|
@@ -169,41 +173,32 @@ files:
|
|
169
173
|
- spec/solaris/matchers_spec.rb
|
170
174
|
- spec/spec_helper.rb
|
171
175
|
- spec/support/shared_matcher_examples.rb
|
172
|
-
has_rdoc: true
|
173
176
|
homepage: http://serverspec.org/
|
174
|
-
licenses:
|
177
|
+
licenses:
|
175
178
|
- MIT
|
176
179
|
post_install_message:
|
177
180
|
rdoc_options: []
|
178
|
-
|
179
|
-
require_paths:
|
181
|
+
require_paths:
|
180
182
|
- lib
|
181
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
183
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
182
184
|
none: false
|
183
|
-
requirements:
|
184
|
-
- -
|
185
|
-
- !ruby/object:Gem::Version
|
186
|
-
|
187
|
-
|
188
|
-
- 0
|
189
|
-
version: "0"
|
190
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
185
|
+
requirements:
|
186
|
+
- - ! '>='
|
187
|
+
- !ruby/object:Gem::Version
|
188
|
+
version: '0'
|
189
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
191
190
|
none: false
|
192
|
-
requirements:
|
193
|
-
- -
|
194
|
-
- !ruby/object:Gem::Version
|
195
|
-
|
196
|
-
segments:
|
197
|
-
- 0
|
198
|
-
version: "0"
|
191
|
+
requirements:
|
192
|
+
- - ! '>='
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
199
195
|
requirements: []
|
200
|
-
|
201
196
|
rubyforge_project:
|
202
|
-
rubygems_version: 1.
|
197
|
+
rubygems_version: 1.8.25
|
203
198
|
signing_key:
|
204
199
|
specification_version: 3
|
205
200
|
summary: RSpec tests for your servers provisioned by Puppet, Chef or anything else
|
206
|
-
test_files:
|
201
|
+
test_files:
|
207
202
|
- spec/debian/commands_spec.rb
|
208
203
|
- spec/debian/matchers_spec.rb
|
209
204
|
- spec/gentoo/commands_spec.rb
|