puppet 0.16.0 → 0.18.4

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 (185) hide show
  1. data/CHANGELOG +98 -0
  2. data/Rakefile +5 -1
  3. data/bin/puppet +1 -1
  4. data/bin/puppetca +25 -11
  5. data/bin/puppetd +189 -66
  6. data/bin/puppetdoc +79 -62
  7. data/bin/puppetmasterd +93 -49
  8. data/bin/puppetrun +385 -0
  9. data/conf/redhat/client.init +5 -2
  10. data/conf/redhat/fileserver.conf +1 -1
  11. data/conf/redhat/lsb-config.patch +51 -0
  12. data/conf/redhat/puppet.spec +45 -18
  13. data/conf/redhat/puppetd.conf +32 -4
  14. data/conf/redhat/server.init +5 -2
  15. data/conf/solaris/pkginfo +7 -0
  16. data/conf/solaris/smf/puppetd.xml +77 -0
  17. data/conf/solaris/smf/puppetmasterd.xml +77 -0
  18. data/conf/solaris/smf/svc-puppetd +66 -0
  19. data/conf/solaris/smf/svc-puppetmasterd +62 -0
  20. data/examples/code/failers/noobjectrvalue +1 -0
  21. data/examples/code/snippets/deepclassheirarchy.pp +23 -0
  22. data/examples/code/snippets/defineoverrides.pp +17 -0
  23. data/examples/code/snippets/emptyexec.pp +3 -0
  24. data/examples/code/snippets/selectorvalues.pp +6 -1
  25. data/examples/code/snippets/tagged.pp +35 -0
  26. data/ext/ldap/puppet.schema +2 -2
  27. data/install.rb +4 -2
  28. data/lib/puppet.rb +206 -15
  29. data/lib/puppet/client.rb +30 -20
  30. data/lib/puppet/client/ca.rb +2 -2
  31. data/lib/puppet/client/dipper.rb +5 -9
  32. data/lib/puppet/client/master.rb +224 -44
  33. data/lib/puppet/client/pelement.rb +54 -9
  34. data/lib/puppet/client/proxy.rb +3 -2
  35. data/lib/puppet/client/reporter.rb +34 -0
  36. data/lib/puppet/client/runner.rb +17 -0
  37. data/lib/puppet/config.rb +136 -55
  38. data/lib/puppet/daemon.rb +59 -37
  39. data/lib/puppet/element.rb +2 -1
  40. data/lib/puppet/event.rb +14 -3
  41. data/lib/puppet/filetype.rb +28 -19
  42. data/lib/puppet/log.rb +297 -132
  43. data/lib/puppet/metric.rb +31 -131
  44. data/lib/puppet/networkclient.rb +73 -46
  45. data/lib/puppet/parameter.rb +49 -1
  46. data/lib/puppet/parsedfile.rb +32 -12
  47. data/lib/puppet/parser/ast.rb +6 -1
  48. data/lib/puppet/parser/ast/astarray.rb +32 -6
  49. data/lib/puppet/parser/ast/collection.rb +91 -0
  50. data/lib/puppet/parser/ast/compdef.rb +2 -2
  51. data/lib/puppet/parser/ast/component.rb +24 -11
  52. data/lib/puppet/parser/ast/function.rb +50 -0
  53. data/lib/puppet/parser/ast/hostclass.rb +70 -22
  54. data/lib/puppet/parser/ast/node.rb +17 -8
  55. data/lib/puppet/parser/ast/nodedef.rb +1 -1
  56. data/lib/puppet/parser/ast/objectdef.rb +28 -10
  57. data/lib/puppet/parser/ast/selector.rb +4 -1
  58. data/lib/puppet/parser/functions.rb +145 -0
  59. data/lib/puppet/parser/interpreter.rb +243 -86
  60. data/lib/puppet/parser/lexer.rb +5 -4
  61. data/lib/puppet/parser/parser.rb +586 -505
  62. data/lib/puppet/parser/scope.rb +337 -187
  63. data/lib/puppet/rails.rb +115 -0
  64. data/lib/puppet/rails/database.rb +40 -0
  65. data/lib/puppet/rails/host.rb +83 -0
  66. data/lib/puppet/rails/rails_object.rb +42 -0
  67. data/lib/puppet/rails/rails_parameter.rb +5 -0
  68. data/lib/puppet/reports/rrdgraph.rb +20 -0
  69. data/lib/puppet/reports/tagmail.rb +94 -0
  70. data/lib/puppet/server.rb +20 -4
  71. data/lib/puppet/server/authconfig.rb +14 -3
  72. data/lib/puppet/server/authstore.rb +2 -2
  73. data/lib/puppet/server/ca.rb +23 -11
  74. data/lib/puppet/server/filebucket.rb +10 -10
  75. data/lib/puppet/server/fileserver.rb +4 -8
  76. data/lib/puppet/server/master.rb +19 -22
  77. data/lib/puppet/server/pelement.rb +28 -16
  78. data/lib/puppet/server/report.rb +184 -0
  79. data/lib/puppet/server/runner.rb +62 -0
  80. data/lib/puppet/server/servlet.rb +23 -9
  81. data/lib/puppet/sslcertificates/ca.rb +25 -1
  82. data/lib/puppet/statechange.rb +34 -53
  83. data/lib/puppet/storage.rb +1 -2
  84. data/lib/puppet/transaction.rb +305 -133
  85. data/lib/puppet/transaction/report.rb +42 -0
  86. data/lib/puppet/transportable.rb +57 -33
  87. data/lib/puppet/type.rb +260 -127
  88. data/lib/puppet/type/component.rb +9 -21
  89. data/lib/puppet/type/cron.rb +367 -116
  90. data/lib/puppet/type/exec.rb +15 -16
  91. data/lib/puppet/type/group.rb +9 -1
  92. data/lib/puppet/type/nameservice.rb +2 -5
  93. data/lib/puppet/type/nameservice/netinfo.rb +3 -0
  94. data/lib/puppet/type/nameservice/objectadd.rb +23 -10
  95. data/lib/puppet/type/nameservice/pw.rb +16 -3
  96. data/lib/puppet/type/package.rb +25 -75
  97. data/lib/puppet/type/package/apple.rb +15 -1
  98. data/lib/puppet/type/package/apt.rb +37 -2
  99. data/lib/puppet/type/package/blastwave.rb +136 -0
  100. data/lib/puppet/type/package/dpkg.rb +4 -4
  101. data/lib/puppet/type/package/gem.rb +119 -0
  102. data/lib/puppet/type/package/openbsd.rb +7 -6
  103. data/lib/puppet/type/package/ports.rb +7 -2
  104. data/lib/puppet/type/package/rpm.rb +1 -1
  105. data/lib/puppet/type/package/sun.rb +23 -9
  106. data/lib/puppet/type/package/sunfreeware.rb +7 -0
  107. data/lib/puppet/type/package/yum.rb +16 -9
  108. data/lib/puppet/type/parsedtype.rb +7 -5
  109. data/lib/puppet/type/parsedtype/mount.rb +55 -34
  110. data/lib/puppet/type/parsedtype/port.rb +7 -1
  111. data/lib/puppet/type/parsedtype/sshkey.rb +6 -16
  112. data/lib/puppet/type/pfile.rb +115 -23
  113. data/lib/puppet/type/pfile/checksum.rb +18 -5
  114. data/lib/puppet/type/pfile/content.rb +2 -2
  115. data/lib/puppet/type/pfile/ensure.rb +3 -3
  116. data/lib/puppet/type/pfile/group.rb +2 -2
  117. data/lib/puppet/type/pfile/source.rb +28 -17
  118. data/lib/puppet/type/pfile/target.rb +25 -17
  119. data/lib/puppet/type/pfilebucket.rb +25 -6
  120. data/lib/puppet/type/schedule.rb +6 -6
  121. data/lib/puppet/type/service.rb +24 -14
  122. data/lib/puppet/type/service/debian.rb +1 -1
  123. data/lib/puppet/type/service/redhat.rb +13 -10
  124. data/lib/puppet/type/service/smf.rb +3 -3
  125. data/lib/puppet/type/state.rb +1 -2
  126. data/lib/puppet/type/symlink.rb +3 -4
  127. data/lib/puppet/type/user.rb +22 -10
  128. data/lib/puppet/type/yumrepo.rb +6 -1
  129. data/lib/puppet/type/zone.rb +595 -0
  130. data/lib/puppet/util.rb +58 -12
  131. data/test/client/client.rb +2 -2
  132. data/test/client/master.rb +92 -3
  133. data/test/client/pelement.rb +99 -0
  134. data/test/executables/puppetbin.rb +3 -4
  135. data/test/executables/puppetca.rb +3 -3
  136. data/test/executables/puppetd.rb +3 -3
  137. data/test/executables/puppetmasterd.rb +1 -5
  138. data/test/executables/puppetmodule.rb +2 -2
  139. data/test/language/ast.rb +200 -11
  140. data/test/language/functions.rb +245 -0
  141. data/test/language/interpreter.rb +155 -6
  142. data/test/language/lexer.rb +35 -2
  143. data/test/language/node.rb +48 -1
  144. data/test/language/parser.rb +250 -1
  145. data/test/language/rails.rb +105 -0
  146. data/test/language/scope.rb +304 -10
  147. data/test/language/snippets.rb +54 -5
  148. data/test/language/transportable.rb +60 -28
  149. data/test/other/config.rb +214 -1
  150. data/test/other/events.rb +67 -9
  151. data/test/other/log.rb +31 -5
  152. data/test/other/metrics.rb +23 -21
  153. data/test/other/parsedfile.rb +29 -2
  154. data/test/other/puppet.rb +79 -0
  155. data/test/other/report.rb +106 -0
  156. data/test/other/storage.rb +2 -2
  157. data/test/other/transactions.rb +128 -2
  158. data/test/puppet/utiltest.rb +10 -5
  159. data/test/puppettest.rb +193 -21
  160. data/test/server/authstore.rb +13 -4
  161. data/test/server/bucket.rb +33 -8
  162. data/test/server/ca.rb +44 -6
  163. data/test/server/master.rb +6 -7
  164. data/test/server/pelement.rb +15 -5
  165. data/test/server/report.rb +93 -0
  166. data/test/server/runner.rb +107 -0
  167. data/test/server/server.rb +28 -1
  168. data/test/types/cron.rb +339 -31
  169. data/test/types/file.rb +256 -24
  170. data/test/types/filebucket.rb +6 -2
  171. data/test/types/filesources.rb +41 -92
  172. data/test/types/group.rb +31 -1
  173. data/test/types/host.rb +2 -1
  174. data/test/types/mount.rb +18 -1
  175. data/test/types/package.rb +200 -18
  176. data/test/types/service.rb +5 -1
  177. data/test/types/sshkey.rb +2 -1
  178. data/test/types/symlink.rb +3 -2
  179. data/test/types/type.rb +180 -1
  180. data/test/types/user.rb +65 -27
  181. data/test/types/yumrepo.rb +15 -0
  182. data/test/types/zone.rb +437 -0
  183. metadata +43 -4
  184. data/bin/cf2puppet +0 -186
  185. data/conf/redhat/puppetmasterd.conf +0 -5
