puppet 3.6.0-x86-mingw32 → 3.6.1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puppet might be problematic. Click here for more details.

Files changed (39) hide show
  1. data/ext/rack/example-passenger-vhost.conf +3 -2
  2. data/lib/puppet.rb +10 -0
  3. data/lib/puppet/agent.rb +0 -1
  4. data/lib/puppet/application.rb +16 -18
  5. data/lib/puppet/configurer.rb +16 -21
  6. data/lib/puppet/context.rb +46 -5
  7. data/lib/puppet/indirector/catalog/compiler.rb +4 -3
  8. data/lib/puppet/indirector/rest.rb +5 -6
  9. data/lib/puppet/network/http/route.rb +15 -6
  10. data/lib/puppet/parser/functions/epp.rb +1 -1
  11. data/lib/puppet/pops/evaluator/access_operator.rb +40 -35
  12. data/lib/puppet/pops/parser/egrammar.ra +5 -1
  13. data/lib/puppet/pops/parser/eparser.rb +1096 -1079
  14. data/lib/puppet/pops/parser/interpolation_support.rb +1 -1
  15. data/lib/puppet/pops/parser/lexer2.rb +14 -7
  16. data/lib/puppet/provider/package/rpm.rb +3 -0
  17. data/lib/puppet/provider/package/yum.rb +15 -7
  18. data/lib/puppet/provider/package/zypper.rb +3 -2
  19. data/lib/puppet/ssl/host.rb +1 -1
  20. data/lib/puppet/test/test_helper.rb +34 -1
  21. data/lib/puppet/type/package.rb +12 -1
  22. data/lib/puppet/version.rb +1 -1
  23. data/spec/unit/configurer_spec.rb +36 -7
  24. data/spec/unit/context_spec.rb +39 -0
  25. data/spec/unit/indirector/catalog/compiler_spec.rb +16 -0
  26. data/spec/unit/indirector/rest_spec.rb +17 -3
  27. data/spec/unit/network/http/route_spec.rb +16 -0
  28. data/spec/unit/parser/functions/epp_spec.rb +15 -0
  29. data/spec/unit/pops/evaluator/access_ops_spec.rb +6 -0
  30. data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +10 -0
  31. data/spec/unit/pops/parser/lexer2_spec.rb +10 -2
  32. data/spec/unit/provider/package/aptrpm_spec.rb +0 -1
  33. data/spec/unit/provider/package/rpm_spec.rb +8 -2
  34. data/spec/unit/provider/package/yum_spec.rb +40 -23
  35. data/spec/unit/provider/package/zypper_spec.rb +25 -6
  36. data/spec/unit/ssl/host_spec.rb +5 -5
  37. data/spec/unit/type/package_spec.rb +21 -1
  38. metadata +3183 -3147
  39. checksums.yaml +0 -7
@@ -41,6 +41,22 @@ describe Puppet::Network::HTTP::Route do
41
41
  expect(res.body).to eq("used")
42
42
  end
43
43
 
44
+ it "processes DELETE requests" do
45
+ route = Puppet::Network::HTTP::Route.path(%r{^/vtest/foo}).delete(respond("used"))
46
+
47
+ route.process(request("DELETE", "/vtest/foo"), res)
48
+
49
+ expect(res.body).to eq("used")
50
+ end
51
+
52
+ it "does something when it doesn't know the verb" do
53
+ route = Puppet::Network::HTTP::Route.path(%r{^/vtest/foo})
54
+
55
+ expect do
56
+ route.process(request("UNKNOWN", "/vtest/foo"), res)
57
+ end.to raise_error(Puppet::Network::HTTP::Error::HTTPMethodNotAllowedError, /UNKNOWN/)
58
+ end
59
+
44
60
  it "calls the method handlers in turn" do
45
61
  call_count = 0
46
62
  handler = lambda { |request, response| call_count += 1 }
@@ -67,6 +67,21 @@ describe "the epp function" do
67
67
  eval_template("string was: <%= $string %>").should == "string was: the string value"
68
68
  end
69
69
 
