chef 12.14.77 → 12.14.89

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: f238d8213ca83a033e4a0b33d1ddbcd84faff558
4
- data.tar.gz: 091ddef5ed0da2c3efff005e0d7a92396c2de734
3
+ metadata.gz: f5c1b7c5f14bd4b152b16251398d80aaf177c0c2
4
+ data.tar.gz: 49a8ce22071953677bc22f8724b605e8997bb465
5
5
  SHA512:
6
- metadata.gz: be88c3ef8e19844f0de34a6faeb3fd23121663669c05a916d7cf86108bcaeb1ec2a1c643784797c33d9b2e8462d0b43f440520754c8e1c81be65ff856346591a
7
- data.tar.gz: 41df34ec6672cbd6c860e6b94d939b3fb66879bdb056287f7072d79e801363399fac7e97a76fd5b00573fe558007fa9c7512a445b7bac9ba0ed70f5c2e406c6e
6
+ metadata.gz: a5a87a2d638d934da1a86c14904f2f5f1a00cc5ac42b453173c27c3d7cbbb4fe4c3facdd9dade6a53e8a5f91068d24ce39af7a2ff134d7befdd351cc43783fe0
7
+ data.tar.gz: e8c0f6b2b76315a740357b4a1a2ebec359ea371daf5918a902494fd1036b2ccf08047d4c575fd88208f2eb4f5750bf29db04522d4e585b63f222cd4cc37cac3e
data/VERSION CHANGED
@@ -1 +1 @@
1
- 12.14.77
1
+ 12.14.89
@@ -11,12 +11,12 @@ GEM
11
11
  specs:
12
12
  addressable (2.4.0)
13
13
  artifactory (2.5.0)
14
- aws-sdk (2.6.1)
15
- aws-sdk-resources (= 2.6.1)
16
- aws-sdk-core (2.6.1)
14
+ aws-sdk (2.6.2)
15
+ aws-sdk-resources (= 2.6.2)
16
+ aws-sdk-core (2.6.2)
17
17
  jmespath (~> 1.0)
18
- aws-sdk-resources (2.6.1)
19
- aws-sdk-core (= 2.6.1)
18
+ aws-sdk-resources (2.6.2)
19
+ aws-sdk-core (= 2.6.2)
20
20
  berkshelf (4.3.5)
21
21
  addressable (~> 2.3, >= 2.3.4)
22
22
  berkshelf-api-client (~> 2.0, >= 2.0.2)
@@ -53,7 +53,7 @@ GEM
53
53
  celluloid-io (0.16.2)
54
54
  celluloid (>= 0.16.0)
55
55
  nio4r (>= 1.1.0)
56
- chef-config (12.14.60)
56
+ chef-config (12.14.77)
57
57
  addressable
58
58
  fuzzyurl
59
59
  mixlib-config (~> 2.0)
@@ -77,7 +77,7 @@ GEM
77
77
  hashie (3.4.6)
78
78
  hitimes (1.2.4)
79
79
  httpclient (2.7.2)
80
- inspec (0.34.1)
80
+ inspec (0.35.0)
81
81
  hashie (~> 3.4)
82
82
  json (>= 1.8, < 3.0)
83
83
  method_source (~> 0.8)
@@ -115,7 +115,7 @@ GEM
115
115
  mixlib-authentication (1.4.1)
116
116
  mixlib-log
117
117
  mixlib-config (2.2.4)
118
- mixlib-install (1.2.0)
118
+ mixlib-install (1.2.2)
119
119
  artifactory
120
120
  mixlib-shellout
121
121
  mixlib-versioning
@@ -198,7 +198,7 @@ GEM
198
198
  thor (0.19.1)
199
199
  timers (4.0.4)
200
200
  hitimes
201
- train (0.19.1)
201
+ train (0.20.0)
202
202
  docker-api (~> 1.26)
203
203
  json (>= 1.8, < 3.0)
204
204
  mixlib-shellout (~> 2.0)
@@ -1,15 +1,16 @@
1
1
  # Acceptance Testing for Chef Client
2
- This folder contains acceptance tests that are required for Chef client
3
- release readiness.
2
+
3
+ This folder contains acceptance tests that are required for Chef client release readiness.
4
4
 
5
5
  ## Getting started
6
- The tests use the _chef-acceptance_ gem as the high level framework.
7
- All the gems needed to run these tests can be installed with Bundler.
6
+
7
+ The tests use the _chef-acceptance_ gem as the high level framework. All the gems needed to run these tests can be installed with Bundler from this directory.
8
8
 
9
9
  ### Important Note!