data/lib/puppet/util.rb CHANGED
@@ -4,11 +4,21 @@ require 'sync'
4
4
  require 'puppet/lock'
5
5
 
6
6
  module Puppet
7
+ # A command failed to execute.
8
+ class ExecutionFailure < RuntimeError
9
+ end
7
10
  module Util
8
11
  require 'benchmark'
9
12
 
10
- # Create a sync point for any threads
11
- @@sync = Sync.new
13
+ # Create a hash to store the different sync objects.
14
+ @@syncresources = {}
15
+
16
+ # Return the sync object associated with a given resource.
17
+ def self.sync(resource)
18
+ @@syncresources[resource] ||= Sync.new
19
+ return @@syncresources[resource]
20
+ end
21
+
12
22
  # Execute a block as a given user or group
13
23
  def self.asuser(user = nil, group = nil)
14
24
  require 'etc'
@@ -124,24 +134,22 @@ module Util
124
134
 
125
135
  # Create a shared lock for reading
126
136
  def self.readlock(file)
127
- @@sync.synchronize(Sync::SH) do
137
+ self.sync(file).synchronize(Sync::SH) do
128
138
  File.open(file) { |f|
129
139
  f.lock_shared { |lf| yield lf }
130
140
  }
131
141
  end
132
142
  end
