Sha256: 8944a2f538671c4fc8ec33366166a6a5995da478b5d22a0c10371f75f4b1fb2b

Contents?: true

Size: 1.48 KB

Versions: 2

Compression:

Stored size: 1.48 KB

Contents

if __FILE__ == $0
    $:.unshift '..'
    $:.unshift '../../lib'
    $puppetbase = "../.."
end

require 'puppet'
require 'puppet/client'
require 'puppet/server'
require 'test/unit'
require 'puppettest.rb'

# $Id: master.rb 908 2006-02-14 00:14:56Z luke $

class TestMasterClient < Test::Unit::TestCase
	include ServerTest

    def mkmaster(file)
        master = nil
        # create our master
        assert_nothing_raised() {
            # this is the default server setup
            master = Puppet::Server::Master.new(
                :File => file,
                :UseNodes => false,
                :Local => true
            )
        }
        return master
    end

    def mkclient(master)
        client = nil
        assert_nothing_raised() {
            client = Puppet::Client::MasterClient.new(
                :Master => master
            )
        }

        return client
    end

    def test_disable
        manifest = mktestmanifest

        master = mkmaster(manifest)

        client = mkclient(master)

        assert(! FileTest.exists?(@createdfile))

        assert_nothing_raised {
            client.disable
        }

        assert_nothing_raised {
            client.run
        }

        assert(! FileTest.exists?(@createdfile), "Disabled client ran")

        assert_nothing_raised {
            client.enable
        }

        assert_nothing_raised {
            client.run
        }

        assert(FileTest.exists?(@createdfile), "Enabled client did not run")
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
puppet-0.13.2 test/client/master.rb
puppet-0.13.6 test/client/master.rb