10
- Before running chef-acceptance, you *MUST* do the following on your current session:
11
10
 
12
- ```
11
+ Before running chef-acceptance, you _MUST_ do the following on your current session:
12
+
13
+ ```shell
13
14
  export APPBUNDLER_ALLOW_RVM=true
14
15
  ```
15
16
 
@@ -17,14 +18,14 @@ export APPBUNDLER_ALLOW_RVM=true
17
18
 
18
19
  ### Set up for local VM (Vagrant)
19
20
 
20
- If you intend to run the acceptance tests on a local VM, the supported solution is to use Vagrant.
21
- Ensure that Vagrant is installed on the machine that tests will run from, along with a
22
- virtualization driver (E.g.: VirtualBox).
21
+ If you intend to run the acceptance tests on a local VM, the supported solution is to use Vagrant. Ensure that Vagrant is installed on the machine that tests will run from, along with a virtualization driver (E.g.: VirtualBox).
23
22
 
24
- Set up the KITCHEN_DRIVER environment variable appropriately (value should be "vagrant"). E.g.:
25
- ```
23
+ Set up the KITCHEN_DRIVER environment variable appropriately (value should be "vagrant"). E.g.:
24
+
25
+ ```shell
26
26
  export KITCHEN_DRIVER=vagrant
27
27
  ```
28
+
28
29
  Add this to your shell profile or startup script as needed.
29
30
 
30
31
  ### Set up for cloud VM (EC2)
@@ -34,44 +35,59 @@ If you intend to run the acceptance tests on a cloud VM, the supported solution
34
35
  The steps you will need to do are:
35
36
 
36
37
  1. Add your AWS credentials to the machine - e.g., to the ~/.aws/credentials directory.
37
- - The easiest way to do this is to download the aws command line (`brew install awscli` on OS/X) and run `aws configure`.
38
+
39
+ - The easiest way to do this is to download the aws command line (`brew install awscli` on OS/X) and run `aws configure`.
40
+
38
41
  2. Create or import a SSH key to AWS. (If you already have one, you can skip the import/create)
39
- - In the AWS console, click Key Pairs, then Create Key Pair or Import Key Pair.
42
+
43
+ - In the AWS console, click Key Pairs, then Create Key Pair or Import Key Pair.
44
+
40
45
  3. Copy or move the private key file (USERNAME.pem) to the SSH folder (e.g. `~/.ssh/USERNAME.pem`).
41
- - If you Created a key pair in step 2, download the private key and move it to `~/.ssh`.
42
- - If you Importd a key pair in step 2, just ensure your private key is in `~/.ssh` and has the same name as the key pair (`~/.ssh/USERNAME` or `~/.ssh/USERNAME.pem`).
46
+
47
+ - If you Created a key pair in step 2, download the private key and move it to `~/.ssh`.
48
+ - If you Importd a key pair in step 2, just ensure your private key is in `~/.ssh` and has the same name as the key pair (`~/.ssh/USERNAME` or `~/.ssh/USERNAME.pem`).
49
+
43
50
  4. Set AWS_SSH_KEY_ID to the SSH key name.
44
- - This is **optional** if your AWS SSH key name is your local username.
45
- - You may want to set this in your shell `.profile`.
46
51
 
47
- ```shell
48
- export AWS_SSH_KEY_ID=name-of-private-key
49
- ```
52
+ - This is **optional** if your AWS SSH key name is your local username.
53
+ - You may want to set this in your shell `.profile`.
54
+
55
+ ```shell
56
+ export AWS_SSH_KEY_ID=name-of-private-key
57
+ ```
58
+
50
59
  5. Set the private key to only be readable by root
51
60
 
52
- ```shell
53
- chmod 0400 ~/.ssh/USERNAME.pem
54
- ```
61
+ ```shell
62
+ chmod 0400 ~/.ssh/USERNAME.pem
63
+ ```
64
+
55
65
  6. Set up the KITCHEN_DRIVER environment variable appropriately (value should be "ec2"). (This is optional, as ec2 is the default.) E.g.:
56
66
 
57
- ```shell
58
- export KITCHEN_DRIVER=ec2
59
- ```
60
- Add this to your shell profile or startup script as needed.
67
+ ```shell
68
+ export KITCHEN_DRIVER=ec2
69
+ ```
70
+
71
+ Add this to your shell profile or startup script as needed.
72
+
61
73
  7. **Connect to Chef VPN**. The instances you create will not have public IPs!
62
74
 
63
75
  ## Setting up and running a test suite
76
+
64
77
  To get started, do a bundle install from the acceptance directory:
