serverspec 2.24.1 → 2.24.2
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5213e206a2e2280342fb3ee736b826dffd7ca479
|
4
|
+
data.tar.gz: e040af39605271dc476c709aa4c54b187436ca4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 617f8c3c28fb04e4666b3912a3d47af75e73fb1579ee9c7479eb5494d84d513da32ba6f5a08700ffe4b6c032c57a917530cac0a1ee70daf0d64844d1bb912c27
|
7
|
+
data.tar.gz: ef3e1c068264f4234f9ba5dede49b659eb093d71e2e0781593da699af41c2adf6c8614a9b8421138a8f034d71f133c8bd18a9a55e94552a0b1b6b2efe3586b21
|
data/WINDOWS_SUPPORT.md
CHANGED
@@ -76,7 +76,7 @@ describe group('MYDOMAIN\Domain Users') do
|
|
76
76
|
end
|
77
77
|
|
78
78
|
describe command('& "ipconfig"') do
|
79
|
-
|
79
|
+
its(:stdout) { should match /IPv4 Address(\.| )*: 192\.168\.1\.100/ }
|
80
80
|
end
|
81
81
|
|
82
82
|
describe windows_registry_key('HKEY_USERS\S-1-5-21-1319311448-2088773778-316617838-32407\Test MyKey') do
|
data/appveyor.yml
CHANGED
@@ -21,14 +21,14 @@ matrix:
|
|
21
21
|
clone_depth: 5
|
22
22
|
|
23
23
|
cache:
|
24
|
-
- C:\Ruby193\lib\ruby\gems\1.9.1
|
25
|
-
- C:\Ruby193\bin
|
26
|
-
- C:\Ruby200\lib\ruby\gems\2.0.0
|
27
|
-
- C:\Ruby200\bin
|
28
|
-
- C:\Ruby21\lib\ruby\gems\2.1.0
|
29
|
-
- C:\Ruby21\bin
|
30
|
-
- C:\Ruby22\lib\ruby\gems\2.2.0
|
31
|
-
- C:\Ruby22\bin
|
24
|
+
- C:\Ruby193\lib\ruby\gems\1.9.1 -> appveyor.yml
|
25
|
+
- C:\Ruby193\bin -> appveyor.yml
|
26
|
+
- C:\Ruby200\lib\ruby\gems\2.0.0 -> appveyor.yml
|
27
|
+
- C:\Ruby200\bin -> appveyor.yml
|
28
|
+
- C:\Ruby21\lib\ruby\gems\2.1.0 -> appveyor.yml
|
29
|
+
- C:\Ruby21\bin -> appveyor.yml
|
30
|
+
- C:\Ruby22\lib\ruby\gems\2.2.0 -> appveyor.yml
|
31
|
+
- C:\Ruby22\bin -> appveyor.yml
|
32
32
|
|
33
33
|
install:
|
34
34
|
- git submodule update --init --recursive
|
@@ -5,6 +5,22 @@ module Serverspec::Type
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def has_volume?(container_path, host_path)
|
8
|
+
if (inspection['Mounts'])
|
9
|
+
check_volume(container_path, host_path)
|
10
|
+
else
|
11
|
+
check_volume_pre_1_8(container_path, host_path)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
def check_volume(container_path, host_path)
|
17
|
+
inspection['Mounts'].find {|mount|
|
18
|
+
mount['Destination'] == container_path &&
|
19
|
+
mount['Source'] == host_path
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
def check_volume_pre_1_8(container_path, host_path)
|
8
24
|
inspection['Volumes'][container_path] == host_path
|
9
25
|
end
|
10
26
|
end
|
data/lib/serverspec/version.rb
CHANGED
@@ -0,0 +1,124 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'spec_helper'
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
property[:os] = nil
|
6
|
+
set :os, {:family => 'linux'}
|
7
|
+
|
8
|
+
describe docker_container('c1') do
|
9
|
+
it { should exist }
|
10
|
+
end
|
11
|
+
|
12
|
+
describe docker_container('c1 pre 1.8') do
|
13
|
+
let(:stdout) { inspect_container }
|
14
|
+
it { should be_running }
|
15
|
+
it { should have_volume('/tmp', '/data') }
|
16
|
+
it { should_not have_volume('/tmp', '/data-bad') }
|
17
|
+
its(:inspection) { should include 'Driver' => 'aufs' }
|
18
|
+
its(['Config.Cmd']) { should include '/bin/sh' }
|
19
|
+
its(['HostConfig.PortBindings.80.[0].HostPort']) { should eq '8080' }
|
20
|
+
end
|
21
|
+
|
22
|
+
describe docker_container('restarting pre 1.8') do
|
23
|
+
let(:stdout) do
|
24
|
+
attrs = JSON.parse(inspect_container)
|
25
|
+
attrs.first['State']['Restarting'] = true
|
26
|
+
attrs.to_json
|
27
|
+
end
|
28
|
+
|
29
|
+
it { should_not be_running }
|
30
|
+
end
|
31
|
+
|
32
|
+
def inspect_container
|
33
|
+
<<'EOS'
|
34
|
+
[{
|
35
|
+
"Args": [],
|
36
|
+
"Config": {
|
37
|
+
"AttachStderr": false,
|
38
|
+
"AttachStdin": false,
|
39
|
+
"AttachStdout": false,
|
40
|
+
"Cmd": [
|
41
|
+
"/bin/sh"
|
42
|
+
],
|
43
|
+
"CpuShares": 0,
|
44
|
+
"Cpuset": "",
|
45
|
+
"Domainname": "",
|
46
|
+
"Entrypoint": null,
|
47
|
+
"Env": [
|
48
|
+
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
49
|
+
],
|
50
|
+
"ExposedPorts": null,
|
51
|
+
"Hostname": "65cd2e2d7963",
|
52
|
+
"Image": "busybox",
|
53
|
+
"Memory": 0,
|
54
|
+
"MemorySwap": 0,
|
55
|
+
"NetworkDisabled": false,
|
56
|
+
"OnBuild": null,
|
57
|
+
"OpenStdin": true,
|
58
|
+
"PortSpecs": null,
|
59
|
+
"StdinOnce": false,
|
60
|
+
"Tty": true,
|
61
|
+
"User": "",
|
62
|
+
"Volumes": null,
|
63
|
+
"WorkingDir": ""
|
64
|
+
},
|
65
|
+
"Created": "2014-09-26T15:08:37.527931773Z",
|
66
|
+
"Driver": "aufs",
|
67
|
+
"ExecDriver": "native-0.2",
|
68
|
+
"HostConfig": {
|
69
|
+
"Binds": [
|
70
|
+
"/data:/tmp"
|
71
|
+
],
|
72
|
+
"ContainerIDFile": "",
|
73
|
+
"Dns": null,
|
74
|
+
"DnsSearch": null,
|
75
|
+
"Links": null,
|
76
|
+
"LxcConf": [],
|
77
|
+
"NetworkMode": "bridge",
|
78
|
+
"PortBindings": {
|
79
|
+
"80": [
|
80
|
+
{
|
81
|
+
"HostIp": "",
|
82
|
+
"HostPort": "8080"
|
83
|
+
}
|
84
|
+
]
|
85
|
+
},
|
86
|
+
"Privileged": false,
|
87
|
+
"PublishAllPorts": false,
|
88
|
+
"VolumesFrom": null
|
89
|
+
},
|
90
|
+
"HostnamePath": "/mnt/sda1/var/lib/docker/containers/65cd2e2d7963bacaecda2d7fcd89499010bc0d38d70bce5ad0af7112a94a4545/hostname",
|
91
|
+
"HostsPath": "/mnt/sda1/var/lib/docker/containers/65cd2e2d7963bacaecda2d7fcd89499010bc0d38d70bce5ad0af7112a94a4545/hosts",
|
92
|
+
"Id": "65cd2e2d7963bacaecda2d7fcd89499010bc0d38d70bce5ad0af7112a94a4545",
|
93
|
+
"Image": "e72ac664f4f0c6a061ac4ef332557a70d69b0c624b6add35f1c181ff7fff2287",
|
94
|
+
"MountLabel": "",
|
95
|
+
"Name": "/c1",
|
96
|
+
"NetworkSettings": {
|
97
|
+
"Bridge": "docker0",
|
98
|
+
"Gateway": "172.17.42.1",
|
99
|
+
"IPAddress": "172.17.0.24",
|
100
|
+
"IPPrefixLen": 16,
|
101
|
+
"PortMapping": null,
|
102
|
+
"Ports": {}
|
103
|
+
},
|
104
|
+
"Path": "/bin/sh",
|
105
|
+
"ProcessLabel": "",
|
106
|
+
"ResolvConfPath": "/mnt/sda1/var/lib/docker/containers/65cd2e2d7963bacaecda2d7fcd89499010bc0d38d70bce5ad0af7112a94a4545/resolv.conf",
|
107
|
+
"State": {
|
108
|
+
"ExitCode": 0,
|
109
|
+
"FinishedAt": "0001-01-01T00:00:00Z",
|
110
|
+
"Paused": false,
|
111
|
+
"Pid": 4123,
|
112
|
+
"Running": true,
|
113
|
+
"StartedAt": "2014-09-26T15:08:37.737780273Z"
|
114
|
+
},
|
115
|
+
"Volumes": {
|
116
|
+
"/tmp": "/data"
|
117
|
+
},
|
118
|
+
"VolumesRW": {
|
119
|
+
"/tmp": true
|
120
|
+
}
|
121
|
+
}
|
122
|
+
]
|
123
|
+
EOS
|
124
|
+
end
|
@@ -13,6 +13,7 @@ describe docker_container('c1') do
|
|
13
13
|
let(:stdout) { inspect_container }
|
14
14
|
it { should be_running }
|
15
15
|
it { should have_volume('/tmp', '/data') }
|
16
|
+
it { should_not have_volume('/tmp', '/data-bad') }
|
16
17
|
its(:inspection) { should include 'Driver' => 'aufs' }
|
17
18
|
its(['Config.Cmd']) { should include '/bin/sh' }
|
18
19
|
its(['HostConfig.PortBindings.80.[0].HostPort']) { should eq '8080' }
|
@@ -111,12 +112,14 @@ def inspect_container
|
|
111
112
|
"Running": true,
|
112
113
|
"StartedAt": "2014-09-26T15:08:37.737780273Z"
|
113
114
|
},
|
114
|
-
"
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
115
|
+
"Mounts": [
|
116
|
+
{
|
117
|
+
"Source": "/data",
|
118
|
+
"Destination": "/tmp",
|
119
|
+
"Mode": "",
|
120
|
+
"RW": true
|
121
|
+
}
|
122
|
+
]
|
120
123
|
}
|
121
124
|
]
|
122
125
|
EOS
|
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.
|
4
|
+
version: 2.24.2
|
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-
|
11
|
+
date: 2015-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -234,6 +234,7 @@ files:
|
|
234
234
|
- spec/type/linux/bond_spec.rb
|
235
235
|
- spec/type/linux/bridge_spec.rb
|
236
236
|
- spec/type/linux/cgroup_spec.rb
|
237
|
+
- spec/type/linux/docker_container_pre_1_8_spec.rb
|
237
238
|
- spec/type/linux/docker_container_spec.rb
|
238
239
|
- spec/type/linux/docker_image_spec.rb
|
239
240
|
- spec/type/linux/file_spec.rb
|
@@ -376,6 +377,7 @@ test_files:
|
|
376
377
|
- spec/type/linux/bond_spec.rb
|
377
378
|
- spec/type/linux/bridge_spec.rb
|
378
379
|
- spec/type/linux/cgroup_spec.rb
|
380
|
+
- spec/type/linux/docker_container_pre_1_8_spec.rb
|
379
381
|
- spec/type/linux/docker_container_spec.rb
|
380
382
|
- spec/type/linux/docker_image_spec.rb
|
381
383
|
- spec/type/linux/file_spec.rb
|