133
143
 
134
- # Create an exclusive lock fro writing, and do the writing in a
144
+ # Create an exclusive lock for writing, and do the writing in a
135
145
  # tmp file.
136
146
  def self.writelock(file, mode = 0600)
137
147
  tmpfile = file + ".tmp"
138
- @@sync.synchronize(Sync::EX) do
148
+ self.sync(file).synchronize(Sync::EX) do
139
149
  File.open(file, "w", mode) do |rf|
140
150
  rf.lock_exclusive do |lrf|
141
- yield lrf
142
151
  File.open(tmpfile, "w", mode) do |tf|
143
152
  yield tf
144
- tf.flush
145
153
  end
146
154
  begin
147
155
  File.rename(tmpfile, file)
@@ -296,7 +304,7 @@ module Util
296
304
  def self.symbolize(value)
297
305
  case value
298
306
  when String: value = value.intern
299
- when Symbol: # nothing
307
+ when Symbol: value
300
308
  else
301
309
  raise ArgumentError, "'%s' must be a string or symbol" % value
302
310
  end
@@ -337,21 +345,49 @@ module Util
337
345
  if Puppet::Log.sendlevel?(level)
338
346
  result = nil
339
347
  seconds = Benchmark.realtime {
340
- result = yield
348
+ yield
341
349
  }