70
+ describe 'when loading from modules' do
71
+ include PuppetSpec::Files
72
+ it 'an epp template is found' do
73
+ modules_dir = dir_containing('modules', {
74
+ 'testmodule' => {
75
+ 'templates' => {
76
+ 'the_x.epp' => 'The x is <%= $x %>'
77
+ }
78
+ }})
79
+ Puppet.override({:current_environment => (env = Puppet::Node::Environment.create(:testload, [ modules_dir ]))}, "test") do
80
+ node.environment = env
81
+ expect(scope.function_epp([ 'testmodule/the_x.epp', { 'x' => '3'} ])).to eql("The x is 3")
82
+ end
83
+ end
84
+ end
70
85
 
71
86
  def eval_template_with_args(content, args_hash)
72
87
  file_path = tmpdir('epp_spec_content')
@@ -320,6 +320,12 @@ describe 'Puppet::Pops::Evaluator::EvaluatorImpl/AccessOperator' do
320
320
  expect { evaluate(expr) }.to raise_error(/Illegal name/)
321
321
  end
322
322
 
323
+ it 'downcases capitalized class names' do
324
+ expr = fqr('Class')['My::Class']
325
+
326
+ expect(evaluate(expr)).to be_the_type(types.host_class('my::class'))
327
+ end
328
+
323
329
  it 'gives an error if no keys are given as argument' do
324
330
  expr = fqr('Class')[]
325
331
  expect {evaluate(expr)}.to raise_error(/Evaluation Error: Class\[\] accepts 1 or more arguments. Got 0/)
@@ -811,6 +811,16 @@ describe 'Puppet::Pops::Evaluator::EvaluatorImpl' do
811
811
  alt_results.include?(parse_result).should == true
812
812
  end
813
813
 
814
+ it 'should accept a variable with leading underscore when used directly' do
815
+ source = '$_x = 10; "$_x"'
816
+ expect(parser.evaluate_string(scope, source, __FILE__)).to eql('10')
817
+ end
818
+
819
+ it 'should accept a variable with leading underscore when used as an expression' do
820
+ source = '$_x = 10; "${_x}"'
821
+ expect(parser.evaluate_string(scope, source, __FILE__)).to eql('10')
822
+ end
823
+
814
824
  {
815
825
  '"value is ${a*2} yo"' => :error,
816
826
  }.each do |source, result|
@@ -107,9 +107,17 @@ describe 'Lexer2' do
107
107
  end
108
108
  end
109
109
 
110
- [ 'a-b', 'a--b', 'a-b-c'].each do |string|
110
+ [ 'a-b', 'a--b', 'a-b-c', '_x'].each do |string|
111
111
  it "should lex a BARE WORD STRING on the form '#{string}'" do
112
- tokens_scanned_from(string).should match_tokens2([:STRING, string])
112
+ tokens_scanned_from(string).should match_tokens2([:WORD, string])
113
+ end
114
+ end
115
+
116
+ [ '_x::y', 'x::_y'].each do |string|
117
+ it "should consider the bare word '#{string}' to be a bad NAME" do
118
+ expect {
119
+ tokens_scanned_from(string)
120
+ }.to raise_error(/Illegal fully qualified name/)
113
121
  end
114
122
  end
115
123
 
@@ -26,7 +26,6 @@ describe Puppet::Type.type(:package).provider(:aptrpm) do
26
26
 
27
27
  it "should report absent packages" do
28
28
  rpm.raises(Puppet::ExecutionFailure, "couldn't find rpm")
29
- rpm(rpm_args + ['--whatprovides']).raises(Puppet::ExecutionFailure, 'no package provides faff')
30
29
  pkg.property(:ensure).retrieve.should == :absent
31
30
  end
32
31
 
@@ -44,6 +44,13 @@ describe provider_class do
44
44
  Puppet::Util::Execution.expects(:execute).with(["/bin/rpm", "--version"], execute_options).returns(rpm_version).at_most_once
45
45
  end
46
46
 
47
+ describe 'provider features' do
48
+ it { should be_versionable }
49
+ it { should be_install_options }
50
+ it { should be_uninstall_options }
51
+ it { should be_virtual_packages }
52
+ end
53
+
47
54
  describe "self.instances" do
48
55
  describe "with a modern version of RPM" do
