inspec 0.14.0 → 0.14.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: 0e8809fbed2418c889f95bdd22b409fe730ccb92
4
- data.tar.gz: a21f007a1136db0e5869d8789152a59ef648f462
3
+ metadata.gz: 84dfdf4c3180317c15fcb732fcf4cc0098b8177d
4
+ data.tar.gz: e239dd876de5734c0fd5ff9f3f539e55df91450b
5
5
  SHA512:
6
- metadata.gz: 9a28f59896f7ae9ce9668ec6c6ba03ff78b1437e1d1a10def6bdb9967fc1257f4b8f22395e5174ca4b2271dcf7f27165f302d0dd4f535c04f7351faa7919139a
7
- data.tar.gz: c4e01382ab5344ce014379172526f770341cb3fab75cb8da24be156f13efba8316fc2a0b055d96e6148e1a1b700e10a04386e387c9da98c726f7ab5e3e234c31
6
+ metadata.gz: 3c608e883ca7d72f263e9e5758ad589391a59ea6b68873bd3d3febd3c98b5e0eeb61b8ae0a0ba913ede5b600088281b9fdb3d303863515b401680ac0cbe3bd2d
7
+ data.tar.gz: 5334c5fa729531fca7de775064fb3b82cd0f93efe7d0adf9e9b8b8c2bc28dea4ccfc1f4dd2abcf81af695e6ac79c275231ad18315f55655ead316c3a208942b0
data/CHANGELOG.md CHANGED
@@ -1,7 +1,19 @@
1
1
  # Change Log
2
2
 
