serverspec 2.41.5 → 2.42.0
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 +4 -4
- data/.travis.yml +1 -1
- data/appveyor.yml +1 -0
- data/lib/serverspec/type/command.rb +6 -1
- data/lib/serverspec/type/group.rb +4 -0
- data/lib/serverspec/type/user.rb +4 -0
- data/lib/serverspec/type/x509_certificate.rb +9 -2
- data/lib/serverspec/version.rb +1 -1
- data/spec/type/base/group_spec.rb +5 -0
- data/spec/type/base/user_spec.rb +5 -0
- data/spec/type/linux/x509_certificate_spec.rb +30 -8
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e7e6937d32bae901dced0203e3521b5bf78e7b5
|
4
|
+
data.tar.gz: 9f37164c1c0288c7759ca7a3541cf6474a3d16f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a11a4a768849ead513cc6b0b35423245a3d3861a6dab4d17f31fcd7e7b7c5f9cb0a8de43d73026969af98513b63e7acdb851491d3ed28f0602f96fc12f5610b9
|
7
|
+
data.tar.gz: ed280d208fe94358bc18163029868dd4f39a102eaaf2301cf1c992d9132ded79aa3f16c76488e4f3ad33e6f5e80a0db46830a745b3ddc8fea145802f6adbbab3
|
data/.travis.yml
CHANGED
data/appveyor.yml
CHANGED
@@ -59,6 +59,7 @@ install:
|
|
59
59
|
- ps: $PSVersionTable
|
60
60
|
|
61
61
|
build_script:
|
62
|
+
- set SSL_CERT_FILE=C:/ruby24-x64/ssl/cert.pem
|
62
63
|
- ruby -rfileutils -e 'FileUtils.rm_r(File.join(Gem.dir, "cache", "bundler")) if Dir.exists?(File.join(Gem.dir, "cache", "bundler"))'
|
63
64
|
- bundle install --jobs 3 --retry 3
|
64
65
|
- net user
|
@@ -18,9 +18,14 @@ module Serverspec::Type
|
|
18
18
|
command_result.exit_status.to_i
|
19
19
|
end
|
20
20
|
|
21
|
+
protected
|
22
|
+
def command
|
23
|
+
@name
|
24
|
+
end
|
25
|
+
|
21
26
|
private
|
22
27
|
def command_result()
|
23
|
-
@command_result ||= @runner.run_command(
|
28
|
+
@command_result ||= @runner.run_command(command)
|
24
29
|
end
|
25
30
|
end
|
26
31
|
end
|
data/lib/serverspec/type/user.rb
CHANGED
@@ -7,11 +7,11 @@ module Serverspec::Type
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def subject
|
10
|
-
run_openssl_command_with("-subject -noout").stdout.chomp.gsub(/^subject= */,'')
|
10
|
+
normalize_dn(run_openssl_command_with("-subject -noout").stdout.chomp.gsub(/^subject= */,''))
|
11
11
|
end
|
12
12
|
|
13
13
|
def issuer
|
14
|
-
run_openssl_command_with("-issuer -noout").stdout.chomp.gsub(/^issuer= */,'')
|
14
|
+
normalize_dn(run_openssl_command_with("-issuer -noout").stdout.chomp.gsub(/^issuer= */,''))
|
15
15
|
end
|
16
16
|
|
17
17
|
def email
|
@@ -81,5 +81,12 @@ module Serverspec::Type
|
|
81
81
|
res.merge({ kv_arr[0].to_sym => time })
|
82
82
|
end
|
83
83
|
end
|
84
|
+
|
85
|
+
# Normalize output between openssl versions.
|
86
|
+
def normalize_dn(dn)
|
87
|
+
return dn unless dn.start_with?('/')
|
88
|
+
# normalize openssl < 1.1 to >= 1.1 output
|
89
|
+
dn[1..-1].split('/').join(', ').gsub('=', ' = ')
|
90
|
+
end
|
84
91
|
end
|
85
92
|
end
|
data/lib/serverspec/version.rb
CHANGED
data/spec/type/base/user_spec.rb
CHANGED
@@ -12,14 +12,24 @@ describe x509_certificate('test.pem') do
|
|
12
12
|
it { should_not be_certificate }
|
13
13
|
end
|
14
14
|
|
15
|
-
describe x509_certificate('test.pem') do
|
16
|
-
let(:stdout) {
|
17
|
-
its(:subject) { should eq '
|
15
|
+
describe x509_certificate('test-openssl-1.0.pem') do
|
16
|
+
let(:stdout) { sample_subj_openssl_1_0 }
|
17
|
+
its(:subject) { should eq 'O = some, OU = thing' }
|
18
18
|
end
|
19
19
|
|
20
|
-
describe x509_certificate('test.pem') do
|
21
|
-
let(:stdout) {
|
22
|
-
its(:
|
20
|
+
describe x509_certificate('test-openssl-1.1.pem') do
|
21
|
+
let(:stdout) { sample_subj_openssl_1_1 }
|
22
|
+
its(:subject) { should eq 'O = some, OU = thing' }
|
23
|
+
end
|
24
|
+
|
25
|
+
describe x509_certificate('test-openssl-1.0.pem') do
|
26
|
+
let(:stdout) { sample_issuer_openssl_1_0 }
|
27
|
+
its(:issuer) { should eq 'O = some, OU = issuer' }
|
28
|
+
end
|
29
|
+
|
30
|
+
describe x509_certificate('test-openssl-1.1.pem') do
|
31
|
+
let(:stdout) { sample_issuer_openssl_1_1 }
|
32
|
+
its(:issuer) { should eq 'O = some, OU = issuer' }
|
23
33
|
end
|
24
34
|
|
25
35
|
describe x509_certificate('test.pem') do
|
@@ -38,18 +48,30 @@ describe x509_certificate('test.pem') do
|
|
38
48
|
its(:subject_alt_names) { should eq %w[DNS:*.example.com DNS:www.example.net IP:192.0.2.10] }
|
39
49
|
end
|
40
50
|
|
41
|
-
def
|
51
|
+
def sample_subj_openssl_1_0
|
42
52
|
<<'EOS'
|
43
53
|
subject= /O=some/OU=thing
|
44
54
|
EOS
|
45
55
|
end
|
46
56
|
|
47
|
-
def
|
57
|
+
def sample_subj_openssl_1_1
|
58
|
+
<<'EOS'
|
59
|
+
subject=O = some, OU = thing
|
60
|
+
EOS
|
61
|
+
end
|
62
|
+
|
63
|
+
def sample_issuer_openssl_1_0
|
48
64
|
<<'EOS'
|
49
65
|
issuer= /O=some/OU=issuer
|
50
66
|
EOS
|
51
67
|
end
|
52
68
|
|
69
|
+
def sample_issuer_openssl_1_1
|
70
|
+
<<'EOS'
|
71
|
+
issuer=O = some, OU = issuer
|
72
|
+
EOS
|
73
|
+
end
|
74
|
+
|
53
75
|
def sample_validity
|
54
76
|
<<'EOS'
|
55
77
|
notBefore=Jul 1 11:11:00 2000 GMT
|
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.
|
4
|
+
version: 2.42.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -306,7 +306,7 @@ homepage: http://serverspec.org/
|
|
306
306
|
licenses:
|
307
307
|
- MIT
|
308
308
|
metadata: {}
|
309
|
-
post_install_message:
|
309
|
+
post_install_message:
|
310
310
|
rdoc_options: []
|
311
311
|
require_paths:
|
312
312
|
- lib
|
@@ -321,9 +321,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
321
321
|
- !ruby/object:Gem::Version
|
322
322
|
version: '0'
|
323
323
|
requirements: []
|
324
|
-
rubyforge_project:
|
325
|
-
rubygems_version: 2.
|
326
|
-
signing_key:
|
324
|
+
rubyforge_project:
|
325
|
+
rubygems_version: 2.5.1
|
326
|
+
signing_key:
|
327
327
|
specification_version: 4
|
328
328
|
summary: RSpec tests for your servers configured by Puppet, Chef, Itamae or anything
|
329
329
|
else
|