49
56
  it "includes all the modern flags" do
@@ -277,12 +284,11 @@ describe provider_class do
277
284
  Puppet.expects(:debug).never
278
285
  expected_args = ["/bin/rpm", "-q", resource_name, "--nosignature", "--nodigest", "--qf", nevra_format]
279
286
  Puppet::Util::Execution.expects(:execute).with(expected_args, execute_options).raises Puppet::ExecutionFailure.new("package #{resource_name} is not installed")
280
- Puppet::Util::Execution.expects(:execute).with(expected_args + ["--whatprovides"], execute_options).raises Puppet::ExecutionFailure.new("no package provides #{resource_name}")
281
287
  expect(provider.query).to be_nil
282
288
  end
283
289
 
284
290
  it "parses virtual package" do
285
- #Puppet.expects(:debug).never
291
+ provider.resource[:allow_virtual] = true
286
292
  expected_args = ["/bin/rpm", "-q", resource_name, "--nosignature", "--nodigest", "--qf", nevra_format]
287
293
  Puppet::Util::Execution.expects(:execute).with(expected_args, execute_options).raises Puppet::ExecutionFailure.new("package #{resource_name} is not installed")
288
294
  Puppet::Util::Execution.expects(:execute).with(expected_args + ["--whatprovides"], execute_options).returns "myresource 0 1.2.3.4 5.el4 noarch\n"
@@ -27,6 +27,12 @@ describe provider_class do
27
27
  provider.stubs(:get).with(:arch).returns 'i386'
28
28
  end
29
29
 
30
+ describe 'provider features' do
31
+ it { should be_versionable }
32
+ it { should be_install_options }
33
+ it { should be_virtual_packages }
34
+ end
35
+
30
36
  # provider should repond to the following methods
31
37
  [:install, :latest, :update, :purge, :install_options].each do |method|
32
38
  it "should have a(n) #{method}" do
@@ -43,7 +49,8 @@ describe provider_class do
43
49
 
44
50
  it 'should call yum install for :installed' do
45
51
  resource.stubs(:should).with(:ensure).returns :installed
46
- provider.expects(:yum).with('-d', '0', '-e', '0', '-y', :install, 'mypackage')
52
+ provider.expects(:yum).with('-d', '0', '-e', '0', '-y', :list, name)
53
+ provider.expects(:yum).with('-d', '0', '-e', '0', '-y', :install, name)
47
54
  provider.install
48
55
  end
49
56
 
@@ -53,18 +60,20 @@ describe provider_class do
53
60
  end
54
61
 
55
62
  it 'should be able to set version' do
56
- resource[:ensure] = '1.2'
57
-
58
- provider.expects(:yum).with('-d', '0', '-e', '0', '-y', :install, 'mypackage-1.2')
59
- provider.stubs(:query).returns :ensure => '1.2'
63
+ version = '1.2'
64
+ resource[:ensure] = version
65
+ provider.expects(:yum).with('-d', '0', '-e', '0', '-y', :list, name)
66
+ provider.expects(:yum).with('-d', '0', '-e', '0', '-y', :install, "#{name}-#{version}")
67
+ provider.stubs(:query).returns :ensure => version
60
68
  provider.install
61
69
  end
62
70
 
63
71
  it 'should be able to downgrade' do
72
+ current_version = '1.2'
73
+ version = '1.0'
64
74
  resource[:ensure] = '1.0'
65
-
66
- provider.expects(:yum).with('-d', '0', '-e', '0', '-y', :downgrade, 'mypackage-1.0')
67
- provider.stubs(:query).returns(:ensure => '1.2').then.returns(:ensure => '1.0')
75
+ provider.expects(:yum).with('-d', '0', '-e', '0', '-y', :downgrade, "#{name}-#{version}")
76
+ provider.stubs(:query).returns(:ensure => current_version).then.returns(:ensure => version)
68
77
  provider.install
69
78
  end
70
79
 
@@ -72,14 +81,22 @@ describe provider_class do
72
81
  resource[:ensure] = :installed
73
82
  resource[:install_options] = ['-t', {'-x' => 'expackage'}]
74
83
 
