serverspec 0.10.5 → 0.10.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/serverspec/type/command.rb +14 -0
- data/lib/serverspec/version.rb +1 -1
- data/spec/aix/command_spec.rb +19 -0
- data/spec/darwin/command_spec.rb +19 -0
- data/spec/debian/command_spec.rb +19 -0
- data/spec/freebsd/command_spec.rb +19 -0
- data/spec/gentoo/command_spec.rb +19 -0
- data/spec/plamo/command_spec.rb +19 -0
- data/spec/redhat/command_spec.rb +21 -0
- data/spec/solaris/command_spec.rb +19 -0
- data/spec/solaris11/command_spec.rb +19 -0
- metadata +2 -8
- data/spec/redhat/commands_spec.rb +0 -15
- data/spec/smartos/commands_spec.rb +0 -59
- data/spec/solaris10/commands_spec.rb +0 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22e4b599ab3a4fc8ff81faf1e55f41712e109631
|
4
|
+
data.tar.gz: 7dd6658d68a7ab903add025a20225b151985e9c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e929ccd2fd728a64bfd5e612319ec8d17c247f8dd7d1bc08bb590a70c8afc2c47c9deb69a0c8d101e8d98d7af004bb843c6d66e063a3817f9aa3188e4d334556
|
7
|
+
data.tar.gz: 79b9091221264fb2ae68cdd43d3170acf804024bf2b5028d8f879a9e621f177c8f52c00f577b7193b8314588e0cf60ed705f1af653c757f00894caec2a761b58
|
@@ -1,6 +1,8 @@
|
|
1
1
|
module Serverspec
|
2
2
|
module Type
|
3
3
|
class Command < Base
|
4
|
+
attr_accessor :result
|
5
|
+
|
4
6
|
def return_stdout?(content)
|
5
7
|
ret = backend.run_command(@name)
|
6
8
|
if content.instance_of?(Regexp)
|
@@ -26,6 +28,18 @@ module Serverspec
|
|
26
28
|
ret = backend.run_command(@name)
|
27
29
|
ret[:exit_status].to_i == status
|
28
30
|
end
|
31
|
+
|
32
|
+
def stdout
|
33
|
+
if @result.nil?
|
34
|
+
@result = backend.run_command(@name)[:stdout]
|
35
|
+
end
|
36
|
+
@result
|
37
|
+
end
|
38
|
+
|
39
|
+
# In ssh access with pty, stderr is merged to stdout
|
40
|
+
# See http://stackoverflow.com/questions/7937651/receiving-extended-data-with-ssh-using-twisted-conch-as-client
|
41
|
+
# So I use stdout instead of stderr
|
42
|
+
alias :stderr :stdout
|
29
43
|
end
|
30
44
|
end
|
31
45
|
end
|
data/lib/serverspec/version.rb
CHANGED
data/spec/aix/command_spec.rb
CHANGED
@@ -48,3 +48,22 @@ describe command('cat /etc/resolv.conf') do
|
|
48
48
|
it { should return_exit_status 0 }
|
49
49
|
its(:command) { should eq 'cat /etc/resolv.conf' }
|
50
50
|
end
|
51
|
+
|
52
|
+
describe command('ls -al /') do
|
53
|
+
let(:stdout) { <<EOF
|
54
|
+
total 88
|
55
|
+
drwxr-xr-x 23 root root 4096 Oct 10 17:19 .
|
56
|
+
drwxr-xr-x 23 root root 4096 Oct 10 17:19 ..
|
57
|
+
drwxr-xr-x 2 root root 4096 Sep 11 16:43 bin
|
58
|
+
drwxr-xr-x 3 root root 4096 Sep 23 18:14 boot
|
59
|
+
drwxr-xr-x 14 root root 4260 Oct 14 16:14 dev
|
60
|
+
drwxr-xr-x 104 root root 4096 Oct 14 17:34 etc
|
61
|
+
drwxr-xr-x 8 root root 4096 Oct 1 15:09 home
|
62
|
+
EOF
|
63
|
+
}
|
64
|
+
|
65
|
+
its(:stdout) { should match /bin/ }
|
66
|
+
its(:stderr) { should match /bin/ }
|
67
|
+
|
68
|
+
its(:stdout) { should eq stdout }
|
69
|
+
end
|
data/spec/darwin/command_spec.rb
CHANGED
@@ -48,3 +48,22 @@ describe command('cat /etc/resolv.conf') do
|
|
48
48
|
it { should return_exit_status 0 }
|
49
49
|
its(:command) { should eq 'cat /etc/resolv.conf' }
|
50
50
|
end
|
51
|
+
|
52
|
+
describe command('ls -al /') do
|
53
|
+
let(:stdout) { <<EOF
|
54
|
+
total 88
|
55
|
+
drwxr-xr-x 23 root root 4096 Oct 10 17:19 .
|
56
|
+
drwxr-xr-x 23 root root 4096 Oct 10 17:19 ..
|
57
|
+
drwxr-xr-x 2 root root 4096 Sep 11 16:43 bin
|
58
|
+
drwxr-xr-x 3 root root 4096 Sep 23 18:14 boot
|
59
|
+
drwxr-xr-x 14 root root 4260 Oct 14 16:14 dev
|
60
|
+
drwxr-xr-x 104 root root 4096 Oct 14 17:34 etc
|
61
|
+
drwxr-xr-x 8 root root 4096 Oct 1 15:09 home
|
62
|
+
EOF
|
63
|
+
}
|
64
|
+
|
65
|
+
its(:stdout) { should match /bin/ }
|
66
|
+
its(:stderr) { should match /bin/ }
|
67
|
+
|
68
|
+
its(:stdout) { should eq stdout }
|
69
|
+
end
|
data/spec/debian/command_spec.rb
CHANGED
@@ -48,3 +48,22 @@ describe command('cat /etc/resolv.conf') do
|
|
48
48
|
it { should return_exit_status 0 }
|
49
49
|
its(:command) { should eq 'cat /etc/resolv.conf' }
|
50
50
|
end
|
51
|
+
|
52
|
+
describe command('ls -al /') do
|
53
|
+
let(:stdout) { <<EOF
|
54
|
+
total 88
|
55
|
+
drwxr-xr-x 23 root root 4096 Oct 10 17:19 .
|
56
|
+
drwxr-xr-x 23 root root 4096 Oct 10 17:19 ..
|
57
|
+
drwxr-xr-x 2 root root 4096 Sep 11 16:43 bin
|
58
|
+
drwxr-xr-x 3 root root 4096 Sep 23 18:14 boot
|
59
|
+
drwxr-xr-x 14 root root 4260 Oct 14 16:14 dev
|
60
|
+
drwxr-xr-x 104 root root 4096 Oct 14 17:34 etc
|
61
|
+
drwxr-xr-x 8 root root 4096 Oct 1 15:09 home
|
62
|
+
EOF
|
63
|
+
}
|
64
|
+
|
65
|
+
its(:stdout) { should match /bin/ }
|
66
|
+
its(:stderr) { should match /bin/ }
|
67
|
+
|
68
|
+
its(:stdout) { should eq stdout }
|
69
|
+
end
|
@@ -46,3 +46,22 @@ describe command('cat /etc/resolv.conf') do
|
|
46
46
|
it { should return_exit_status 0 }
|
47
47
|
its(:command) { should eq 'cat /etc/resolv.conf' }
|
48
48
|
end
|
49
|
+
|
50
|
+
describe command('ls -al /') do
|
51
|
+
let(:stdout) { <<EOF
|
52
|
+
total 88
|
53
|
+
drwxr-xr-x 23 root root 4096 Oct 10 17:19 .
|
54
|
+
drwxr-xr-x 23 root root 4096 Oct 10 17:19 ..
|
55
|
+
drwxr-xr-x 2 root root 4096 Sep 11 16:43 bin
|
56
|
+
drwxr-xr-x 3 root root 4096 Sep 23 18:14 boot
|
57
|
+
drwxr-xr-x 14 root root 4260 Oct 14 16:14 dev
|
58
|
+
drwxr-xr-x 104 root root 4096 Oct 14 17:34 etc
|
59
|
+
drwxr-xr-x 8 root root 4096 Oct 1 15:09 home
|
60
|
+
EOF
|
61
|
+
}
|
62
|
+
|
63
|
+
its(:stdout) { should match /bin/ }
|
64
|
+
its(:stderr) { should match /bin/ }
|
65
|
+
|
66
|
+
its(:stdout) { should eq stdout }
|
67
|
+
end
|
data/spec/gentoo/command_spec.rb
CHANGED
@@ -48,3 +48,22 @@ describe command('cat /etc/resolv.conf') do
|
|
48
48
|
it { should return_exit_status 0 }
|
49
49
|
its(:command) { should eq 'cat /etc/resolv.conf' }
|
50
50
|
end
|
51
|
+
|
52
|
+
describe command('ls -al /') do
|
53
|
+
let(:stdout) { <<EOF
|
54
|
+
total 88
|
55
|
+
drwxr-xr-x 23 root root 4096 Oct 10 17:19 .
|
56
|
+
drwxr-xr-x 23 root root 4096 Oct 10 17:19 ..
|
57
|
+
drwxr-xr-x 2 root root 4096 Sep 11 16:43 bin
|
58
|
+
drwxr-xr-x 3 root root 4096 Sep 23 18:14 boot
|
59
|
+
drwxr-xr-x 14 root root 4260 Oct 14 16:14 dev
|
60
|
+
drwxr-xr-x 104 root root 4096 Oct 14 17:34 etc
|
61
|
+
drwxr-xr-x 8 root root 4096 Oct 1 15:09 home
|
62
|
+
EOF
|
63
|
+
}
|
64
|
+
|
65
|
+
its(:stdout) { should match /bin/ }
|
66
|
+
its(:stderr) { should match /bin/ }
|
67
|
+
|
68
|
+
its(:stdout) { should eq stdout }
|
69
|
+
end
|
data/spec/plamo/command_spec.rb
CHANGED
@@ -48,3 +48,22 @@ describe command('cat /etc/resolv.conf') do
|
|
48
48
|
it { should return_exit_status 0 }
|
49
49
|
its(:command) { should eq 'cat /etc/resolv.conf' }
|
50
50
|
end
|
51
|
+
|
52
|
+
describe command('ls -al /') do
|
53
|
+
let(:stdout) { <<EOF
|
54
|
+
total 88
|
55
|
+
drwxr-xr-x 23 root root 4096 Oct 10 17:19 .
|
56
|
+
drwxr-xr-x 23 root root 4096 Oct 10 17:19 ..
|
57
|
+
drwxr-xr-x 2 root root 4096 Sep 11 16:43 bin
|
58
|
+
drwxr-xr-x 3 root root 4096 Sep 23 18:14 boot
|
59
|
+
drwxr-xr-x 14 root root 4260 Oct 14 16:14 dev
|
60
|
+
drwxr-xr-x 104 root root 4096 Oct 14 17:34 etc
|
61
|
+
drwxr-xr-x 8 root root 4096 Oct 1 15:09 home
|
62
|
+
EOF
|
63
|
+
}
|
64
|
+
|
65
|
+
its(:stdout) { should match /bin/ }
|
66
|
+
its(:stderr) { should match /bin/ }
|
67
|
+
|
68
|
+
its(:stdout) { should eq stdout }
|
69
|
+
end
|
data/spec/redhat/command_spec.rb
CHANGED
@@ -4,6 +4,7 @@ RSpec.configure do |c|
|
|
4
4
|
c.os = 'RedHat'
|
5
5
|
end
|
6
6
|
|
7
|
+
=begin
|
7
8
|
describe command('cat /etc/resolv.conf') do
|
8
9
|
let(:stdout) { "nameserver 127.0.0.1\r\n" }
|
9
10
|
it { should return_stdout("nameserver 127.0.0.1") }
|
@@ -48,3 +49,23 @@ describe command('cat /etc/resolv.conf') do
|
|
48
49
|
it { should return_exit_status 0 }
|
49
50
|
its(:command) { should eq 'cat /etc/resolv.conf' }
|
50
51
|
end
|
52
|
+
=end
|
53
|
+
|
54
|
+
describe command('ls -al /') do
|
55
|
+
let(:stdout) { <<EOF
|
56
|
+
total 88
|
57
|
+
drwxr-xr-x 23 root root 4096 Oct 10 17:19 .
|
58
|
+
drwxr-xr-x 23 root root 4096 Oct 10 17:19 ..
|
59
|
+
drwxr-xr-x 2 root root 4096 Sep 11 16:43 bin
|
60
|
+
drwxr-xr-x 3 root root 4096 Sep 23 18:14 boot
|
61
|
+
drwxr-xr-x 14 root root 4260 Oct 14 16:14 dev
|
62
|
+
drwxr-xr-x 104 root root 4096 Oct 14 17:34 etc
|
63
|
+
drwxr-xr-x 8 root root 4096 Oct 1 15:09 home
|
64
|
+
EOF
|
65
|
+
}
|
66
|
+
|
67
|
+
its(:stdout) { should match /bin/ }
|
68
|
+
its(:stderr) { should match /bin/ }
|
69
|
+
|
70
|
+
its(:stdout) { should eq stdout }
|
71
|
+
end
|
@@ -46,3 +46,22 @@ describe command('cat /etc/resolv.conf') do
|
|
46
46
|
it { should return_exit_status 0 }
|
47
47
|
its(:command) { should eq 'cat /etc/resolv.conf' }
|
48
48
|
end
|
49
|
+
|
50
|
+
describe command('ls -al /') do
|
51
|
+
let(:stdout) { <<EOF
|
52
|
+
total 88
|
53
|
+
drwxr-xr-x 23 root root 4096 Oct 10 17:19 .
|
54
|
+
drwxr-xr-x 23 root root 4096 Oct 10 17:19 ..
|
55
|
+
drwxr-xr-x 2 root root 4096 Sep 11 16:43 bin
|
56
|
+
drwxr-xr-x 3 root root 4096 Sep 23 18:14 boot
|
57
|
+
drwxr-xr-x 14 root root 4260 Oct 14 16:14 dev
|
58
|
+
drwxr-xr-x 104 root root 4096 Oct 14 17:34 etc
|
59
|
+
drwxr-xr-x 8 root root 4096 Oct 1 15:09 home
|
60
|
+
EOF
|
61
|
+
}
|
62
|
+
|
63
|
+
its(:stdout) { should match /bin/ }
|
64
|
+
its(:stderr) { should match /bin/ }
|
65
|
+
|
66
|
+
its(:stdout) { should eq stdout }
|
67
|
+
end
|
@@ -48,3 +48,22 @@ describe command('cat /etc/resolv.conf') do
|
|
48
48
|
it { should return_exit_status 0 }
|
49
49
|
its(:command) { should eq 'cat /etc/resolv.conf' }
|
50
50
|
end
|
51
|
+
|
52
|
+
describe command('ls -al /') do
|
53
|
+
let(:stdout) { <<EOF
|
54
|
+
total 88
|
55
|
+
drwxr-xr-x 23 root root 4096 Oct 10 17:19 .
|
56
|
+
drwxr-xr-x 23 root root 4096 Oct 10 17:19 ..
|
57
|
+
drwxr-xr-x 2 root root 4096 Sep 11 16:43 bin
|
58
|
+
drwxr-xr-x 3 root root 4096 Sep 23 18:14 boot
|
59
|
+
drwxr-xr-x 14 root root 4260 Oct 14 16:14 dev
|
60
|
+
drwxr-xr-x 104 root root 4096 Oct 14 17:34 etc
|
61
|
+
drwxr-xr-x 8 root root 4096 Oct 1 15:09 home
|
62
|
+
EOF
|
63
|
+
}
|
64
|
+
|
65
|
+
its(:stdout) { should match /bin/ }
|
66
|
+
its(:stderr) { should match /bin/ }
|
67
|
+
|
68
|
+
its(:stdout) { should eq stdout }
|
69
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serverspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|
@@ -310,7 +310,6 @@ files:
|
|
310
310
|
- spec/plamo/zfs_spec.rb
|
311
311
|
- spec/redhat/cgroup_spec.rb
|
312
312
|
- spec/redhat/command_spec.rb
|
313
|
-
- spec/redhat/commands_spec.rb
|
314
313
|
- spec/redhat/cron_spec.rb
|
315
314
|
- spec/redhat/default_gateway_spec.rb
|
316
315
|
- spec/redhat/file_spec.rb
|
@@ -330,7 +329,6 @@ files:
|
|
330
329
|
- spec/redhat/user_spec.rb
|
331
330
|
- spec/redhat/yumrepo_spec.rb
|
332
331
|
- spec/redhat/zfs_spec.rb
|
333
|
-
- spec/smartos/commands_spec.rb
|
334
332
|
- spec/smartos/mail_alias_spec.rb
|
335
333
|
- spec/solaris/command_spec.rb
|
336
334
|
- spec/solaris/cron_spec.rb
|
@@ -349,7 +347,6 @@ files:
|
|
349
347
|
- spec/solaris/svcprop_spec.rb
|
350
348
|
- spec/solaris/user_spec.rb
|
351
349
|
- spec/solaris/zfs_spec.rb
|
352
|
-
- spec/solaris10/commands_spec.rb
|
353
350
|
- spec/solaris10/mail_alias_spec.rb
|
354
351
|
- spec/solaris10/php_config_spec.rb
|
355
352
|
- spec/solaris11/command_spec.rb
|
@@ -509,7 +506,6 @@ test_files:
|
|
509
506
|
- spec/plamo/zfs_spec.rb
|
510
507
|
- spec/redhat/cgroup_spec.rb
|
511
508
|
- spec/redhat/command_spec.rb
|
512
|
-
- spec/redhat/commands_spec.rb
|
513
509
|
- spec/redhat/cron_spec.rb
|
514
510
|
- spec/redhat/default_gateway_spec.rb
|
515
511
|
- spec/redhat/file_spec.rb
|
@@ -529,7 +525,6 @@ test_files:
|
|
529
525
|
- spec/redhat/user_spec.rb
|
530
526
|
- spec/redhat/yumrepo_spec.rb
|
531
527
|
- spec/redhat/zfs_spec.rb
|
532
|
-
- spec/smartos/commands_spec.rb
|
533
528
|
- spec/smartos/mail_alias_spec.rb
|
534
529
|
- spec/solaris/command_spec.rb
|
535
530
|
- spec/solaris/cron_spec.rb
|
@@ -548,7 +543,6 @@ test_files:
|
|
548
543
|
- spec/solaris/svcprop_spec.rb
|
549
544
|
- spec/solaris/user_spec.rb
|
550
545
|
- spec/solaris/zfs_spec.rb
|
551
|
-
- spec/solaris10/commands_spec.rb
|
552
546
|
- spec/solaris10/mail_alias_spec.rb
|
553
547
|
- spec/solaris10/php_config_spec.rb
|
554
548
|
- spec/solaris11/command_spec.rb
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
RSpec.configure do |c|
|
4
|
-
c.os = 'RedHat'
|
5
|
-
end
|
6
|
-
|
7
|
-
describe 'check_yumrepo' do
|
8
|
-
subject { commands.check_yumrepo('epel') }
|
9
|
-
it { should eq 'yum repolist all -C | grep ^epel' }
|
10
|
-
end
|
11
|
-
|
12
|
-
describe 'check_yumrepo_enabled' do
|
13
|
-
subject { commands.check_yumrepo_enabled('epel') }
|
14
|
-
it { should eq 'yum repolist all -C | grep ^epel | grep enabled' }
|
15
|
-
end
|
@@ -1,59 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
RSpec.configure do |c|
|
4
|
-
c.os = 'SmartOS'
|
5
|
-
end
|
6
|
-
|
7
|
-
## SmartOS
|
8
|
-
describe 'check_installed' do
|
9
|
-
subject { commands.check_installed('httpd') }
|
10
|
-
it { should eq '/opt/local/bin/pkgin list 2> /dev/null | grep -qw ^httpd' }
|
11
|
-
end
|
12
|
-
|
13
|
-
## SmartOS
|
14
|
-
describe 'check_installed' do
|
15
|
-
subject { commands.check_installed('httpd', '2.2') }
|
16
|
-
it { should eq '/opt/local/bin/pkgin list 2> /dev/null | grep -qw ^httpd-2.2' }
|
17
|
-
end
|
18
|
-
|
19
|
-
describe 'check_zfs' do
|
20
|
-
context 'check without properties' do
|
21
|
-
subject { commands.check_zfs('rpool') }
|
22
|
-
it { should eq "zfs list -H rpool" }
|
23
|
-
end
|
24
|
-
|
25
|
-
context 'check with a property' do
|
26
|
-
subject { commands.check_zfs('rpool', { 'mountpoint' => '/rpool' }) }
|
27
|
-
it { should eq "zfs list -H -o mountpoint rpool | grep -- \\^/rpool\\$" }
|
28
|
-
end
|
29
|
-
|
30
|
-
context 'check with multiple properties' do
|
31
|
-
subject { commands.check_zfs('rpool', { 'mountpoint' => '/rpool', 'compression' => 'off' }) }
|
32
|
-
it { should eq "zfs list -H -o compression rpool | grep -- \\^off\\$ && zfs list -H -o mountpoint rpool | grep -- \\^/rpool\\$" }
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
describe 'check_ip_filter_rule' do
|
37
|
-
subject { commands.check_ipfilter_rule('pass in quick on lo0 all') }
|
38
|
-
it { should eq "ipfstat -io 2> /dev/null | grep -- pass\\ in\\ quick\\ on\\ lo0\\ all" }
|
39
|
-
end
|
40
|
-
|
41
|
-
describe 'check_ipnat_rule' do
|
42
|
-
subject { commands.check_ipnat_rule('map net1 192.168.0.0/24 -> 0.0.0.0/32') }
|
43
|
-
it { should eq "ipnat -l 2> /dev/null | grep -- \\^map\\ net1\\ 192.168.0.0/24\\ -\\>\\ 0.0.0.0/32\\$" }
|
44
|
-
end
|
45
|
-
|
46
|
-
describe 'check_svcprop' do
|
47
|
-
subject { commands.check_svcprop('svc:/network/http:apache22', 'httpd/enable_64bit','false') }
|
48
|
-
it { should eq "svcprop -p httpd/enable_64bit svc:/network/http:apache22 | grep -- \\^false\\$" }
|
49
|
-
end
|
50
|
-
|
51
|
-
describe 'check_svcprops' do
|
52
|
-
subject {
|
53
|
-
commands.check_svcprops('svc:/network/http:apache22', {
|
54
|
-
'httpd/enable_64bit' => 'false',
|
55
|
-
'httpd/server_type' => 'worker',
|
56
|
-
})
|
57
|
-
}
|
58
|
-
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\\$" }
|
59
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
RSpec.configure do |c|
|
4
|
-
c.os = 'Solaris10'
|
5
|
-
end
|
6
|
-
|
7
|
-
describe 'check_zfs' do
|
8
|
-
context 'check without properties' do
|
9
|
-
subject { commands.check_zfs('rpool') }
|
10
|
-
it { should eq "zfs list -H rpool" }
|
11
|
-
end
|
12
|
-
|
13
|
-
context 'check with a property' do
|
14
|
-
subject { commands.check_zfs('rpool', { 'mountpoint' => '/rpool' }) }
|
15
|
-
it { should eq "zfs list -H -o mountpoint rpool | grep -- \\^/rpool\\$" }
|
16
|
-
end
|
17
|
-
|
18
|
-
context 'check with multiple properties' do
|
19
|
-
subject { commands.check_zfs('rpool', { 'mountpoint' => '/rpool', 'compression' => 'off' }) }
|
20
|
-
it { should eq "zfs list -H -o compression rpool | grep -- \\^off\\$ && zfs list -H -o mountpoint rpool | grep -- \\^/rpool\\$" }
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
describe 'check_ip_filter_rule' do
|
25
|
-
subject { commands.check_ipfilter_rule('pass in quick on lo0 all') }
|
26
|
-
it { should eq "ipfstat -io 2> /dev/null | grep -- pass\\ in\\ quick\\ on\\ lo0\\ all" }
|
27
|
-
end
|
28
|
-
|
29
|
-
describe 'check_ipnat_rule' do
|
30
|
-
subject { commands.check_ipnat_rule('map net1 192.168.0.0/24 -> 0.0.0.0/32') }
|
31
|
-
it { should eq "ipnat -l 2> /dev/null | grep -- \\^map\\ net1\\ 192.168.0.0/24\\ -\\>\\ 0.0.0.0/32\\$" }
|
32
|
-
end
|
33
|
-
|
34
|
-
describe 'check_svcprop' do
|
35
|
-
subject { commands.check_svcprop('svc:/network/http:apache22', 'httpd/enable_64bit','false') }
|
36
|
-
it { should eq "svcprop -p httpd/enable_64bit svc:/network/http:apache22 | grep -- \\^false\\$" }
|
37
|
-
end
|
38
|
-
|
39
|
-
describe 'check_svcprops' do
|
40
|
-
subject {
|
41
|
-
commands.check_svcprops('svc:/network/http:apache22', {
|
42
|
-
'httpd/enable_64bit' => 'false',
|
43
|
-
'httpd/server_type' => 'worker',
|
44
|
-
})
|
45
|
-
}
|
46
|
-
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\\$" }
|
47
|
-
end
|