342
350
  object.send(level, msg + (" in %0.2f seconds" % seconds))
343
- result
351
+ return seconds
344
352
  else
345
353
  yield
346
354
  end
347
355
  end
348
356
 
357
+ # Execute the desired command, and return the status and output.
358
+ def execute(command, failonfail = true)
359
+ if respond_to? :debug
360
+ debug "Executing '%s'" % command
361
+ else
362
+ Puppet.debug "Executing '%s'" % command
363
+ end
364
+ output = %x{#{command} 2>&1}
365
+
366
+ if failonfail
367
+ unless $? == 0
368
+ raise ExecutionFailure, output
369
+ end
370
+ end
371
+
372
+ return output
373
+ end
374
+
375
+ # Create an exclusive lock.
376
+ def threadlock(resource, type = Sync::EX)
377
+ Puppet::Util.sync(resource).synchronize(type) do
378
+ yield
379
+ end
380
+ end
381
+
382
+ # Because some modules provide their own version of this method.
383
+ alias util_execute execute
384
+
349
385
  module_function :benchmark
350
386
 
351
387
  def memory
352
388
  unless defined? @pmap
353
389
  pmap = %x{which pmap 2>/dev/null}.chomp
354
- if pmap == ""
390
+ if $? != 0 or pmap =~ /^no/
355
391
  @pmap = nil
356
392
  else
357
393
  @pmap = pmap
@@ -363,8 +399,18 @@ module Util
363
399
  0
364
400
  end
365
401
  end
402
+
403
+ # Just benchmark, with no logging.
404
+ def thinmark
405
+ seconds = Benchmark.realtime {
406
+ yield
407
+ }
408
+
409
+ return seconds
410
+ end
411
+
366
412
  module_function :memory
367
413
  end
368
414
  end
369
415
 
370
- # $Id: util.rb 1113 2006-04-17 16:15:33Z luke $
416
+ # $Id: util.rb 1346 2006-06-30 20:41:41Z luke $
@@ -10,7 +10,7 @@ require 'puppet/server'
10
10
  require 'test/unit'
11
11
  require 'puppettest.rb'
12
12
 
13
- # $Id: client.rb 1068 2006-04-04 23:13:55Z luke $
13
+ # $Id: client.rb 1160 2006-05-02 04:30:40Z luke $
14
14
 
15
15
  class TestClient < Test::Unit::TestCase
16
16
  include ServerTest
@@ -86,7 +86,7 @@ class TestClient < Test::Unit::TestCase
86
86
  # make a new ssldir for it
87
87
  ca = nil
88
88
  assert_nothing_raised {
89
- ca = Puppet::Client::CAClient.new(
89
+ ca = Puppet::Client::CA.new(
90
90
  :CA => true, :Local => true
91
91
  )
92
92
  ca.requestcert
@@ -10,7 +10,7 @@ require 'puppet/server'
10
10
  require 'test/unit'
11
11
  require 'puppettest.rb'
12
12
 
13
- # $Id: master.rb 1107 2006-04-11 23:00:29Z luke $
13
+ # $Id: master.rb 1368 2006-07-05 17:17:39Z luke $
14
14
 
15
15
  class TestMasterClient < Test::Unit::TestCase
16
16
  include ServerTest
@@ -98,8 +98,8 @@ class TestMasterClient < Test::Unit::TestCase
98
98
  assert_nothing_raised do
99
99
  client.lock do
100
100
  pid = nil
101
- assert(pid = client.locked?, "Client is not locked")
102
- assert(pid =~ /^\d+$/, "PID is, um, not a pid")
101
+ assert(client.locked?, "Client is not locked")
102
+ assert(client.lockpid.is_a?(Integer), "PID #{client.lockpid} is, um, not a pid")
103
103
  end
104
104
  end
105
105
  assert(! client.locked?)
@@ -115,4 +115,93 @@ class TestMasterClient < Test::Unit::TestCase
115
115
  end
116
116
  assert(! client.locked?)
117
117
  end
118
+
119
+ # Make sure non-string facts don't make things go kablooie
120
+ def test_nonstring_facts
121
+ # Add a nonstring fact
122
+ Facter.add("nonstring") do
123
+ setcode { 1 }
124
+ end
125
+
126
+ assert_equal(1, Facter.nonstring, "Fact was a string from facter")
127
+
128
+ client = mkclient()
129
+
130
+ assert(! FileTest.exists?(@createdfile))
131
+
132
+ assert_nothing_raised {
133
+ client.run
134
+ }
135
+ end
136
+
137
+ def test_getplugins
138
+ Puppet[:pluginsource] = tempfile()
139
+ Dir.mkdir(Puppet[:pluginsource])
140
+
141
+ myplugin = File.join(Puppet[:pluginsource], "myplugin.rb")
142
+ File.open(myplugin, "w") do |f|
143
+ f.puts %{Puppet::Type.newtype(:myplugin) do
144
+ newparam(:argument) do
145
+ isnamevar
146
+ end
147
+ end
148
+ }
149
+ end
150
+
151
+ client = mkclient()
152
+
153
+ assert_nothing_raised {
154
+ client.send(:getplugins)
155
+ }
156
+
157
+ destfile = File.join(Puppet[:plugindest], "myplugin.rb")
158
+
159
+ assert(File.exists?(destfile), "Did not get plugin")
160
+
161
+ obj = Puppet::Type.type(:myplugin)
162
+
163
+ assert(obj, "Did not define type")
164
+
165
+ assert(obj.validattr?(:argument),
166
+ "Did not get namevar")
167
+
168
+ # Now modify the file and make sure the type is replaced
169
+ File.open(myplugin, "w") do |f|
170
+ f.puts %{Puppet::Type.newtype(:myplugin) do
171
+ newparam(:yayness) do
172
+ isnamevar
173
+ end
174
+
175
+ newparam(:rahness) do
176
+ end
177
+ end
178
+ }
179
+ end
180
+
181
+ assert_nothing_raised {
182
+ client.send(:getplugins)
183
+ }
184
+
185
+ destfile = File.join(Puppet[:pluginpath], "myplugin.rb")
186
+
187
+ obj = Puppet::Type.type(:myplugin)
188
+
189
+ assert(obj, "Did not define type")
190
+
191
+ assert(obj.validattr?(:yayness),
192
+ "Did not get namevar")
193
+
194
+ assert(obj.validattr?(:rahness),
195
+ "Did not get other var")
196
+
197
+ assert(! obj.validattr?(:argument),
198
+ "Old namevar is still valid")
199
+
200
+ # Now make sure it works with multiple paths specified.
201
+ newdir = tempfile()
202
+ Dir.mkdir(newdir)
203
+ Puppet[:pluginpath] = [Puppet[:pluginpath], newdir].join(":")
204
+
205
+ client.send(:getplugins)
206
+ end
118
207
  end
@@ -0,0 +1,99 @@
1
+ if __FILE__ == $0
2
+ $:.unshift '..'
3
+ $:.unshift '../../lib'
4
+ $puppetbase = "../.."
5
+ end
6
+
7
+ require 'puppet'
8
+ require 'puppet/client/pelement'
9
+ require 'puppet/server'
10
+ require 'test/unit'
11
+ require 'puppettest.rb'
12
+
13
+ # $Id: pelement.rb 1144 2006-04-28 04:08:32Z luke $
14
+
15
+ class TestPElementClient < Test::Unit::TestCase
16
+ include ServerTest
17
+
18
+ def mkpelementserver
19
+ handlers = {
20
+ :CA => {}, # so that certs autogenerate
21
+ :PElement => {},
22
+ }
23
+
24
+ return mkserver(handlers)
25
+ end
26
+
27
+ def mkclient
28
+ client = nil
29
+ assert_nothing_raised {
30
+ client = Puppet::Client::PElement.new(:Server => "localhost",
31
+ :Port => @@port)
32
+ }
33
+
34
+ return client
35
+ end
36
+
37
+ def test_pelements
38
+ file = tempfile()
39
+ text = "yayness\n"
40
+ File.open(file, "w") { |f| f.print text }
41
+
42
+ mkpelementserver()
43
+
44
+ client = mkclient()
45
+
46
+ # Test describing
47
+ tobj = nil
48
+ assert_nothing_raised {
49
+ tobj = client.describe("file", file)
50
+ }
51
+
52
+ assert(tobj, "Did not get response")
53
+
54
+ assert_instance_of(Puppet::TransObject, tobj)
55
+
56
+ obj = nil
57
+ assert_nothing_raised {
58
+ obj = tobj.to_type
59
+ }
60
+ assert_events([], obj)
61
+ File.unlink(file)
62
+ assert_events([:file_created], obj)
63
+ File.unlink(file)
64
+
65
+ # Now test applying
66
+ result = nil
67
+ assert_nothing_raised {
68
+ result = client.apply(tobj)
69
+ }
70
+ assert(FileTest.exists?(file), "File was not created on apply")
71
+
72
+ # Lastly, test "list"
73
+ list = nil
74
+ assert_nothing_raised {
75
+ list = client.list("user")
76
+ }
77
+
78
+ assert_instance_of(Puppet::TransBucket, list)
79
+
80
+ count = 0
81
+ list.each do |tobj|
82
+ break if count > 3
83
+ assert_instance_of(Puppet::TransObject, tobj)
84
+
85
+ tobj2 = nil
86
+ assert_nothing_raised {
87
+ tobj2 = client.describe(tobj.type, tobj.name)
88
+ }
89
+
90
+ obj = nil
91
+ assert_nothing_raised {
92
+ obj = tobj2.to_type
93
+ }
94
+ assert_events([], obj)
95
+
96
+ count += 1
97
+ end
98
+ end
99
+ end
@@ -28,7 +28,6 @@ class TestPuppetBin < Test::Unit::TestCase
28
28
  if Puppet[:debug]
29
29
  cmd += " --debug"
30
30
  end
31
- #cmd += " --fqdn %s" % fqdn
32
31
  cmd += " --confdir %s" % Puppet[:confdir]
33
32
  cmd += " --vardir %s" % Puppet[:vardir]
34
33
  unless Puppet[:debug]
@@ -36,7 +35,7 @@ class TestPuppetBin < Test::Unit::TestCase
36
35
  end
37
36
 
38
37
  assert_nothing_raised {
39
- system(cmd + " " + file)
38
+ output = %x{#{cmd + " " + file} 2>&1}
40
39
  }
41
40
  assert($? == 0, "Puppet exited with code %s" % $?.to_i)
42
41
 
@@ -62,7 +61,7 @@ class TestPuppetBin < Test::Unit::TestCase
62
61
  cmd += " -e \"#{code}\""
63
62
 
64
63
  assert_nothing_raised {
65
- system(cmd)
64
+ out = %x{#{cmd} 2>&1}
66
65
  }
67
66
  assert($? == 0, "Puppet exited with code %s" % $?.to_i)
68
67
 
@@ -70,4 +69,4 @@ class TestPuppetBin < Test::Unit::TestCase
70
69
  end
71
70
  end
72
71
 
73
- # $Id: puppetbin.rb 1065 2006-04-04 22:23:08Z luke $
72
+ # $Id: puppetbin.rb 1256 2006-06-13 15:57:06Z luke $
@@ -29,7 +29,7 @@ class TestPuppetCA < Test::Unit::TestCase
29
29
  if Puppet[:debug]
30
30
  debug = "-d "
31
31
  end
32
- return %x{puppetca --user=#{Puppet[:user]} #{debug} --group=#{Puppet[:group]} --confdir=#{Puppet[:confdir]} #{args} 2>&1}
32
+ return %x{puppetca --user=#{Puppet[:user]} #{debug} --group=#{Puppet[:group]} --confdir=#{Puppet[:confdir]} --vardir=#{Puppet[:vardir]} #{args} 2>&1}
33
33
 
34
34
  end
35
35
 
@@ -82,8 +82,8 @@ class TestPuppetCA < Test::Unit::TestCase
82
82
  output = runca("--list").chomp.split("\n")
83
83
  }
84
84
  assert_equal($?,0)
85
- assert_equal([], output)
85
+ assert_equal(["No certificates to sign"], output)
86
86
  end
87
87
  end
88
88
 
89
- # $Id: puppetca.rb 1113 2006-04-17 16:15:33Z luke $
89
+ # $Id: puppetca.rb 1256 2006-06-13 15:57:06Z luke $
@@ -18,7 +18,7 @@ class TestPuppetDExe < Test::Unit::TestCase
18
18
  file = startmasterd
19
19
 
20
20
  # create the client
21
- client = Puppet::Client.new(:Server => "localhost", :Port => @@port)
21
+ client = Puppet::Client::MasterClient.new(:Server => "localhost", :Port => @@port)
22
22
 
23
23
  # make a new fqdn
24
24
  fqdn = client.fqdn.sub(/^\w+\./, "testing.")
@@ -34,7 +34,7 @@ class TestPuppetDExe < Test::Unit::TestCase
34
34
 
35
35
  # and verify our daemon runs
36
36
  assert_nothing_raised {
37
- system(cmd)
37
+ %x{#{cmd} 2>&1}
38
38
  }
39
39
  sleep 1
40
40
  assert($? == 0, "Puppetd exited with code %s" % $?)
@@ -59,4 +59,4 @@ class TestPuppetDExe < Test::Unit::TestCase
59
59
  end
60
60
  end
61
61
 
62
- # $Id: puppetd.rb 967 2006-03-02 20:28:45Z luke $
62
+ # $Id: puppetd.rb 1256 2006-06-13 15:57:06Z luke $
@@ -74,14 +74,10 @@ class TestPuppetMasterD < Test::Unit::TestCase
74
74
  )
75
75
  }
76
76
  assert_nothing_raised() {
77
- #Puppet.notice "calling status"
78
- #retval = client.call("status.status", "")
79
77
  retval = client.getconfig
80
78
  }
81
79
 
82
80
  objects = nil
83
- stopmasterd
84
- sleep(1)
85
81
  end
86
82
 
87
83
  # verify that we can run puppetmasterd in parse-only mode
@@ -149,4 +145,4 @@ class TestPuppetMasterD < Test::Unit::TestCase
149
145
  end
150
146
  end
151
147
 
152
- # $Id: puppetmasterd.rb 952 2006-02-27 22:21:44Z luke $
148
+ # $Id: puppetmasterd.rb 1304 2006-06-20 18:10:06Z luke $