75
- provider.expects(:yum).with('-d', '0', '-e', '0', '-y', ['-t', '-x=expackage'], :install, 'mypackage')
84
+ provider.expects(:yum).with('-d', '0', '-e', '0', '-y', ['-t', '-x=expackage'], :install, name)
85
+ provider.install
86
+ end
87
+
88
+ it 'allow virtual packages' do
89
+ resource[:ensure] = :installed
90
+ resource[:allow_virtual] = true
91
+ provider.expects(:yum).with('-d', '0', '-e', '0', '-y', :list, name).never
92
+ provider.expects(:yum).with('-d', '0', '-e', '0', '-y', :install, name)
76
93
  provider.install
77
94
  end
78
95
  end
79
96
 
80
97
  describe 'when uninstalling' do
81
98
  it 'should use erase to purge' do
82
- provider.expects(:yum).with('-y', :erase, 'mypackage')
99
+ provider.expects(:yum).with('-y', :erase, name)
83
100
  provider.purge
84
101
  end
85
102
  end
@@ -97,7 +114,7 @@ describe provider_class do
97
114
  ]
98
115
  provider.stubs(:properties).returns({:ensure => '3.4.5'})
99
116
 
100
- described_class.expects(:latest_package_version).with('mypackage', ['contrib', 'centosplus'], [])
117
+ described_class.expects(:latest_package_version).with(name, ['contrib', 'centosplus'], [])
101
118
  provider.latest
102
119
  end
103
120
 
@@ -108,13 +125,13 @@ describe provider_class do
108
125
  ]
109
126
  provider.stubs(:properties).returns({:ensure => '3.4.5'})
110
127
 
111
- described_class.expects(:latest_package_version).with('mypackage', [], ['updates', 'centosplus'])
128
+ described_class.expects(:latest_package_version).with(name, [], ['updates', 'centosplus'])
112
129
  provider.latest
113
130
  end
114
131
 
115
132
  describe 'and a newer version is not available' do
116
133
  before :each do
117
- described_class.stubs(:latest_package_version).with('mypackage', [], []).returns nil
134
+ described_class.stubs(:latest_package_version).with(name, [], []).returns nil
118
135
  end
119
136
 
120
137
  it 'raises an error the package is not installed' do
@@ -133,7 +150,7 @@ describe provider_class do
133
150
  describe 'and a newer version is available' do
134
151
  let(:latest_version) do