78
+
65
79
  ```shell
66
80
  chef/acceptance$ bundle install --binstubs
67
81
  ```
68
82
 
69
83
  To get some basic info and ensure chef-acceptance can be run, do:
84
+
70
85
  ```shell
71
86
  chef/acceptance$ bin/chef-acceptance info
72
87
  ```
73
88
 
74
89
  To run a particular test suite, do the following:
90
+
75
91
  ```shell
76
92
  chef/acceptance$ bin/chef-acceptance test TEST_SUITE
77
93
  ```
@@ -83,26 +99,20 @@ chef/acceptance$ export KITCHEN_INSTANCES=*-ubuntu-1404
83
99
  chef/acceptance$ bin/chef-acceptance test cookbook-git
84
100
  ```
85
101
 
86
- If KITCHEN_INSTANCES is not specified, the default instances are default-ubuntu-1404 and default-windows-windows-2012r2. All selected instances will be run in *parallel* if the driver supports it (ec2 does, vagrant doesn't).
102
+ If KITCHEN_INSTANCES is not specified, the default instances are default-ubuntu-1404 and default-windows-windows-2012r2\. All selected instances will be run in _parallel_ if the driver supports it (ec2 does, vagrant doesn't).
87
103
 
88
104
  ## Optional Settings
89
105
 
90
- In addition to the environment settings above, there are a number of
91
- key values that are available to set for changing the way the acceptance
92
- tests are run.
106
+ In addition to the environment settings above, there are a number of key values that are available to set for changing the way the acceptance tests are run.
93
107
 
94
108
  ### KITCHEN_CHEF_CHANNEL
95
109
 
96
- Use this setting to specify which channel we will pull the chef build from.
97
- The default is to use the "current" channel, unless the ARTIFACTORY_USERNAME is set
98
- (which normally happens when running under Jenkins), in which case the default is
99
- changed to "unstable".
110
+ Use this setting to specify which channel we will pull the chef build from. The default is to use the "current" channel, unless the ARTIFACTORY_USERNAME is set (which normally happens when running under Jenkins), in which case the default is changed to "unstable".
100
111
 
101
112
  ```shell
102
113
  export KITCHEN_CHEF_CHANNEL=name-of-channel
