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.
- data/CHANGELOG +98 -0
- data/Rakefile +5 -1
- data/bin/puppet +1 -1
- data/bin/puppetca +25 -11
- data/bin/puppetd +189 -66
- data/bin/puppetdoc +79 -62
- data/bin/puppetmasterd +93 -49
- data/bin/puppetrun +385 -0
- data/conf/redhat/client.init +5 -2
- data/conf/redhat/fileserver.conf +1 -1
- data/conf/redhat/lsb-config.patch +51 -0
- data/conf/redhat/puppet.spec +45 -18
- data/conf/redhat/puppetd.conf +32 -4
- data/conf/redhat/server.init +5 -2
- data/conf/solaris/pkginfo +7 -0
- data/conf/solaris/smf/puppetd.xml +77 -0
- data/conf/solaris/smf/puppetmasterd.xml +77 -0
- data/conf/solaris/smf/svc-puppetd +66 -0
- data/conf/solaris/smf/svc-puppetmasterd +62 -0
- data/examples/code/failers/noobjectrvalue +1 -0
- data/examples/code/snippets/deepclassheirarchy.pp +23 -0
- data/examples/code/snippets/defineoverrides.pp +17 -0
- data/examples/code/snippets/emptyexec.pp +3 -0
- data/examples/code/snippets/selectorvalues.pp +6 -1
- data/examples/code/snippets/tagged.pp +35 -0
- data/ext/ldap/puppet.schema +2 -2
- data/install.rb +4 -2
- data/lib/puppet.rb +206 -15
- data/lib/puppet/client.rb +30 -20
- data/lib/puppet/client/ca.rb +2 -2
- data/lib/puppet/client/dipper.rb +5 -9
- data/lib/puppet/client/master.rb +224 -44
- data/lib/puppet/client/pelement.rb +54 -9
- data/lib/puppet/client/proxy.rb +3 -2
- data/lib/puppet/client/reporter.rb +34 -0
- data/lib/puppet/client/runner.rb +17 -0
- data/lib/puppet/config.rb +136 -55
- data/lib/puppet/daemon.rb +59 -37
- data/lib/puppet/element.rb +2 -1
- data/lib/puppet/event.rb +14 -3
- data/lib/puppet/filetype.rb +28 -19
- data/lib/puppet/log.rb +297 -132
- data/lib/puppet/metric.rb +31 -131
- data/lib/puppet/networkclient.rb +73 -46
- data/lib/puppet/parameter.rb +49 -1
- data/lib/puppet/parsedfile.rb +32 -12
- data/lib/puppet/parser/ast.rb +6 -1
- data/lib/puppet/parser/ast/astarray.rb +32 -6
- data/lib/puppet/parser/ast/collection.rb +91 -0
- data/lib/puppet/parser/ast/compdef.rb +2 -2
- data/lib/puppet/parser/ast/component.rb +24 -11
- data/lib/puppet/parser/ast/function.rb +50 -0
- data/lib/puppet/parser/ast/hostclass.rb +70 -22
- data/lib/puppet/parser/ast/node.rb +17 -8
- data/lib/puppet/parser/ast/nodedef.rb +1 -1
- data/lib/puppet/parser/ast/objectdef.rb +28 -10
- data/lib/puppet/parser/ast/selector.rb +4 -1
- data/lib/puppet/parser/functions.rb +145 -0
- data/lib/puppet/parser/interpreter.rb +243 -86
- data/lib/puppet/parser/lexer.rb +5 -4
- data/lib/puppet/parser/parser.rb +586 -505
- data/lib/puppet/parser/scope.rb +337 -187
- data/lib/puppet/rails.rb +115 -0
- data/lib/puppet/rails/database.rb +40 -0
- data/lib/puppet/rails/host.rb +83 -0
- data/lib/puppet/rails/rails_object.rb +42 -0
- data/lib/puppet/rails/rails_parameter.rb +5 -0
- data/lib/puppet/reports/rrdgraph.rb +20 -0
- data/lib/puppet/reports/tagmail.rb +94 -0
- data/lib/puppet/server.rb +20 -4
- data/lib/puppet/server/authconfig.rb +14 -3
- data/lib/puppet/server/authstore.rb +2 -2
- data/lib/puppet/server/ca.rb +23 -11
- data/lib/puppet/server/filebucket.rb +10 -10
- data/lib/puppet/server/fileserver.rb +4 -8
- data/lib/puppet/server/master.rb +19 -22
- data/lib/puppet/server/pelement.rb +28 -16
- data/lib/puppet/server/report.rb +184 -0
- data/lib/puppet/server/runner.rb +62 -0
- data/lib/puppet/server/servlet.rb +23 -9
- data/lib/puppet/sslcertificates/ca.rb +25 -1
- data/lib/puppet/statechange.rb +34 -53
- data/lib/puppet/storage.rb +1 -2
- data/lib/puppet/transaction.rb +305 -133
- data/lib/puppet/transaction/report.rb +42 -0
- data/lib/puppet/transportable.rb +57 -33
- data/lib/puppet/type.rb +260 -127
- data/lib/puppet/type/component.rb +9 -21
- data/lib/puppet/type/cron.rb +367 -116
- data/lib/puppet/type/exec.rb +15 -16
- data/lib/puppet/type/group.rb +9 -1
- data/lib/puppet/type/nameservice.rb +2 -5
- data/lib/puppet/type/nameservice/netinfo.rb +3 -0
- data/lib/puppet/type/nameservice/objectadd.rb +23 -10
- data/lib/puppet/type/nameservice/pw.rb +16 -3
- data/lib/puppet/type/package.rb +25 -75
- data/lib/puppet/type/package/apple.rb +15 -1
- data/lib/puppet/type/package/apt.rb +37 -2
- data/lib/puppet/type/package/blastwave.rb +136 -0
- data/lib/puppet/type/package/dpkg.rb +4 -4
- data/lib/puppet/type/package/gem.rb +119 -0
- data/lib/puppet/type/package/openbsd.rb +7 -6
- data/lib/puppet/type/package/ports.rb +7 -2
- data/lib/puppet/type/package/rpm.rb +1 -1
- data/lib/puppet/type/package/sun.rb +23 -9
- data/lib/puppet/type/package/sunfreeware.rb +7 -0
- data/lib/puppet/type/package/yum.rb +16 -9
- data/lib/puppet/type/parsedtype.rb +7 -5
- data/lib/puppet/type/parsedtype/mount.rb +55 -34
- data/lib/puppet/type/parsedtype/port.rb +7 -1
- data/lib/puppet/type/parsedtype/sshkey.rb +6 -16
- data/lib/puppet/type/pfile.rb +115 -23
- data/lib/puppet/type/pfile/checksum.rb +18 -5
- data/lib/puppet/type/pfile/content.rb +2 -2
- data/lib/puppet/type/pfile/ensure.rb +3 -3
- data/lib/puppet/type/pfile/group.rb +2 -2
- data/lib/puppet/type/pfile/source.rb +28 -17
- data/lib/puppet/type/pfile/target.rb +25 -17
- data/lib/puppet/type/pfilebucket.rb +25 -6
- data/lib/puppet/type/schedule.rb +6 -6
- data/lib/puppet/type/service.rb +24 -14
- data/lib/puppet/type/service/debian.rb +1 -1
- data/lib/puppet/type/service/redhat.rb +13 -10
- data/lib/puppet/type/service/smf.rb +3 -3
- data/lib/puppet/type/state.rb +1 -2
- data/lib/puppet/type/symlink.rb +3 -4
- data/lib/puppet/type/user.rb +22 -10
- data/lib/puppet/type/yumrepo.rb +6 -1
- data/lib/puppet/type/zone.rb +595 -0
- data/lib/puppet/util.rb +58 -12
- data/test/client/client.rb +2 -2
- data/test/client/master.rb +92 -3
- data/test/client/pelement.rb +99 -0
- data/test/executables/puppetbin.rb +3 -4
- data/test/executables/puppetca.rb +3 -3
- data/test/executables/puppetd.rb +3 -3
- data/test/executables/puppetmasterd.rb +1 -5
- data/test/executables/puppetmodule.rb +2 -2
- data/test/language/ast.rb +200 -11
- data/test/language/functions.rb +245 -0
- data/test/language/interpreter.rb +155 -6
- data/test/language/lexer.rb +35 -2
- data/test/language/node.rb +48 -1
- data/test/language/parser.rb +250 -1
- data/test/language/rails.rb +105 -0
- data/test/language/scope.rb +304 -10
- data/test/language/snippets.rb +54 -5
- data/test/language/transportable.rb +60 -28
- data/test/other/config.rb +214 -1
- data/test/other/events.rb +67 -9
- data/test/other/log.rb +31 -5
- data/test/other/metrics.rb +23 -21
- data/test/other/parsedfile.rb +29 -2
- data/test/other/puppet.rb +79 -0
- data/test/other/report.rb +106 -0
- data/test/other/storage.rb +2 -2
- data/test/other/transactions.rb +128 -2
- data/test/puppet/utiltest.rb +10 -5
- data/test/puppettest.rb +193 -21
- data/test/server/authstore.rb +13 -4
- data/test/server/bucket.rb +33 -8
- data/test/server/ca.rb +44 -6
- data/test/server/master.rb +6 -7
- data/test/server/pelement.rb +15 -5
- data/test/server/report.rb +93 -0
- data/test/server/runner.rb +107 -0
- data/test/server/server.rb +28 -1
- data/test/types/cron.rb +339 -31
- data/test/types/file.rb +256 -24
- data/test/types/filebucket.rb +6 -2
- data/test/types/filesources.rb +41 -92
- data/test/types/group.rb +31 -1
- data/test/types/host.rb +2 -1
- data/test/types/mount.rb +18 -1
- data/test/types/package.rb +200 -18
- data/test/types/service.rb +5 -1
- data/test/types/sshkey.rb +2 -1
- data/test/types/symlink.rb +3 -2
- data/test/types/type.rb +180 -1
- data/test/types/user.rb +65 -27
- data/test/types/yumrepo.rb +15 -0
- data/test/types/zone.rb +437 -0
- metadata +43 -4
- data/bin/cf2puppet +0 -186
- 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
|
11
|
-
@@
|
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
|
-
|
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
|
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
|
-
|
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:
|
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
|
-
|
348
|
+
yield
|
341
349
|
}
|
342
350
|
object.send(level, msg + (" in %0.2f seconds" % seconds))
|
343
|
-
|
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
|
416
|
+
# $Id: util.rb 1346 2006-06-30 20:41:41Z luke $
|
data/test/client/client.rb
CHANGED
@@ -10,7 +10,7 @@ require 'puppet/server'
|
|
10
10
|
require 'test/unit'
|
11
11
|
require 'puppettest.rb'
|
12
12
|
|
13
|
-
# $Id: client.rb
|
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::
|
89
|
+
ca = Puppet::Client::CA.new(
|
90
90
|
:CA => true, :Local => true
|
91
91
|
)
|
92
92
|
ca.requestcert
|
data/test/client/master.rb
CHANGED
@@ -10,7 +10,7 @@ require 'puppet/server'
|
|
10
10
|
require 'test/unit'
|
11
11
|
require 'puppettest.rb'
|
12
12
|
|
13
|
-
# $Id: master.rb
|
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(
|
102
|
-
assert(
|
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
|
-
|
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
|
-
|
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
|
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
|
89
|
+
# $Id: puppetca.rb 1256 2006-06-13 15:57:06Z luke $
|
data/test/executables/puppetd.rb
CHANGED
@@ -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
|
-
|
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
|
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
|
148
|
+
# $Id: puppetmasterd.rb 1304 2006-06-20 18:10:06Z luke $
|