135
152
  {
136
- :name => 'mypackage',
153
+ :name => name,
137
154
  :epoch => '1',
138
155
  :version => '2.3.4',
139
156
  :release => '5',
@@ -142,7 +159,7 @@ describe provider_class do
142
159
  end
143
160
 
144
161
  it 'includes the epoch in the version string' do
145
- described_class.stubs(:latest_package_version).with('mypackage', [], []).returns(latest_version)
162
+ described_class.stubs(:latest_package_version).with(name, [], []).returns(latest_version)
146
163
  provider.latest.should == '1:2.3.4-5'
147
164
  end
148
165
  end
@@ -154,7 +171,7 @@ describe provider_class do
154
171
 
155
172
  let(:mypackage_version) do
156
173
  {
157
- :name => 'mypackage',
174
+ :name => name,
158
175
  :epoch => '1',
159
176
  :version => '2.3.4',
160
177
  :release => '5',
@@ -164,7 +181,7 @@ describe provider_class do
164
181
 
165
182
  let(:mypackage_newerversion) do
166
183
  {
167
- :name => 'mypackage',
184
+ :name => name,
168
185
  :epoch => '1',
169
186
  :version => '4.5.6',
170
187
  :release => '7',
@@ -172,12 +189,12 @@ describe provider_class do
172
189
  }
173
190
  end
174
191
 
175
- let(:latest_versions) { {'mypackage' => [mypackage_version]} }
176
- let(:enabled_versions) { {'mypackage' => [mypackage_newerversion]} }
192
+ let(:latest_versions) { {name => [mypackage_version]} }
193
+ let(:enabled_versions) { {name => [mypackage_newerversion]} }
177
194
 
178
195
  it "returns the version hash if the package was found" do
179
196
  described_class.expects(:fetch_latest_versions).with([], []).once.returns(latest_versions)
180
- version = described_class.latest_package_version('mypackage', [], [])
197
+ version = described_class.latest_package_version(name, [], [])
181
198
  expect(version).to eq(mypackage_version)
182
199
  end
183
200
 
@@ -191,7 +208,7 @@ describe provider_class do
191
208
  described_class.expects(:fetch_latest_versions).with([], []).once.returns(latest_versions)
192
209
 
193
210
  2.times {
194
- version = described_class.latest_package_version('mypackage', [], [])
211
+ version = described_class.latest_package_version(name, [], [])
195
212
  expect(version).to eq mypackage_version
196
213
  }
197
214
  end
@@ -201,12 +218,12 @@ describe provider_class do
201
218
  described_class.expects(:fetch_latest_versions).with(['enabled'], ['disabled']).once.returns(enabled_versions)
202
219
 
203
220
  2.times {
204
- version = described_class.latest_package_version('mypackage', [], [])
221
+ version = described_class.latest_package_version(name, [], [])
205
222
  expect(version).to eq mypackage_version
206
223
  }
207
224
 
208
225
  2.times {
209
- version = described_class.latest_package_version('mypackage', ['enabled'], ['disabled'])
226
+ version = described_class.latest_package_version(name, ['enabled'], ['disabled'])
210
227
  expect(version).to eq(mypackage_newerversion)
211
228
  }
212
229
  end
@@ -47,6 +47,7 @@ describe provider_class do
47
47
  describe "when installing with zypper version >= 1.0" do
48
48
  it "should use a command-line with versioned package'" do
49
49
  @resource.stubs(:should).with(:ensure).returns "1.2.3-4.5.6"
50
+ @resource.stubs(:allow_virtual?).returns false
50
51
  @provider.stubs(:zypper_version).returns "1.2.8"
51
52
 
52
53
  @provider.expects(:zypper).with('--quiet', :install, '--auto-agree-with-licenses', '--no-confirm', 'mypackage-1.2.3-4.5.6')
@@ -56,8 +57,9 @@ describe provider_class do
56
57
 
57
58
  it "should use a command-line without versioned package" do
58
59
  @resource.stubs(:should).with(:ensure).returns :latest
60
+ @resource.stubs(:allow_virtual?).returns false
59
61
  @provider.stubs(:zypper_version).returns "1.2.8"
60
- @provider.expects(:zypper).with('--quiet', :install, '--auto-agree-with-licenses', '--no-confirm', 'mypackage')
62
+ @provider.expects(:zypper).with('--quiet', :install, '--auto-agree-with-licenses', '--no-confirm', '--name', 'mypackage')
61
63
  @provider.expects(:query).returns "mypackage 0 1.2.3 4.5.6 x86_64"
62
64
  @provider.install
63
65
  end
@@ -66,6 +68,7 @@ describe provider_class do
66
68
  describe "when installing with zypper version = 0.6.104" do
67
69
  it "should use a command-line with versioned package'" do
68
70
  @resource.stubs(:should).with(:ensure).returns "1.2.3-4.5.6"
71
+ @resource.stubs(:allow_virtual?).returns false
69
72
  @provider.stubs(:zypper_version).returns "0.6.104"
70
73
 
71
74
  @provider.expects(:zypper).with('--terse', :install, '--auto-agree-with-licenses', '--no-confirm', 'mypackage-1.2.3-4.5.6')
@@ -75,8 +78,9 @@ describe provider_class do
75
78
 
76
79
  it "should use a command-line without versioned package" do
77
80
  @resource.stubs(:should).with(:ensure).returns :latest
81
+ @resource.stubs(:allow_virtual?).returns false
78
82
  @provider.stubs(:zypper_version).returns "0.6.104"
79
- @provider.expects(:zypper).with('--terse', :install, '--auto-agree-with-licenses', '--no-confirm', 'mypackage')
83
+ @provider.expects(:zypper).with('--terse', :install, '--auto-agree-with-licenses', '--no-confirm', '--name', 'mypackage')
80
84
  @provider.expects(:query).returns "mypackage 0 1.2.3 4.5.6 x86_64"
81
85
  @provider.install
82
86
  end
@@ -85,6 +89,7 @@ describe provider_class do
85
89
  describe "when installing with zypper version = 0.6.13" do
86
90
  it "should use a command-line with versioned package'" do
87
91
  @resource.stubs(:should).with(:ensure).returns "1.2.3-4.5.6"
92
+ @resource.stubs(:allow_virtual?).returns false
88
93
  @provider.stubs(:zypper_version).returns "0.6.13"
89
94
 
90
95
  @provider.expects(:zypper).with('--terse', :install, '--no-confirm', 'mypackage-1.2.3-4.5.6')
@@ -94,8 +99,9 @@ describe provider_class do
94
99
 
95
100
  it "should use a command-line without versioned package" do
96
101
  @resource.stubs(:should).with(:ensure).returns :latest
102
+ @resource.stubs(:allow_virtual?).returns false
97
103
  @provider.stubs(:zypper_version).returns "0.6.13"
98
- @provider.expects(:zypper).with('--terse', :install, '--no-confirm', 'mypackage')
104
+ @provider.expects(:zypper).with('--terse', :install, '--no-confirm', '--name', 'mypackage')
99
105
  @provider.expects(:query).returns "mypackage 0 1.2.3 4.5.6 x86_64"
100
106
  @provider.install
101
107
  end
@@ -118,11 +124,21 @@ describe provider_class do
118
124
  end
119
125
  end
120
126
 
127
+ it "should install a virtual package" do
128
+ @resource.stubs(:should).with(:ensure).returns :installed
129
+ @resource.stubs(:allow_virtual?).returns true
130
+ @provider.stubs(:zypper_version).returns "0.6.13"
131
+ @provider.expects(:zypper).with('--terse', :install, '--no-confirm', 'mypackage')
132
+ @provider.expects(:query).returns "mypackage 0 1.2.3 4.5.6 x86_64"
133
+ @provider.install
134
+ end
135
+
121
136
  describe "when installing with zypper install options" do
122
137
  it "should install the package without checking keys" do
123
138
  @resource.stubs(:[]).with(:name).returns "php5"
124
139
  @resource.stubs(:[]).with(:install_options).returns ['--no-gpg-check', {'-p' => '/vagrant/files/localrepo/'}]
125
140
  @resource.stubs(:should).with(:ensure).returns "5.4.10-4.5.6"
141
+ @resource.stubs(:allow_virtual?).returns false
126
142
  @provider.stubs(:zypper_version).returns "1.2.8"
127
143
 
128
144
  @provider.expects(:zypper).with('--quiet', :install,
@@ -135,9 +151,10 @@ describe provider_class do
135
151
  @resource.stubs(:[]).with(:name).returns 'vim'
136
152
  @resource.stubs(:[]).with(:install_options).returns([{ '--a' => 'foo', '--b' => '"quoted bar"' }])
137
153
  @resource.stubs(:should).with(:ensure).returns :present
154
+ @resource.stubs(:allow_virtual?).returns false
138
155
 
139
156
  @provider.stubs(:zypper_version).returns '1.2.8'
140
- @provider.expects(:zypper).with('--quiet', :install, '--auto-agree-with-licenses', '--no-confirm', '--a=foo', '--b="quoted bar"', 'vim')
157
+ @provider.expects(:zypper).with('--quiet', :install, '--auto-agree-with-licenses', '--no-confirm', '--name', '--a=foo', '--b="quoted bar"', 'vim')
141
158
  @provider.expects(:query).returns 'package vim is not installed'
142
159
  @provider.install
143
160
  end
@@ -146,9 +163,10 @@ describe provider_class do
146
163
  @resource.stubs(:[]).with(:name).returns 'vim'
147
164
  @resource.stubs(:[]).with(:install_options).returns([['--a', '--b', '--c']])
148
165
  @resource.stubs(:should).with(:ensure).returns :present
166
+ @resource.stubs(:allow_virtual?).returns false
149
167
 
150
168
  @provider.stubs(:zypper_version).returns '1.2.8'
151
- @provider.expects(:zypper).with('--quiet', :install, '--auto-agree-with-licenses', '--no-confirm', '--a', '--b', '--c', 'vim')
169
+ @provider.expects(:zypper).with('--quiet', :install, '--auto-agree-with-licenses', '--no-confirm', '--name', '--a', '--b', '--c', 'vim')
152
170
  @provider.expects(:query).returns 'package vim is not installed'
153
171
  @provider.install
154
172
  end
@@ -157,9 +175,10 @@ describe provider_class do
157
175
  @resource.stubs(:[]).with(:name).returns 'vim'
158
176
  @resource.stubs(:[]).with(:install_options).returns(['--a --b --c'])
159
177
  @resource.stubs(:should).with(:ensure).returns :present
178
+ @resource.stubs(:allow_virtual?).returns false
160
179
 
161
180
  @provider.stubs(:zypper_version).returns '1.2.8'
162
- @provider.expects(:zypper).with('--quiet', :install, '--auto-agree-with-licenses', '--no-confirm', '--a --b --c', 'vim')
181
+ @provider.expects(:zypper).with('--quiet', :install, '--auto-agree-with-licenses', '--no-confirm', '--name', '--a --b --c', 'vim')
163
182
  @provider.expects(:query).returns 'package vim is not installed'
164
183
  @provider.install
165
184
  end
@@ -511,7 +511,7 @@ describe Puppet::SSL::Host do
511
511
  end
512
512
 
513
513
  it "should find the CA certificate if it does not have a certificate" do
514
- Puppet::SSL::Certificate.indirection.expects(:find).with(Puppet::SSL::CA_NAME).returns mock("cacert")
514
+ Puppet::SSL::Certificate.indirection.expects(:find).with(Puppet::SSL::CA_NAME, :fail_on_404 => true).returns mock("cacert")
515
515
  Puppet::SSL::Certificate.indirection.stubs(:find).with("myname").returns @cert
516
516
  @host.certificate
517
517
  end
@@ -519,13 +519,13 @@ describe Puppet::SSL::Host do
519
519
  it "should not find the CA certificate if it is the CA host" do
520
520
  @host.expects(:ca?).returns true
521
521
  Puppet::SSL::Certificate.indirection.stubs(:find)
522
- Puppet::SSL::Certificate.indirection.expects(:find).with(Puppet::SSL::CA_NAME).never
522
+ Puppet::SSL::Certificate.indirection.expects(:find).with(Puppet::SSL::CA_NAME, :fail_on_404 => true).never
523
523
 
524
524
  @host.certificate
525
525
  end
526
526
 
527
527
  it "should return nil if it cannot find a CA certificate" do
528
- Puppet::SSL::Certificate.indirection.expects(:find).with(Puppet::SSL::CA_NAME).returns nil
528
+ Puppet::SSL::Certificate.indirection.expects(:find).with(Puppet::SSL::CA_NAME, :fail_on_404 => true).returns nil
529
529
  Puppet::SSL::Certificate.indirection.expects(:find).with("myname").never
530
530
 
531
531
  @host.certificate.should be_nil
@@ -545,13 +545,13 @@ describe Puppet::SSL::Host do
545
545
  end
546
546
 
547
547
  it "should find the certificate in the Certificate class and return the Puppet certificate instance" do
548
- Puppet::SSL::Certificate.indirection.expects(:find).with(Puppet::SSL::CA_NAME).returns mock("cacert")
548
+ Puppet::SSL::Certificate.indirection.expects(:find).with(Puppet::SSL::CA_NAME, :fail_on_404 => true).returns mock("cacert")
549
549
  Puppet::SSL::Certificate.indirection.expects(:find).with("myname").returns @cert
550
550
  @host.certificate.should equal(@cert)
551
551
  end
552
552
 
553
553
  it "should return any previously found certificate" do
554
- Puppet::SSL::Certificate.indirection.expects(:find).with(Puppet::SSL::CA_NAME).returns mock("cacert")
554
+ Puppet::SSL::Certificate.indirection.expects(:find).with(Puppet::SSL::CA_NAME, :fail_on_404 => true).returns mock("cacert")
555
555
  Puppet::SSL::Certificate.indirection.expects(:find).with("myname").returns(@cert).once
556
556
 
557
557
  @host.certificate.should equal(@cert)