serverspec 2.24.0 → 2.24.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 072e9221dbec759258719f66f89547e8d979c4d1
4
- data.tar.gz: f11f81e00792b28d36676157271c5b5752875662
3
+ metadata.gz: ba897330aa5f45c546c1ef4cd97771a318ceaea6
4
+ data.tar.gz: 78c6830d00bdeb2d3e9f199d1e2f1d75352c6483
5
5
  SHA512:
6
- metadata.gz: 4de08a8977d4dbf0c3153a022f2d1c1f8e20c4fbcddee60a6a1b3b9ff07ffd5cfd2b6b8d61f09e9e204d751a785ffad7a60f2ff51f770fe8b92d4972c91b753d
7
- data.tar.gz: 0d21196c571710bb1ead4e9b7e4f167a01b6a986de206955b3cf2bca7efd0c6b486df0bca8a1ab3fad66e1c9338f9e3e5a0175ed4f908c3ccfac1da27de92077
6
+ metadata.gz: 1f206c35791814365553d076e9a90f3c6329f96d95fd25d72b159e8554fb9cd98caf8c4768849a0139a01bbf90f229f49eb0b9d61c4f69a960f1d0b2a9da599e
7
+ data.tar.gz: e277aafb65c7d3e677c83c4108c0f0f33e1618cdc01c6e0405ab24d53258de437458d1a8e7c3d3259b193d0e6d91009ef92652bf82c99c60d0e9ff3539df32d3
@@ -9,7 +9,8 @@ module Serverspec::Type
9
9
  def [](key)
10
10
  value = inspection
11
11
  key.split('.').each do |k|
12
- value = value[k]
12
+ is_index = k.start_with?('[') && k.end_with?(']')
13
+ value = value[is_index ? k.to_i : k]
13
14
  end
14
15
  value
15
16
  end
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "2.24.0"
2
+ VERSION = "2.24.1"
3
3
  end
@@ -34,3 +34,14 @@ describe host('example.jp') do
34
34
  let(:stdout) { "1.2.3.4\r\n" }
35
35
  its(:ipaddress) { should eq '1.2.3.4' }
36
36
  end
37
+
38
+ describe host('example.jp') do
39
+ let(:stdout) { "1.2.3.4\r\n" }
40
+ its(:ipv4_address) { should match(/^[\d.]+$/) }
41
+ end
42
+
43
+ describe host('example.jp') do
44
+ let(:stdout) { "2001:db8::1234\r\n" }
45
+ its(:ipv6_address) { should match(/^[a-f\d:]+$/i) }
46
+ end
47
+
@@ -15,6 +15,7 @@ describe docker_container('c1') do
15
15
  it { should have_volume('/tmp', '/data') }
16
16
  its(:inspection) { should include 'Driver' => 'aufs' }
17
17
  its(['Config.Cmd']) { should include '/bin/sh' }
18
+ its(['HostConfig.PortBindings.80.[0].HostPort']) { should eq '8080' }
18
19
  end
19
20
 
20
21
  describe docker_container('restarting') do
@@ -73,7 +74,14 @@ def inspect_container
73
74
  "Links": null,
74
75
  "LxcConf": [],
75
76
  "NetworkMode": "bridge",
76
- "PortBindings": {},
77
+ "PortBindings": {
78
+ "80": [
79
+ {
80
+ "HostIp": "",
81
+ "HostPort": "8080"
82
+ }
83
+ ]
84
+ },
77
85
  "Privileged": false,
78
86
  "PublishAllPorts": false,
79
87
  "VolumesFrom": null
@@ -6,10 +6,18 @@ describe selinux do
6
6
  it { should be_enforcing }
7
7
  end
8
8
 
9
+ describe selinux do
10
+ it { should be_enforcing.with_policy('mls') }
11
+ end
12
+
9
13
  describe selinux do
10
14
  it { should be_permissive }
11
15
  end
12
16
 
17
+ describe selinux do
18
+ it { should be_permissive.with_policy('targeted') }
19
+ end
20
+
13
21
  describe selinux do
14
22
  it { should be_disabled }
15
23
  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: 2.24.0
4
+ version: 2.24.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-17 00:00:00.000000000 Z
11
+ date: 2015-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -446,3 +446,4 @@ test_files:
446
446
  - spec/type/windows/scheduled_task_spec.rb
447
447
  - spec/type/windows/service_spec.rb
448
448
  - spec/type/windows/user_spec.rb
449
+ has_rdoc: