2
require 'puppet/network/http_server/webrick'
4
module PuppetTest::ServerTest
16
# create a simple manifest that just creates a file
18
file = File.join(Puppet[:confdir], "#{(self.class.to_s + "test")}site.pp")
19
#@createdfile = File.join(tmpdir, self.class.to_s + "manifesttesting" +
21
@createdfile = tempfile
23
File.open(file, "w") { |f|
24
f.puts "file { \"%s\": ensure => file, mode => 755 }\n" % @createdfile
27
@@tmpfiles << @createdfile
33
# create a server, forked into the background
34
def mkserver(handlers = nil)
35
Puppet[:name] = "puppetmasterd"
36
# our default handlers
39
:CA => {}, # so that certs autogenerate
41
:Manifest => mktestmanifest,
47
# then create the actual server
49
assert_nothing_raised {
51
server = Puppet::Network::HTTPServer::WEBrick.new(
61
trap(:INT) { server.shutdown }
65
# and store its pid for killing
68
# give the server a chance to do its thing