serverspec 0.7.9 → 0.7.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/serverspec/commands/linux.rb +13 -0
- data/lib/serverspec/version.rb +1 -1
- data/spec/debian/zfs_spec.rb +18 -0
- data/spec/gentoo/zfs_spec.rb +18 -0
- data/spec/redhat/zfs_spec.rb +18 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09fea80cce64bcddeb8c35c66e5c6588240ca26d
|
4
|
+
data.tar.gz: c3206bd17d6f7564cf2ae803c267fb2cd61ed51d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1f369ee39db823f357f0dfd7d42bc06c7a71f3f00e22687c6eafaff19a90799dcad8ea9a71321d3d6b5c38c452615b7b79fe31a06db4295fc2a96e7fcfcbe6a
|
7
|
+
data.tar.gz: e10adf50dd47fbd8b9cb1f650e7e7acb4c585fc5021c7094469a34d0dae7c901a2a1285577cbe943fc2528619e8ef37088d6efa6af202d9948354467404b0032
|
@@ -43,6 +43,19 @@ module Serverspec
|
|
43
43
|
ip_address.gsub!(".", "\\.")
|
44
44
|
"ip addr show #{interface} | grep 'inet #{ip_address}'"
|
45
45
|
end
|
46
|
+
|
47
|
+
def check_zfs(zfs, property=nil)
|
48
|
+
if property.nil?
|
49
|
+
"zfs list -H #{escape(zfs)}"
|
50
|
+
else
|
51
|
+
commands = []
|
52
|
+
property.sort.each do |key, value|
|
53
|
+
regexp = "^#{value}$"
|
54
|
+
commands << "zfs list -H -o #{escape(key)} #{escape(zfs)} | grep -- #{escape(regexp)}"
|
55
|
+
end
|
56
|
+
commands.join(' && ')
|
57
|
+
end
|
58
|
+
end
|
46
59
|
end
|
47
60
|
end
|
48
61
|
end
|
data/lib/serverspec/version.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
include Serverspec::Helper::Debian
|
4
|
+
|
5
|
+
describe zfs('rpool') do
|
6
|
+
it { should exist }
|
7
|
+
its(:command) { should eq "zfs list -H rpool" }
|
8
|
+
end
|
9
|
+
|
10
|
+
describe zfs('rpool') do
|
11
|
+
it { should have_property 'mountpoint' => '/rpool' }
|
12
|
+
its(:command) { should eq "zfs list -H -o mountpoint rpool | grep -- \\^/rpool\\$" }
|
13
|
+
end
|
14
|
+
|
15
|
+
describe zfs('rpool') do
|
16
|
+
it { should have_property 'mountpoint' => '/rpool', 'compression' => 'off' }
|
17
|
+
its(:command) { should eq "zfs list -H -o compression rpool | grep -- \\^off\\$ && zfs list -H -o mountpoint rpool | grep -- \\^/rpool\\$" }
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
include Serverspec::Helper::Gentoo
|
4
|
+
|
5
|
+
describe zfs('rpool') do
|
6
|
+
it { should exist }
|
7
|
+
its(:command) { should eq "zfs list -H rpool" }
|
8
|
+
end
|
9
|
+
|
10
|
+
describe zfs('rpool') do
|
11
|
+
it { should have_property 'mountpoint' => '/rpool' }
|
12
|
+
its(:command) { should eq "zfs list -H -o mountpoint rpool | grep -- \\^/rpool\\$" }
|
13
|
+
end
|
14
|
+
|
15
|
+
describe zfs('rpool') do
|
16
|
+
it { should have_property 'mountpoint' => '/rpool', 'compression' => 'off' }
|
17
|
+
its(:command) { should eq "zfs list -H -o compression rpool | grep -- \\^off\\$ && zfs list -H -o mountpoint rpool | grep -- \\^/rpool\\$" }
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
include Serverspec::Helper::RedHat
|
4
|
+
|
5
|
+
describe zfs('rpool') do
|
6
|
+
it { should exist }
|
7
|
+
its(:command) { should eq "zfs list -H rpool" }
|
8
|
+
end
|
9
|
+
|
10
|
+
describe zfs('rpool') do
|
11
|
+
it { should have_property 'mountpoint' => '/rpool' }
|
12
|
+
its(:command) { should eq "zfs list -H -o mountpoint rpool | grep -- \\^/rpool\\$" }
|
13
|
+
end
|
14
|
+
|
15
|
+
describe zfs('rpool') do
|
16
|
+
it { should have_property 'mountpoint' => '/rpool', 'compression' => 'off' }
|
17
|
+
its(:command) { should eq "zfs list -H -o compression rpool | grep -- \\^off\\$ && zfs list -H -o mountpoint rpool | grep -- \\^/rpool\\$" }
|
18
|
+
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.7.
|
4
|
+
version: 0.7.10
|
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-08-
|
11
|
+
date: 2013-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|
@@ -236,6 +236,7 @@ files:
|
|
236
236
|
- spec/debian/selinux_spec.rb
|
237
237
|
- spec/debian/service_spec.rb
|
238
238
|
- spec/debian/user_spec.rb
|
239
|
+
- spec/debian/zfs_spec.rb
|
239
240
|
- spec/gentoo/command_spec.rb
|
240
241
|
- spec/gentoo/cron_spec.rb
|
241
242
|
- spec/gentoo/default_gateway_spec.rb
|
@@ -253,6 +254,7 @@ files:
|
|
253
254
|
- spec/gentoo/selinux_spec.rb
|
254
255
|
- spec/gentoo/service_spec.rb
|
255
256
|
- spec/gentoo/user_spec.rb
|
257
|
+
- spec/gentoo/zfs_spec.rb
|
256
258
|
- spec/helpers/attributes_spec.rb
|
257
259
|
- spec/redhat/command_spec.rb
|
258
260
|
- spec/redhat/commands_spec.rb
|
@@ -273,6 +275,7 @@ files:
|
|
273
275
|
- spec/redhat/service_spec.rb
|
274
276
|
- spec/redhat/user_spec.rb
|
275
277
|
- spec/redhat/yumrepo_spec.rb
|
278
|
+
- spec/redhat/zfs_spec.rb
|
276
279
|
- spec/smartos/commands_spec.rb
|
277
280
|
- spec/solaris/command_spec.rb
|
278
281
|
- spec/solaris/cron_spec.rb
|
@@ -367,6 +370,7 @@ test_files:
|
|
367
370
|
- spec/debian/selinux_spec.rb
|
368
371
|
- spec/debian/service_spec.rb
|
369
372
|
- spec/debian/user_spec.rb
|
373
|
+
- spec/debian/zfs_spec.rb
|
370
374
|
- spec/gentoo/command_spec.rb
|
371
375
|
- spec/gentoo/cron_spec.rb
|
372
376
|
- spec/gentoo/default_gateway_spec.rb
|
@@ -384,6 +388,7 @@ test_files:
|
|
384
388
|
- spec/gentoo/selinux_spec.rb
|
385
389
|
- spec/gentoo/service_spec.rb
|
386
390
|
- spec/gentoo/user_spec.rb
|
391
|
+
- spec/gentoo/zfs_spec.rb
|
387
392
|
- spec/helpers/attributes_spec.rb
|
388
393
|
- spec/redhat/command_spec.rb
|
389
394
|
- spec/redhat/commands_spec.rb
|
@@ -404,6 +409,7 @@ test_files:
|
|
404
409
|
- spec/redhat/service_spec.rb
|
405
410
|
- spec/redhat/user_spec.rb
|
406
411
|
- spec/redhat/yumrepo_spec.rb
|
412
|
+
- spec/redhat/zfs_spec.rb
|
407
413
|
- spec/smartos/commands_spec.rb
|
408
414
|
- spec/solaris/command_spec.rb
|
409
415
|
- spec/solaris/cron_spec.rb
|