chef 10.14.0.beta.3 → 10.14.0.rc.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. data/distro/common/html/chef-client.8.html +4 -6
  2. data/distro/common/html/chef-expander.8.html +4 -4
  3. data/distro/common/html/chef-expanderctl.8.html +4 -4
  4. data/distro/common/html/chef-server-webui.8.html +4 -4
  5. data/distro/common/html/chef-server.8.html +4 -4
  6. data/distro/common/html/chef-solo.8.html +4 -4
  7. data/distro/common/html/chef-solr.8.html +4 -4
  8. data/distro/common/html/knife-bootstrap.1.html +4 -4
  9. data/distro/common/html/knife-client.1.html +4 -4
  10. data/distro/common/html/knife-configure.1.html +5 -5
  11. data/distro/common/html/knife-cookbook-site.1.html +7 -7
  12. data/distro/common/html/knife-cookbook.1.html +4 -4
  13. data/distro/common/html/knife-data-bag.1.html +4 -4
  14. data/distro/common/html/knife-environment.1.html +4 -4
  15. data/distro/common/html/knife-exec.1.html +4 -4
  16. data/distro/common/html/knife-index.1.html +4 -4
  17. data/distro/common/html/knife-node.1.html +5 -5
  18. data/distro/common/html/knife-role.1.html +4 -4
  19. data/distro/common/html/knife-search.1.html +4 -4
  20. data/distro/common/html/knife-ssh.1.html +5 -5
  21. data/distro/common/html/knife-status.1.html +4 -4
  22. data/distro/common/html/knife-tag.1.html +4 -4
  23. data/distro/common/html/knife.1.html +5 -5
  24. data/distro/common/html/shef.1.html +4 -4
  25. data/distro/common/man/man1/knife-bootstrap.1 +1 -1
  26. data/distro/common/man/man1/knife-client.1 +1 -1
  27. data/distro/common/man/man1/knife-configure.1 +1 -1
  28. data/distro/common/man/man1/knife-cookbook-site.1 +1 -1
  29. data/distro/common/man/man1/knife-cookbook.1 +1 -1
  30. data/distro/common/man/man1/knife-data-bag.1 +1 -1
  31. data/distro/common/man/man1/knife-environment.1 +1 -1
  32. data/distro/common/man/man1/knife-exec.1 +1 -1
  33. data/distro/common/man/man1/knife-index.1 +1 -1
  34. data/distro/common/man/man1/knife-node.1 +1 -1
  35. data/distro/common/man/man1/knife-role.1 +1 -1
  36. data/distro/common/man/man1/knife-search.1 +1 -1
  37. data/distro/common/man/man1/knife-ssh.1 +1 -1
  38. data/distro/common/man/man1/knife-status.1 +1 -1
  39. data/distro/common/man/man1/knife-tag.1 +1 -1
  40. data/distro/common/man/man1/knife.1 +5 -5
  41. data/distro/common/man/man1/shef.1 +1 -1
  42. data/distro/common/man/man8/chef-client.8 +1 -5
  43. data/distro/common/man/man8/chef-expander.8 +1 -1
  44. data/distro/common/man/man8/chef-expanderctl.8 +1 -1
  45. data/distro/common/man/man8/chef-server-webui.8 +1 -1
  46. data/distro/common/man/man8/chef-server.8 +1 -1
  47. data/distro/common/man/man8/chef-solo.8 +1 -1
  48. data/distro/common/man/man8/chef-solr.8 +1 -1
  49. data/distro/common/markdown/man1/knife.mkd +2 -2
  50. data/distro/common/markdown/man8/chef-client.mkd +0 -3
  51. data/lib/chef/client.rb +13 -3
  52. data/lib/chef/config.rb +29 -0
  53. data/lib/chef/environment.rb +5 -2
  54. data/lib/chef/file_access_control/unix.rb +3 -3
  55. data/lib/chef/knife.rb +11 -5
  56. data/lib/chef/knife/bootstrap.rb +9 -5
  57. data/lib/chef/knife/bootstrap/archlinux-gems.erb +1 -1
  58. data/lib/chef/knife/bootstrap/centos5-gems.erb +1 -1
  59. data/lib/chef/knife/bootstrap/chef-full.erb +1 -1
  60. data/lib/chef/knife/bootstrap/fedora13-gems.erb +1 -1
  61. data/lib/chef/knife/bootstrap/ubuntu10.04-apt.erb +1 -1
  62. data/lib/chef/knife/bootstrap/ubuntu10.04-gems.erb +1 -1
  63. data/lib/chef/knife/bootstrap/ubuntu12.04-gems.erb +1 -1
  64. data/lib/chef/knife/cookbook_create.rb +24 -1
  65. data/lib/chef/knife/ssh.rb +14 -2
  66. data/lib/chef/platform.rb +22 -2
  67. data/lib/chef/provider/file.rb +9 -3
  68. data/lib/chef/provider/group/usermod.rb +7 -4
  69. data/lib/chef/provider/mdadm.rb +3 -3
  70. data/lib/chef/provider/package/ips.rb +101 -0
  71. data/lib/chef/provider/package/solaris.rb +21 -12
  72. data/lib/chef/provider/service/solaris.rb +0 -3
  73. data/lib/chef/provider/user/dscl.rb +1 -1
  74. data/lib/chef/providers.rb +1 -0
  75. data/lib/chef/resource/ips_package.rb +42 -0
  76. data/lib/chef/resource/package.rb +6 -7
  77. data/lib/chef/resources.rb +1 -0
  78. data/lib/chef/rest/auth_credentials.rb +4 -3
  79. data/lib/chef/scan_access_control.rb +3 -9
  80. data/lib/chef/shef/ext.rb +22 -0
  81. data/lib/chef/version.rb +1 -1
  82. data/spec/functional/knife/cookbook_delete_spec.rb +5 -2
  83. data/spec/functional/knife/exec_spec.rb +5 -2
  84. data/spec/functional/knife/ssh_spec.rb +4 -2
  85. data/spec/functional/resource/link_spec.rb +4 -4
  86. data/spec/functional/resource/remote_file_spec.rb +17 -1
  87. data/spec/support/platform_helpers.rb +8 -0
  88. data/spec/support/shared/functional/securable_resource.rb +2 -2
  89. data/spec/tiny_server.rb +5 -1
  90. data/spec/unit/client_spec.rb +24 -0
  91. data/spec/unit/environment_spec.rb +26 -0
  92. data/spec/unit/knife/bootstrap_spec.rb +34 -11
  93. data/spec/unit/knife/config_file_selection_spec.rb +2 -2
  94. data/spec/unit/knife/configure_spec.rb +6 -0
  95. data/spec/unit/knife/cookbook_create_spec.rb +20 -0
  96. data/spec/unit/knife/ssh_spec.rb +145 -0
  97. data/spec/unit/mixin/command_spec.rb +8 -4
  98. data/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb +2 -1
  99. data/spec/unit/mixin/securable_spec.rb +2 -2
  100. data/spec/unit/provider/file_spec.rb +6 -4
  101. data/spec/unit/provider/group/usermod_spec.rb +6 -1
  102. data/spec/unit/provider/link_spec.rb +4 -1
  103. data/spec/unit/provider/mdadm_spec.rb +10 -13
  104. data/spec/unit/provider/package/ips_spec.rb +210 -0
  105. data/spec/unit/provider/package/solaris_spec.rb +6 -4
  106. data/spec/unit/provider/subversion_spec.rb +2 -2
  107. data/spec/unit/provider/user/dscl_spec.rb +15 -0
  108. data/spec/unit/resource/ips_package_spec.rb +43 -0
  109. data/spec/unit/rest/auth_credentials_spec.rb +36 -14
  110. data/spec/unit/scan_access_control_spec.rb +20 -0
  111. metadata +13 -8