3
- ## [0.14.0](https://github.com/chef/inspec/tree/0.14.0) (2016-02-22)
4
- [Full Changelog](https://github.com/chef/inspec/compare/v0.13.0...0.14.0)
3
+ ## [0.14.1](https://github.com/chef/inspec/tree/0.14.1) (2016-02-22)
4
+ [Full Changelog](https://github.com/chef/inspec/compare/v0.14.0...0.14.1)
5
+
6
+ **Implemented enhancements:**
7
+
8
+ - optimize appveyor [\#479](https://github.com/chef/inspec/pull/479) ([chris-rock](https://github.com/chris-rock))
9
+ - fix windows tests [\#478](https://github.com/chef/inspec/pull/478) ([srenatus](https://github.com/srenatus))
10
+
11
+ **Fixed bugs:**
12
+
13
+ - ignore `pax\_global\_header` as valid file [\#480](https://github.com/chef/inspec/pull/480) ([chris-rock](https://github.com/chris-rock))
14
+
15
+ ## [v0.14.0](https://github.com/chef/inspec/tree/v0.14.0) (2016-02-22)
16
+ [Full Changelog](https://github.com/chef/inspec/compare/v0.13.0...v0.14.0)
5
17
 
6
18
  **Fixed bugs:**
7
19
 
@@ -10,6 +22,10 @@
10
22
  - bugfix: handle edge-cases in upstart service [\#474](https://github.com/chef/inspec/pull/474) ([arlimus](https://github.com/arlimus))
11
23
  - replace targets with fetcher+reader system [\#473](https://github.com/chef/inspec/pull/473) ([arlimus](https://github.com/arlimus))
12
24
 
25
+ **Merged pull requests:**
26
+
27
+ - 0.14.0 [\#477](https://github.com/chef/inspec/pull/477) ([arlimus](https://github.com/arlimus))
28
+
13
29
  ## [v0.13.0](https://github.com/chef/inspec/tree/v0.13.0) (2016-02-19)
14
30
  [Full Changelog](https://github.com/chef/inspec/compare/v0.12.0...v0.13.0)
15
31
 
@@ -33,6 +33,10 @@ module Inspec
33
33
  end
34
34
  end
35
35
 
36
+ BLACKLIST_FILES = [
37
+ 'pax_global_header',
38
+ ].freeze
39
+
36
40
  class RelFetcher < Fetcher
37
41
  attr_reader :files
38
42
  attr_reader :prefix
@@ -56,6 +60,10 @@ module Inspec
56
60
 
57
61
  def get_prefix(fs)
58
62
  return '' if fs.empty?
63
+
64
+ # filter backlisted files
65
+ fs -= BLACKLIST_FILES
66
+
59
67
  sorted = fs.sort_by(&:length)
60
68
  get_folder_prefix(sorted)
61
69
  end
@@ -3,5 +3,5 @@
3
3
  # author: Christoph Hartmann
4
4
 
5
5
  module Inspec
6
- VERSION = '0.14.0'.freeze
6
+ VERSION = '0.14.1'.freeze
7
7
  end
data/test/helper.rb CHANGED
@@ -17,6 +17,7 @@ end
17
17
  require 'fileutils'
18
18
  require 'pathname'
19
19
  require 'tempfile'
20
+ require 'tmpdir'
20
21
  require 'zip'
21
22
 
22
23
  require 'utils/base_cli'
@@ -51,8 +52,6 @@ class MockLoader
51
52
  undefined: { family: nil, release: nil, arch: nil },
52
53
  }
53
54
 
54
- @archives = {}
55
-
56
55
  # pass the os identifier to emulate a specific operating system
57
56
  def initialize(os = nil)
58
57
  # selects operating system
@@ -266,9 +265,7 @@ class MockLoader
266
265
 
267
266
  def self.profile_tgz(name)
268
267
  path = File.join(home, 'mock', 'profiles', name)
269
- archive = Tempfile.new([name, '.tar.gz'])
270
- dst = archive.path
271
- archive.close
268
+ dst = File.join(Dir.tmpdir, Dir::Tmpname.make_tmpname(name, '.tar.gz'))
272
269
 
273
270
  # generate relative paths
274
271
  files = Dir.glob("#{path}/**/*")
@@ -277,16 +274,13 @@ class MockLoader
277
274
  require 'inspec/archive/tar'
278
275
  tag = Inspec::Archive::TarArchiveGenerator.new
279
276
  tag.archive(path, relatives, dst)
280
- @archives[dst] = archive
281
277
 
282
278
  dst
283
279
  end
284
280
 
285
281
  def self.profile_zip(name, opts = {})
286
282
  path = File.join(home, 'mock', 'profiles', name)
287
- archive = Tempfile.new([name, '.zip'])
288
- dst = archive.path
289
- archive.close
283
+ dst = File.join(Dir.tmpdir, Dir::Tmpname.make_tmpname(name, '.zip'))
290
284
 
291
285
  # rubyzip only works relative paths
292
286
  files = Dir.glob("#{path}/**/*")
@@ -295,7 +289,7 @@ class MockLoader
295
289
  require 'inspec/archive/zip'
296
290
  zag = Inspec::Archive::ZipArchiveGenerator.new
297
291
  zag.archive(path, relatives, dst)
298
- @archives[dst] = archive
292
+
299
293
  dst
300
294
  end
301
295
  end
@@ -48,6 +48,9 @@ describe Inspec::Plugins::RelFetcher do
48
48
  # extract folder structure buildup
49
49
  %w{/a /a/b /a/b/c} => %w{c},
50
50
  %w{/a /a/b /a/b/c/d/e} => %w{e},
51
+ # ignore pax_global_header, which are commonly seen in github tars and are not
52
+ # ignored by all tar streaming tools, its not extracted by GNU tar since 1.14
53
+ %w{/pax_global_header /a/b} => %w{b},
51
54
  }.each do |ins, outs|
52
55
  describe 'empty profile' do
53
56
  let(:in_files) { ins }
@@ -12,7 +12,7 @@ describe Fetchers::Tar do
12
12
  _(reg['tar']).must_equal fetcher
13
13
  end
14
14
 
15
- describe 'applied to a zipped archive' do
15
+ describe 'applied to a tar archive' do
16
16
  let(:target) { MockLoader.profile_tgz('complete-profile') }
17
17
  let(:res) { fetcher.resolve(target) }
18
18
 
@@ -82,7 +82,7 @@ describe Fetchers::Url do
82
82
  let(:res) {
83
83
  mock_open = Minitest::Mock.new
84
84
  mock_open.expect :meta, {'content-type' => 'application/gzip'}
85
- mock_open.expect :read, File.read(mock_file)
85
+ mock_open.expect :read, File.open(mock_file, 'rb').read
86
86
  fetcher.expects(:open).returns(mock_open)
87
87
  fetcher.resolve(target)
88
88
  }
@@ -115,7 +115,7 @@ describe Fetchers::Url do
115
115
  let(:res) {
116
116
  mock_open = Minitest::Mock.new
117
117
  mock_open.expect :meta, {'content-type' => 'application/zip'}
118
- mock_open.expect :read, File.read(mock_file)
118
+ mock_open.expect :read, File.open(mock_file, 'rb').read
119
119
  fetcher.expects(:open).returns(mock_open)
120
120
  fetcher.resolve(target)
121
121
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Richter
@@ -207,9 +207,6 @@ files:
207
207
  - examples/profile/controls/gordon.rb
208
208
  - examples/profile/inspec.yml
209
209
  - examples/profile/libraries/gordon_config.rb
210
- - examples/resource/controls/tiny.rb
211
- - examples/resource/inspec.yml
212
- - examples/resource/libraries/tiny.rb
213
210
  - inspec.gemspec
214
211
  - lib/bundles/README.md
215
212
  - lib/bundles/inspec-compliance.rb
@@ -224,7 +221,6 @@ files:
224
221
  - lib/bundles/inspec-init/templates/profile/controls/example.rb
225
222
  - lib/bundles/inspec-init/templates/profile/inspec.yml
226
223
  - lib/bundles/inspec-init/templates/profile/libraries/.gitkeep
227
- - lib/bundles/inspec-supermarket.rb
228
224
  - lib/bundles/inspec-supermarket/README.md
229
225
  - lib/bundles/inspec-supermarket/api.rb
230
226
  - lib/bundles/inspec-supermarket/cli.rb
@@ -486,8 +482,6 @@ files:
486
482
  - test/unit/mock/profiles/legacy-empty-metadata/metadata.rb
487
483
  - test/unit/mock/profiles/legacy-simple-metadata/metadata.rb
488
484
  - test/unit/mock/profiles/legacy-simple-metadata/test/.gitkeep
489
- - test/unit/mock/profiles/resource-tiny/inspec.yml
490
- - test/unit/mock/profiles/resource-tiny/libraries/resource.rb
491
485
  - test/unit/mock/profiles/simple-metadata/inspec.yml
492
486
  - test/unit/plugin_test.rb
493
487
  - test/unit/profile_context_test.rb
@@ -563,7 +557,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
563
557
  version: '0'
564
558
  requirements: []
565
559
  rubyforge_project:
566
- rubygems_version: 2.5.1
560
+ rubygems_version: 2.4.6
567
561
  signing_key:
568
562
  specification_version: 4
569
563
  summary: Infrastructure and compliance testing.
@@ -729,8 +723,6 @@ test_files:
729
723
  - test/unit/mock/profiles/legacy-empty-metadata/metadata.rb
730
724
  - test/unit/mock/profiles/legacy-simple-metadata/metadata.rb
731
725
  - test/unit/mock/profiles/legacy-simple-metadata/test/.gitkeep
732
- - test/unit/mock/profiles/resource-tiny/inspec.yml
733
- - test/unit/mock/profiles/resource-tiny/libraries/resource.rb
734
726
  - test/unit/mock/profiles/simple-metadata/inspec.yml
735
727
  - test/unit/plugin_test.rb
736
728
  - test/unit/profile_context_test.rb
@@ -1,3 +0,0 @@
1
- describe tiny do
2
- require 'pry'; binding.pry
3
- end
@@ -1,10 +0,0 @@
1
- name: resource
2
- title: InSpec Example Resources
3
- maintainer: Chef Software, Inc.
4
- copyright: Chef Software, Inc.
5
- copyright_email: support@chef.io
6
- license: Apache 2 license
7
- summary: Demonstrates the use of InSpec custom resources
8
- version: 1.0.0
9
- supports:
10
- - linux
@@ -1,3 +0,0 @@
1
- class Tiny < Inspec.resource(1)
2
- name 'tiny'
3
- end
@@ -1,13 +0,0 @@
1
- # encoding: utf-8
2
- # author: Christoph Hartmann
3
- # author: Dominik Richter
4
-
5
- libdir = File.dirname(__FILE__)
6
- $LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
7
-
8
- module Supermarket
9
- autoload :API, 'inspec-supermarket/api'
10
- end
11
-
12
- require 'inspec-supermarket/cli'
13
- require 'inspec-supermarket/target'
@@ -1,10 +0,0 @@
1
- name: complete
2
- title: complete example profile
3
- maintainer: Chef Software, Inc.
4
- copyright: Chef Software, Inc.
5
- copyright_email: support@chef.io
6
- license: Proprietary, All rights reserved
7
- summary: Testing stub
8
- version: 1.0.0
9
- supports:
10
- - os-family: linux
@@ -1,3 +0,0 @@
1
- class Tiny < Inspec.resource(1)
2
- name 'tiny'
3
- end