serverspec 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e36c6ee6a2dcb7bfd4581b1c2d9c4a0929261ee6
4
+ data.tar.gz: cd368bdfd8855ef11cc2153bee23d44452eca881
5
+ SHA512:
6
+ metadata.gz: 37b9973d685f6aae3ebecb9f4445983629074b78cad169fd65ee862ee22a3b4cdc7a98812b3e0a92d950f117e99f617bae7af0769f7a703997d73f3de502a98e
7
+ data.tar.gz: 961ea420b33ef1311317c9eda56a21e71a158f32caae641923535395daef5f715c6fce5565f5fbef18428461513ced6c6b40c0ffecf0b85493f6c2ffa6bf6b35
@@ -114,6 +114,10 @@ module Serverspec
114
114
  "md5sum #{escape(file)} | grep -iw -- ^#{escape(expected)}"
115
115
  end
116
116
 
117
+ def check_file_sha256checksum(file, expected)
118
+ "sha256sum #{escape(file)} | grep -iw -- ^#{escape(expected)}"
119
+ end
120
+
117
121
  def check_file_contain_within(file, expected_pattern, from=nil, to=nil)
118
122
  from ||= '1'
119
123
  to ||= '$'
@@ -7,6 +7,10 @@ module Serverspec
7
7
  "openssl md5 #{escape(file)} | cut -d'=' -f2 | cut -c 2- | grep -E ^#{escape(expected)}$"
8
8
  end
9
9
 
10
+ def check_file_sha256checksum(file, expected)
11
+ "openssl sha256 #{escape(file)} | cut -d'=' -f2 | cut -c 2- | grep -E ^#{escape(expected)}$"
12
+ end
13
+
10
14
  def check_mode(file, mode)
11
15
  regexp = "^#{mode}$"
12
16
  "stat -f%Lp #{escape(file)} | grep -- #{escape(regexp)}"
@@ -5,6 +5,7 @@ require 'serverspec/matchers/be_readable'
5
5
  require 'serverspec/matchers/be_writable'
6
6
  require 'serverspec/matchers/be_executable'
7
7
  require 'serverspec/matchers/match_md5checksum'
8
+ require 'serverspec/matchers/match_sha256checksum'
8
9
 
9
10
  # port
10
11
  require 'serverspec/matchers/be_listening'
@@ -0,0 +1,5 @@
1
+ RSpec::Matchers.define :match_sha256checksum do |pattern|
2
+ match do |file|
3
+ file.match_sha256checksum(pattern)
4
+ end
5
+ end
@@ -69,6 +69,10 @@ module Serverspec
69
69
  backend.check_file_md5checksum(@name, md5sum)
70
70
  end
71
71
 
72
+ def match_sha256checksum(sha256sum)
73
+ backend.check_file_sha256checksum(@name, sha256sum)
74
+ end
75
+
72
76
  end
73
77
  end
74
78
  end
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.3"
3
3
  end
@@ -379,3 +379,12 @@ end
379
379
  describe file('invalid-file') do
380
380
  it { should_not match_md5checksum 'INVALIDMD5CHECKSUM' }
381
381
  end
382
+
383
+ describe file('/etc/services') do
384
+ it { should match_sha256checksum '0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a' }
385
+ its(:command) { should eq "openssl sha256 /etc/services | cut -d'=' -f2 | cut -c 2- | grep -E ^0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a$" }
386
+ end
387
+
388
+ describe file('invalid-file') do
389
+ it { should_not match_sha256checksum 'INVALIDSHA256CHECKSUM' }
390
+ end
@@ -379,3 +379,12 @@ end
379
379
  describe file('invalid-file') do
380
380
  it { should_not match_md5checksum 'INVALIDMD5CHECKSUM' }
381
381
  end
382
+
383
+ describe file('/etc/services') do
384
+ it { should match_sha256checksum '0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a' }
385
+ its(:command) { should eq "sha256sum /etc/services | grep -iw -- ^0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a" }
386
+ end
387
+
388
+ describe file('invalid-file') do
389
+ it { should_not match_sha256checksum 'INVALIDSHA256CHECKSUM' }
390
+ end
@@ -379,3 +379,12 @@ end
379
379
  describe file('invalid-file') do
380
380
  it { should_not match_md5checksum 'INVALIDMD5CHECKSUM' }
381
381
  end