@@ -64,7 +64,9 @@ PKGINFO
64
64
  it "should raise an exception if a source is supplied but not found" do
65
65
  @provider.stub!(:popen4).and_return(@status)
66
66
  ::File.stub!(:exists?).and_return(false)
67
- lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Package)
67
+ @provider.define_resource_requirements
68
+ @provider.load_current_resource
69
+ lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Package)
68
70
  end
69
71
 
70
72
 
@@ -89,13 +91,13 @@ PKGINFO
89
91
  end
90
92
 
91
93
  it "should raise an exception if the source is not set but we are installing" do
92
- @provider.stub!(:popen4).and_return(@status)
93
94
  @new_resource = Chef::Resource::Package.new("SUNWbash")
94
95
  @provider = Chef::Provider::Package::Solaris.new(@new_resource, @run_context)
95
- lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Package)
96
+ @provider.stub!(:popen4).and_return(@status)
97
+ lambda { @provider.run_action(:install) }.should raise_error(Chef::Exceptions::Package)
96
98
  end
97
99
 
98
- it "should raise an exception if rpm fails to run" do
100
+ it "should raise an exception if pkginfo fails to run" do
99
101
  @status = mock("Status", :exitstatus => -1)
100
102
  @provider.stub!(:popen4).and_return(@status)
