blob: a1a886a0eb5ea3a420bd8f7dfda9b56d1f546ca7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
require 'puppet'
require 'puppet/server'
require 'puppettest'
require 'socket'
require 'facter'
class TestPuppetDExe < Test::Unit::TestCase
include PuppetTest::ExeTest
def test_normalstart
# start the master
file = startmasterd
# create the client
client = Puppet::Client::MasterClient.new(:Server => "localhost", :Port => @@port)
# make a new fqdn
fqdn = client.fqdn.sub(/^\w+\./, "testing.")
cmd = "puppetd"
cmd += " --verbose"
cmd += " --onetime"
#cmd += " --fqdn %s" % fqdn
cmd += " --masterport %s" % @@port
cmd += " --confdir %s" % Puppet[:confdir]
cmd += " --vardir %s" % Puppet[:vardir]
cmd += " --server localhost"
# and verify our daemon runs
assert_nothing_raised {
%x{#{cmd} 2>&1}
}
sleep 1
assert($? == 0, "Puppetd exited with code %s" % $?)
assert(FileTest.exists?(@createdfile),
"Failed to create config'ed file")
# now verify that --noop works
File.unlink(@createdfile)
cmd += " --noop"
assert_nothing_raised {
output = %x{#{cmd}}.chomp
}
sleep 1
assert($? == 0, "Puppetd exited with code %s" % $?)
assert(! FileTest.exists?(@createdfile),
"Noop created config'ed file")
stopmasterd
end
end
# $Id$
|