382
+
383
+ describe file('/etc/services') do
384
+ it { should match_sha256checksum '0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a' }
385
+ its(:command) { should eq "sha256sum /etc/services | grep -iw -- ^0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a" }
386
+ end
387
+
388
+ describe file('invalid-file') do
389
+ it { should_not match_sha256checksum 'INVALIDSHA256CHECKSUM' }
390
+ end
@@ -379,3 +379,12 @@ end
379
379
  describe file('invalid-file') do
380
380
  it { should_not match_md5checksum 'INVALIDMD5CHECKSUM' }
381
381
  end
382
+
383
+ describe file('/etc/services') do
384
+ it { should match_sha256checksum '0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a' }
385
+ its(:command) { should eq "sha256sum /etc/services | grep -iw -- ^0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a" }
386
+ end
387
+
388
+ describe file('invalid-file') do
389
+ it { should_not match_sha256checksum 'INVALIDSHA256CHECKSUM' }
390
+ end
@@ -379,3 +379,12 @@ end
379
379
  describe file('invalid-file') do
380
380
  it { should_not match_md5checksum 'INVALIDMD5CHECKSUM' }
381
381
  end
382
+
383
+ describe file('/etc/services') do
384
+ it { should match_sha256checksum '0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a' }
385
+ its(:command) { should eq "sha256sum /etc/services | grep -iw -- ^0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a" }
386
+ end
387
+
388
+ describe file('invalid-file') do
389
+ it { should_not match_sha256checksum 'INVALIDSHA256CHECKSUM' }
390
+ end
@@ -379,3 +379,12 @@ end
379
379
  describe file('invalid-file') do
380
380
  it { should_not match_md5checksum 'INVALIDMD5CHECKSUM' }
381
381
  end
382
+
383
+ describe file('/etc/services') do
384
+ it { should match_sha256checksum '0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a' }
385
+ its(:command) { should eq "sha256sum /etc/services | grep -iw -- ^0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a" }
386
+ end
387
+
388
+ describe file('invalid-file') do
389
+ it { should_not match_sha256checksum 'INVALIDSHA256CHECKSUM' }
390
+ end
metadata CHANGED
@@ -1,36 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serverspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
5
- prerelease:
4
+ version: 0.7.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Gosuke Miyashita
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-07-27 00:00:00.000000000 Z
11
+ date: 2013-07-31 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: net-ssh
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rspec
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
@@ -46,23 +41,20 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: highline
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: bundler
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ~>
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ~>
76
67
  - !ruby/object:Gem::Version
@@ -78,49 +69,43 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rake
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - '>='
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - '>='
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: guard-rspec
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - '>='
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - '>='
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: growl
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - '>='
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - '>='
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0'
126
111
  description: RSpec tests for your servers configured by Puppet, Chef or anything else
@@ -188,6 +173,7 @@ files:
188
173
  - lib/serverspec/matchers/have_entry.rb
189
174
  - lib/serverspec/matchers/have_rule.rb
190
175
  - lib/serverspec/matchers/match_md5checksum.rb
176
+ - lib/serverspec/matchers/match_sha256checksum.rb
191
177
  - lib/serverspec/matchers/return_exit_status.rb
192
178
  - lib/serverspec/matchers/return_stderr.rb
193
179
  - lib/serverspec/matchers/return_stdout.rb
@@ -325,27 +311,26 @@ files:
325
311
  homepage: http://serverspec.org/
326
312
  licenses:
327
313
  - MIT
314
+ metadata: {}
328
315
  post_install_message:
329
316
  rdoc_options: []
330
317
  require_paths:
331
318
  - lib
332
319
  required_ruby_version: !ruby/object:Gem::Requirement
333
- none: false
334
320
  requirements:
335
- - - ! '>='
321
+ - - '>='
336
322
  - !ruby/object:Gem::Version
337
323
  version: '0'
338
324
  required_rubygems_version: !ruby/object:Gem::Requirement
339
- none: false
340
325
  requirements:
341
- - - ! '>='
326
+ - - '>='
342
327
  - !ruby/object:Gem::Version
343
328
  version: '0'
344
329
  requirements: []
345
330
  rubyforge_project:
346
- rubygems_version: 1.8.25
331
+ rubygems_version: 2.0.3
347
332
  signing_key:
348
- specification_version: 3
333
+ specification_version: 4
349
334
  summary: RSpec tests for your servers configured by Puppet, Chef or anything else
350
335
  test_files:
351
336
  - spec/backend/exec/configuration_spec.rb