101
103
  lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Package)
@@ -141,7 +141,7 @@ describe Chef::Provider::Subversion do
141
141
  end
142
142
 
143
143
  it "returns a helpful message if data from `svn info` can't be parsed" do
144
- example_svn_info = "some random crap from an error message\n"
144
+ example_svn_info = "some random text from an error message\n"
145
145
  exitstatus = mock("exitstatus")
146
146
  exitstatus.stub!(:exitstatus).and_return(0)
147
147
  @resource.revision "HEAD"
@@ -149,7 +149,7 @@ describe Chef::Provider::Subversion do
149
149
  @stderr.stub!(:string).and_return("")
150
150
  @provider.should_receive(:popen4).and_yield("no-pid","no-stdin",@stdout,@stderr).
151
151
  and_return(exitstatus)
152
- lambda {@provider.revision_int}.should raise_error(RuntimeError, "Could not parse `svn info` data: some random crap from an error message")
152
+ lambda {@provider.revision_int}.should raise_error(RuntimeError, "Could not parse `svn info` data: some random text from an error message")
153
153
 
154
154
  end
155
155
 
@@ -387,6 +387,21 @@ describe Chef::Provider::User::Dscl do
387
387
  end
388
388
  end
389
389
 
390
+ describe "when changing the gid" do
391
+ before do
392
+ @current_resource = @new_resource.dup
393
+ @provider.current_resource = @current_resource
394
+
395
+ # This is different from @current_resource
396
+ @new_resource.gid 2342
397
+ end
398
+
399
+ it "sets the gid" do
400
+ @provider.should_receive :dscl_set_gid
401
+ @provider.manage_user
402
+ end
403
+ end
404
+
390
405
  describe "when the user exists and chef is removing it" do
391
406
  it "removes the user's home directory when the resource is configured to manage home" do
392
407
  @new_resource.supports({ :manage_home => true })
@@ -0,0 +1,43 @@
1
+ #
2
+ # Author:: Bryan McLellan <btm@opscode.com>
3
+ # Copyright:: Copyright (c) 2012 Opscode, Inc.
4
+ # License:: Apache License, Version 2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ require 'spec_helper'
20
+
21
+ describe Chef::Resource::IpsPackage, "initialize" do
22
+
23
+ before(:each) do
24
+ @resource = Chef::Resource::IpsPackage.new("crypto/gnupg")
25
+ end
26
+
27
+ it "should return a Chef::Resource::IpsPackage" do
28
+ @resource.should be_a_kind_of(Chef::Resource::IpsPackage)
29
+ end
30
+
31
+ it "should set the resource_name to :ips_package" do
32
+ @resource.resource_name.should eql(:ips_package)
33
+ end
34
+
35
+ it "should set the provider to Chef::Provider::Package::Ips" do
36
+ @resource.provider.should eql(Chef::Provider::Package::Ips)
37
+ end
38
+
39
+ it "should support accept_license" do
40
+ @resource.accept_license(true)
41
+ @resource.accept_license.should eql(true)
42
+ end
43
+ end
@@ -97,20 +97,42 @@ describe Chef::REST::AuthCredentials do
97
97
 
98
98
  it "generates signature headers for the request" do
99
99
  Time.stub!(:now).and_return(@request_time)