103
114
  ```
104
115
 
105
-
106
116
  ### KITCHEN_CHEF_VERSION
107
117
 
108
118
  Use this setting to override the version of the Chef client that is installed. The default is to get the latest version in the desired channel.
@@ -122,11 +132,6 @@ export ARTIFACTORY_PASSWORD=password
122
132
 
123
133
  ## Future Work
124
134
 
125
- Currently, there is no simple mechanism for chef-acceptance
126
- to build an Omnibus package of the developers local chef
127
- instance and run acceptance tests on it - the only packages
128
- that can be exercised are ones that come from one of the
129
- pipeline channels (unstable, current or stable).
135
+ Currently, there is no simple mechanism for chef-acceptance to build an Omnibus package of the developers local chef instance and run acceptance tests on it - the only packages that can be exercised are ones that come from one of the pipeline channels (unstable, current or stable).
130
136
 
131
- This is not an issue when adding acceptance tests for pre-existing functionality (as that functionality is presumed
132
- to already be in a build in one of the pipeline channels).
137
+ This is not an issue when adding acceptance tests for pre-existing functionality (as that functionality is presumed to already be in a build in one of the pipeline channels).
@@ -175,23 +175,19 @@ class Chef
175
175
 
176
176
  def extract_nested_value(data, nested_value_spec)
177
177
  nested_value_spec.split(".").each do |attr|
178
- if data.nil?
179
- nil # don't get no method error on nil
180
- # Must check :[] before attr because spec can include
181
- # `keys` - want the key named `keys`, not a list of
182
- # available keys.
183
- elsif data.respond_to?(:[]) && data.has_key?(attr)
184
- data = data[attr]
185
- elsif data.respond_to?(attr.to_sym)
186
- data = data.send(attr.to_sym)
187
- else
188
- data = begin
189
- data.send(attr.to_sym)
190
- rescue NoMethodError
191
- nil
192
- end
193
- end
178
+ data =
179
+ if data.is_a?(Array)
180
+ data[attr.to_i]
181
+ elsif data.respond_to?(:[], false) && data.key?(attr)
182
+ data[attr]
183
+ elsif data.respond_to?(attr.to_sym, false)
184
+ # handles -a chef_environment and other things that hang of the node and aren't really attributes
185
+ data.public_send(attr.to_sym)
186
+ else
187
+ nil
188
+ end
194
189
  end
190
+ # necessary (?) for coercing objects (the run_list object?) to hashes
195
191
  ( !data.kind_of?(Array) && data.respond_to?(:to_hash) ) ? data.to_hash : data
196
192
  end
197
193
 
@@ -27,6 +27,11 @@ class Chef
27
27
  Chef::Digester.checksum_for_file(file)
28
28
  end
29
29
 
30
+ def short_cksum(checksum)
31
+ return "none" if checksum.nil?
32
+ checksum.slice(0, 6)
33
+ end
34
+
30
35
  end
31
36
  end
32
37
  end
@@ -344,7 +344,7 @@ class Chef
344
344
  end
345
345
 
346
346
  def do_validate_content
347
- if new_resource.checksum && tempfile && ( new_resource.checksum != tempfile_checksum )
347
+ if new_resource.checksum && tempfile && ( new_resource.checksum.downcase != tempfile_checksum )
348
348
  raise Chef::Exceptions::ChecksumMismatch.new(short_cksum(new_resource.checksum), short_cksum(tempfile_checksum))
349
349
  end
350
350
 
@@ -462,11 +462,6 @@ class Chef
462
462
  @tempfile ||= content.tempfile
463
463
  end
464
464
 
465
- def short_cksum(checksum)
466
- return "none" if checksum.nil?
467
- checksum.slice(0, 6)
468
- end
469
-
470
465
  def load_resource_attributes_from_file(resource)
471
466
  if Chef::Platform.windows?
472
467
  # This is a work around for CHEF-3554.
@@ -250,7 +250,7 @@ class Chef
250
250
  def validate_content!
251
251
  if new_resource.checksum
252
252
  source_checksum = checksum(source_location)
253
- if new_resource.checksum != source_checksum
253
+ if new_resource.checksum.downcase != source_checksum
254
254
  raise Chef::Exceptions::ChecksumMismatch.new(short_cksum(new_resource.checksum), short_cksum(source_checksum))
255
255
  end
256
256
  end
@@ -193,7 +193,6 @@ class Chef
193
193
  f.group "root"
194
194
  f.mode "0644"
195
195
  f.content new_resource.to_ini
196
- f.verify systemd_analyze_cmd if systemd_analyze_path
197
196
  end.run_action(action)
198
197
  end
199
198
 
@@ -234,14 +233,6 @@ class Chef
234
233
  {}
235
234
  end
236
235
  end
237
-
238
- def systemd_analyze_cmd
239
- @systemd_analyze_cmd ||= "#{systemd_analyze_path} verify %{path}"
240
- end
241
-
242
- def systemd_analyze_path
243
- @systemd_analyze_path ||= which("systemd-analyze")
244
- end
245
236
  end
246
237
  end
247
238
  end
@@ -69,7 +69,7 @@ class Chef
69
69
  property :options, Hash
70
70
 
71
71
  default_action :create
72
- allowed_actions :create, :remove, :make_cache, :add, :delete
72
+ allowed_actions :create, :remove, :makecache, :add, :delete
73
73
 
74
74
  # provide compatibility with the yum cookbook < 3.0 properties
75
75
  alias_method :url, :baseurl
@@ -21,7 +21,7 @@
21
21
 
22
22
  class Chef
23
23
  CHEF_ROOT = File.expand_path("../..", __FILE__)
24
- VERSION = "12.14.77"
24
+ VERSION = "12.14.89"
25
25
  end
26
26
 
27
27
  #
@@ -113,7 +113,7 @@ EOM
113
113
  ruby_block "sleeping" do
114
114
  block do
115
115
  retries = 200
116
- while IO.read(Chef::Config[:log_location]) !~ /Chef client [0-9]+ is running, will wait for it to finish and then run./
116
+ while IO.read(Chef::Config[:log_location]) !~ /Chef client .* is running, will wait for it to finish and then run./
117
117
  sleep 0.1
118
118
  raise "we ran out of retries" if ( retries -= 1 ) <= 0
119
119
  end
@@ -157,7 +157,7 @@ EOM
157
157
  run_log = File.read(path_to("logs/runs.log"))
158
158
 
159
159
  # second run should have a message which indicates it's waiting for the first run
160
- expect(run_log).to match(/Chef client [0-9]+ is running, will wait for it to finish and then run./)
160
+ expect(run_log).to match(/Chef client .* is running, will wait for it to finish and then run./)
161
161
 
162
162
  # both of the runs should succeed
163
163
  expect(run_log.lines.reject { |l| !l.include? "INFO: Chef Run complete in" }.length).to eq(2)
@@ -377,12 +377,33 @@ EOM
377
377
  end
378
378
 
379
379
  it "should return the name attribute" do
380
- allow_any_instance_of(Chef::Node).to receive(:name).and_return("chef.localdomain")
381
380
  input = Chef::Node.new
381
+ input.name("chef.localdomain")
382
382
  @ui.config[:attribute] = "name"
383
383
  expect(@ui.format_for_display(input)).to eq( { "chef.localdomain" => { "name" => "chef.localdomain" } })
384
384
  end
385
385
 
386
+ it "should return a 'class' attribute and not the node.class" do
387
+ input = Chef::Node.new
388
+ input.default["class"] = "classy!"
389
+ @ui.config[:attribute] = "class"
390
+ expect(@ui.format_for_display(input)).to eq( { nil => { "class" => "classy!" } } )
391
+ end
392
+
393
+ it "should return the chef_environment attribute" do
394
+ input = Chef::Node.new
395
+ input.chef_environment = "production-partner-load-integration-preview-testing"
396
+ @ui.config[:attribute] = "chef_environment"
397
+ expect(@ui.format_for_display(input)).to eq( { nil => { "chef_environment" => "production-partner-load-integration-preview-testing" } } )
398
+ end
399
+
400
+ it "works with arrays" do
401
+ input = Chef::Node.new
402
+ input.default["array"] = %w{zero one two}
403
+ @ui.config[:attribute] = "array.1"
404
+ expect(@ui.format_for_display(input)).to eq( { nil => { "array.1" => "one" } } )
405
+ end
406
+
386
407
  it "returns nil when given an attribute path that isn't a name or attribute" do
387
408
  input = { "keys" => { "keys" => "values" }, "hi" => "ho", "id" => "sample-data-bag-item" }
388
409
  non_existing_path = "nope.nada.nothingtoseehere"
@@ -37,4 +37,18 @@ describe Chef::Mixin::Checksum do
37
37
  expect(@checksum_user.checksum(@file)).to eq("09ee9c8cc70501763563bcf9c218d71b2fbf4186bf8e1e0da07f0f42c80a3394")
38
38
  end
39
39
 
40
+ describe "short_cksum" do
41
+ context "nil provided for checksum" do
42
+ it "returns none" do
43
+ expect(@checksum_user.short_cksum(nil)).to eq("none")
44
+ end
45
+ end
46
+
47
+ context "non-nil provided for checksum" do
48
+ it "returns the short checksum" do
49
+ expect(@checksum_user.short_cksum("u7ghbxikk3i9blsimmy2y2ionmxx")).to eq("u7ghbx")
50
+ end
51
+ end
52
+ end
53
+
40
54
  end
@@ -394,4 +394,49 @@ describe Chef::Provider::Package::Windows, :windows_only do
394
394
  end
395
395
  end
396
396
  end
397
+
398
+ shared_context "valid checksum" do
399
+ context "checksum is valid" do
400
+ before do
401
+ allow(provider).to receive(:checksum).and_return("jiie00u3bbs92vsbhvgvklb2lasgh20ah")
402
+ end
403
+
404
+ it "does not raise the checksum mismatch exception" do
405
+ expect { provider.send(:validate_content!) }.to_not raise_error
406
+ end
407
+ end
408
+ end
409
+
410
+ shared_context "invalid checksum" do
411
+ context "checksum is invalid" do
412
+ before do
413
+ allow(provider).to receive(:checksum).and_return("kiie30u3bbs92vsbhvgvklb2lasgh20ah")
414
+ end
415
+
416
+ it "raises the checksum mismatch exception" do
417
+ expect { provider.send(:validate_content!) }.to raise_error(
418
+ Chef::Exceptions::ChecksumMismatch)
419
+ end
420
+ end
421
+ end
422
+
423
+ describe "validate_content!" do
424
+ before(:each) do
425
+ new_resource.checksum("jiie00u3bbs92vsbhvgvklb2lasgh20ah")
426
+ end
427
+
428
+ context "checksum is in lowercase" do
429
+ include_context "valid checksum"
430
+ include_context "invalid checksum"
431
+ end
432
+
433
+ context "checksum is in uppercase" do
434
+ before do
435
+ new_resource.checksum = new_resource.checksum.upcase
436
+ end
437
+
438
+ include_context "valid checksum"
439
+ include_context "invalid checksum"
440
+ end
441
+ end
397
442
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.14.77
4
+ version: 12.14.89
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-19 00:00:00.000000000 Z
11
+ date: 2016-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-config
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 12.14.77
19
+ version: 12.14.89
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 12.14.77
26
+ version: 12.14.89
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mixlib-cli
29
29
  requirement: !ruby/object:Gem::Requirement