100
- expected = {}
101
- expected["HOST"] = "localhost"
102
- expected["X-OPS-AUTHORIZATION-1"] = "kBssX1ENEwKtNYFrHElN9vYGWS7OeowepN9EsYc9csWfh8oUovryPKDxytQ/"
103
- expected["X-OPS-AUTHORIZATION-2"] = "Wc2/nSSyxdWJjjfHzrE+YrqNQTaArOA7JkAf5p75eTUonCWcvNPjFrZVgKGS"
104
- expected["X-OPS-AUTHORIZATION-3"] = "yhzHJQh+lcVA9wwARg5Hu9q+ddS8xBOdm3Vp5atl5NGHiP0loiigMYvAvzPO"
105
- expected["X-OPS-AUTHORIZATION-4"] = "r9853eIxwYMhn5hLGhAGFQznJbE8+7F/lLU5Zmk2t2MlPY8q3o1Q61YD8QiJ"
106
- expected["X-OPS-AUTHORIZATION-5"] = "M8lIt53ckMyUmSU0DDURoiXLVkE9mag/6Yq2tPNzWq2AdFvBqku9h2w+DY5k"
107
- expected["X-OPS-AUTHORIZATION-6"] = "qA5Rnzw5rPpp3nrWA9jKkPw4Wq3+4ufO2Xs6w7GCjA=="
108
- expected["X-OPS-CONTENT-HASH"] = "1tuzs5XKztM1ANrkGNPah6rW9GY="
109
- expected["X-OPS-SIGN"] = "version=1.0"
110
- expected["X-OPS-TIMESTAMP"] = "2010-04-10T17:34:20Z"
111
- expected["X-OPS-USERID"] = "client-name"
112
-
113
- @auth_credentials.signature_headers(@request_params).should == expected
100
+ actual = @auth_credentials.signature_headers(@request_params)
101
+ actual["HOST"].should == "localhost"
102
+ actual["X-OPS-AUTHORIZATION-1"].should == "kBssX1ENEwKtNYFrHElN9vYGWS7OeowepN9EsYc9csWfh8oUovryPKDxytQ/"
103
+ actual["X-OPS-AUTHORIZATION-2"].should == "Wc2/nSSyxdWJjjfHzrE+YrqNQTaArOA7JkAf5p75eTUonCWcvNPjFrZVgKGS"
104
+ actual["X-OPS-AUTHORIZATION-3"].should == "yhzHJQh+lcVA9wwARg5Hu9q+ddS8xBOdm3Vp5atl5NGHiP0loiigMYvAvzPO"
105
+ actual["X-OPS-AUTHORIZATION-4"].should == "r9853eIxwYMhn5hLGhAGFQznJbE8+7F/lLU5Zmk2t2MlPY8q3o1Q61YD8QiJ"
106
+ actual["X-OPS-AUTHORIZATION-5"].should == "M8lIt53ckMyUmSU0DDURoiXLVkE9mag/6Yq2tPNzWq2AdFvBqku9h2w+DY5k"
107
+ actual["X-OPS-AUTHORIZATION-6"].should == "qA5Rnzw5rPpp3nrWA9jKkPw4Wq3+4ufO2Xs6w7GCjA=="
108
+ actual["X-OPS-CONTENT-HASH"].should == "1tuzs5XKztM1ANrkGNPah6rW9GY="
109
+ actual["X-OPS-SIGN"].should =~ %r{(version=1\.0)|(algorithm=sha1;version=1.0;)}
110
+ actual["X-OPS-TIMESTAMP"].should == "2010-04-10T17:34:20Z"
111
+ actual["X-OPS-USERID"].should == "client-name"
112
+
113
+ end
114
+
115
+ describe "when configured for version 1.1 of the authn protocol" do
116
+ before do
117
+ Chef::Config[:authentication_protocol_version] = "1.1"
118
+ end
119
+
120
+ after do
121
+ Chef::Config[:authentication_protocol_version] = "1.0"
122
+ end
123
+
124
+ it "generates the correct signature for version 1.1" do
125
+ Time.stub!(:now).and_return(@request_time)
126
+ actual = @auth_credentials.signature_headers(@request_params)
127
+ actual["HOST"].should == "localhost"
128
+ actual["X-OPS-CONTENT-HASH"].should == "1tuzs5XKztM1ANrkGNPah6rW9GY="
129
+ actual["X-OPS-SIGN"].should == "algorithm=sha1;version=1.1;"
130
+ actual["X-OPS-TIMESTAMP"].should == "2010-04-10T17:34:20Z"
131
+ actual["X-OPS-USERID"].should == "client-name"
132
+
133
+ # mixlib-authN will test the actual signature stuff for each version of
134
+ # the protocol so we won't test it again here.
135
+ end
114
136
  end
115
137
  end
116
138
  end
@@ -53,6 +53,26 @@ describe Chef::ScanAccessControl do
53
53
  File.should_receive(:exist?).with(@new_resource.path).and_return(true)
54
54
  end
55
55
 
56
+ describe "when new_resource does not specify mode, user or group" do
57
+ # these tests are necessary for minitest-chef-handler to use as an API, see CHEF-3235
58
+ before do
59
+ @scanner.set_all!
60
+ end
61
+
62
+ it "sets the mode of the current resource to the current mode as a String" do
63
+ @current_resource.mode.should == "644"
64
+ end
65
+
66
+ it "sets the group of the current resource to the current group as a String" do
67
+ @current_resource.group.should == Etc.getgrgid(0).name
68
+ end
69
+
70
+ it "sets the owner of the current resource to the current owner as a String" do
71
+ @current_resource.user.should == "root"
72
+ end
73
+
74
+ end
75
+
56
76
  describe "when new_resource specifies the mode with a string" do
57
77
  before do
58
78
  @new_resource.mode("0755")
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef
3
3
  version: !ruby/object:Gem::Version
4
- hash: 246151691
4
+ hash: 932825029
5
5
  prerelease: 8
6
6
  segments:
7
7
  - 10
8
8
  - 14
9
9
  - 0
10
- - beta
11
- - 3
12
- version: 10.14.0.beta.3
10
+ - rc
11
+ - 0
12
+ version: 10.14.0.rc.0
13
13
  platform: ruby
14
14
  authors:
15
15
  - Adam Jacob
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2012-07-26 00:00:00 Z
20
+ date: 2012-08-21 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: mixlib-config
@@ -75,12 +75,12 @@ dependencies:
75
75
  requirements:
76
76
  - - ">="
77
77
  - !ruby/object:Gem::Version
78
- hash: 19
78
+ hash: 27
79
79
  segments:
80
80
  - 1
81
- - 1
81
+ - 3
82
82
  - 0
83
- version: 1.1.0
83
+ version: 1.3.0
84
84
  type: :runtime
85
85
  version_requirements: *id004
86
86
  - !ruby/object:Gem::Dependency
@@ -792,6 +792,7 @@ files:
792
792
  - lib/chef/provider/package/freebsd.rb
793
793
  - lib/chef/provider/package/yum-dump.py
794
794
  - lib/chef/provider/package/apt.rb
795
+ - lib/chef/provider/package/ips.rb
795
796
  - lib/chef/provider/package/rubygems.rb
796
797
  - lib/chef/provider/ohai.rb
797
798
  - lib/chef/provider/user.rb
@@ -914,6 +915,7 @@ files:
914
915
  - lib/chef/resource/perl.rb
915
916
  - lib/chef/resource/yum_package.rb
916
917
  - lib/chef/resource/csh.rb
918
+ - lib/chef/resource/ips_package.rb
917
919
  - lib/chef/resource/smartos_package.rb
918
920
  - lib/chef/resource/pacman_package.rb
919
921
  - lib/chef/resource/script.rb
@@ -1091,6 +1093,7 @@ files:
1091
1093
  - spec/unit/provider/package/rpm_spec.rb
1092
1094
  - spec/unit/provider/package/smartos_spec.rb
1093
1095
  - spec/unit/provider/package/apt_spec.rb
1096
+ - spec/unit/provider/package/ips_spec.rb
1094
1097
  - spec/unit/provider/package/freebsd_spec.rb
1095
1098
  - spec/unit/provider/package/zypper_spec.rb
1096
1099
  - spec/unit/provider/package/solaris_spec.rb
@@ -1143,6 +1146,7 @@ files:
1143
1146
  - spec/unit/knife/node_run_list_add_spec.rb
1144
1147
  - spec/unit/knife/cookbook_site_download_spec.rb
1145
1148
  - spec/unit/knife/configure_client_spec.rb
1149
+ - spec/unit/knife/ssh_spec.rb
1146
1150
  - spec/unit/knife/cookbook_metadata_from_file_spec.rb
1147
1151
  - spec/unit/knife/core/ui_spec.rb
1148
1152
  - spec/unit/knife/core/subcommand_loader_spec.rb
@@ -1184,6 +1188,7 @@ files:
1184
1188
  - spec/unit/resource/chef_gem_spec.rb
1185
1189
  - spec/unit/resource/mount_spec.rb
1186
1190
  - spec/unit/resource/remote_directory_spec.rb
1191
+ - spec/unit/resource/ips_package_spec.rb
1187
1192
  - spec/unit/resource/rpm_package_spec.rb
1188
1193
  - spec/unit/resource/macports_package_spec.rb
1189
1194
  - spec/unit/resource/breakpoint_spec.rb