puppet 0.24.5 → 0.24.6
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 +206 -0
- data/Rakefile +53 -0
- data/bin/filebucket +0 -0
- data/bin/puppet +32 -11
- data/bin/puppetca +1 -0
- data/bin/puppetd +0 -0
- data/bin/puppetdoc +0 -0
- data/bin/puppetmasterd +0 -0
- data/bin/puppetrun +16 -8
- data/bin/ralsh +0 -0
- data/conf/debian/rules +0 -0
- data/conf/gentoo/init.d/puppetmaster +0 -0
- data/conf/osx/PackageInfo.plist +36 -0
- data/conf/osx/createpackage.sh +167 -0
- data/conf/osx/preflight +12 -0
- data/conf/redhat/client.init +1 -1
- data/conf/redhat/puppet.spec +34 -6
- data/conf/redhat/server.init +42 -7
- data/conf/redhat/server.sysconfig +22 -0
- data/conf/solaris/smf/svc-puppetd +0 -0
- data/conf/solaris/smf/svc-puppetmasterd +0 -0
- data/examples/etc/init.d/sleeper +0 -0
- data/examples/mac_dscl.pp +0 -0
- data/examples/mac_dscl_revert.pp +0 -0
- data/examples/mac_netinfo.pp +0 -0
- data/examples/mac_pkgdmg.pp +0 -0
- data/ext/bin/sleeper +0 -0
- data/ext/module_puppet +0 -0
- data/ext/nagios/check_puppet.rb +0 -0
- data/ext/passenger/README +63 -0
- data/ext/passenger/apache2.conf +29 -0
- data/ext/passenger/config.ru +40 -0
- data/ext/puppet-test +0 -0
- data/ext/puppetlast +6 -31
- data/ext/puppetstoredconfigclean.rb +87 -0
- data/install.rb +75 -20
- data/lib/puppet.rb +1 -1
- data/lib/puppet/daemon.rb +0 -0
- data/lib/puppet/defaults.rb +3 -7
- data/lib/puppet/external/base64.rb +0 -0
- data/lib/puppet/external/nagios.rb +0 -0
- data/lib/puppet/external/nagios/base.rb +0 -0
- data/lib/puppet/file_serving/fileset.rb +2 -2
- data/lib/puppet/file_serving/metadata.rb +3 -3
- data/lib/puppet/indirector/facts/facter.rb +3 -2
- data/lib/puppet/indirector/yaml.rb +10 -1
- data/lib/puppet/module.rb +36 -12
- data/lib/puppet/network/authstore.rb +0 -0
- data/lib/puppet/network/client/master.rb +12 -11
- data/lib/puppet/network/handler/filebucket.rb +0 -0
- data/lib/puppet/network/handler/fileserver.rb +38 -46
- data/lib/puppet/network/handler/master.rb +1 -1
- data/lib/puppet/network/handler/report.rb +0 -0
- data/lib/puppet/network/handler/resource.rb +0 -0
- data/lib/puppet/network/handler/runner.rb +0 -0
- data/lib/puppet/network/http_server/rack.rb +148 -0
- data/lib/puppet/network/rights.rb +0 -0
- data/lib/puppet/network/xmlrpc/client.rb +5 -5
- data/lib/puppet/node.rb +5 -9
- data/lib/puppet/node/environment.rb +1 -17
- data/lib/puppet/node/facts.rb +0 -0
- data/lib/puppet/parameter.rb +1 -28
- data/lib/puppet/parser/ast.rb +6 -0
- data/lib/puppet/parser/ast/arithmetic_operator.rb +41 -0
- data/lib/puppet/parser/ast/boolean_operator.rb +48 -0
- data/lib/puppet/parser/ast/collexpr.rb +6 -1
- data/lib/puppet/parser/ast/comparison_operator.rb +37 -0
- data/lib/puppet/parser/ast/minus.rb +23 -0
- data/lib/puppet/parser/ast/nop.rb +11 -0
- data/lib/puppet/parser/ast/not.rb +19 -0
- data/lib/puppet/parser/ast/resource_override.rb +23 -16
- data/lib/puppet/parser/ast/resource_reference.rb +10 -6
- data/lib/puppet/parser/ast/vardef.rb +2 -2
- data/lib/puppet/parser/collector.rb +2 -1
- data/lib/puppet/parser/functions.rb +7 -217
- data/lib/puppet/parser/functions/defined.rb +27 -0
- data/lib/puppet/parser/functions/fail.rb +4 -0
- data/lib/puppet/parser/functions/file.rb +21 -0
- data/lib/puppet/parser/functions/fqdn_rand.rb +15 -0
- data/lib/puppet/parser/functions/generate.rb +35 -0
- data/lib/puppet/parser/functions/include.rb +26 -0
- data/lib/puppet/parser/functions/realize.rb +14 -0
- data/lib/puppet/parser/functions/search.rb +7 -0
- data/lib/puppet/parser/functions/sha1.rb +6 -0
- data/lib/puppet/parser/functions/tag.rb +6 -0
- data/lib/puppet/parser/functions/tagged.rb +18 -0
- data/lib/puppet/parser/functions/template.rb +22 -0
- data/lib/puppet/parser/lexer.rb +15 -5
- data/lib/puppet/parser/parser.rb +1073 -715
- data/lib/puppet/parser/parser_support.rb +18 -13
- data/lib/puppet/parser/resource.rb +1 -1
- data/lib/puppet/parser/resource/param.rb +10 -2
- data/lib/puppet/parser/scope.rb +63 -5
- data/lib/puppet/parser/templatewrapper.rb +61 -15
- data/lib/puppet/property.rb +7 -1
- data/lib/puppet/property/keyvalue.rb +96 -0
- data/lib/puppet/property/list.rb +78 -0
- data/lib/puppet/provider/confine.rb +1 -1
- data/lib/puppet/provider/confine/variable.rb +10 -1
- data/lib/puppet/provider/cron/crontab.rb +0 -0
- data/lib/puppet/provider/mailalias/aliases.rb +0 -0
- data/lib/puppet/provider/maillist/mailman.rb +0 -0
- data/lib/puppet/provider/mount/parsed.rb +0 -0
- data/lib/puppet/provider/nameservice.rb +24 -39
- data/lib/puppet/provider/nameservice/directoryservice.rb +12 -3
- data/lib/puppet/provider/nameservice/netinfo.rb +12 -2
- data/lib/puppet/provider/nameservice/objectadd.rb +1 -10
- data/lib/puppet/provider/package/appdmg.rb +1 -1
- data/lib/puppet/provider/package/apple.rb +0 -0
- data/lib/puppet/provider/package/apt.rb +14 -21
- data/lib/puppet/provider/package/aptitude.rb +0 -0
- data/lib/puppet/provider/package/blastwave.rb +2 -0
- data/lib/puppet/provider/package/darwinport.rb +0 -0
- data/lib/puppet/provider/package/dpkg.rb +33 -51
- data/lib/puppet/provider/package/fink.rb +1 -1
- data/lib/puppet/provider/package/freebsd.rb +0 -0
- data/lib/puppet/provider/package/gem.rb +0 -0
- data/lib/puppet/provider/package/hpux.rb +46 -0
- data/lib/puppet/provider/package/openbsd.rb +0 -0
- data/lib/puppet/provider/package/pkgdmg.rb +1 -1
- data/lib/puppet/provider/package/portage.rb +3 -1
- data/lib/puppet/provider/package/ports.rb +3 -3
- data/lib/puppet/provider/package/rpm.rb +8 -1
- data/lib/puppet/provider/package/rug.rb +2 -2
- data/lib/puppet/provider/package/sun.rb +2 -0
- data/lib/puppet/provider/package/sunfreeware.rb +3 -0
- data/lib/puppet/provider/package/yum.rb +24 -17
- data/lib/puppet/provider/package/yumhelper.py +92 -11
- data/lib/puppet/provider/parsedfile.rb +0 -0
- data/lib/puppet/provider/port/parsed.rb +0 -0
- data/lib/puppet/provider/selboolean/getsetsebool.rb +47 -0
- data/lib/puppet/provider/selmodule/semodule.rb +143 -0
- data/lib/puppet/provider/service/base.rb +0 -0
- data/lib/puppet/provider/service/daemontools.rb +154 -0
- data/lib/puppet/provider/service/debian.rb +1 -1
- data/lib/puppet/provider/service/freebsd.rb +2 -0
- data/lib/puppet/provider/service/gentoo.rb +2 -0
- data/lib/puppet/provider/service/init.rb +0 -0
- data/lib/puppet/provider/service/redhat.rb +1 -1
- data/lib/puppet/provider/service/runit.rb +93 -0
- data/lib/puppet/provider/service/smf.rb +2 -0
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +7 -1
- data/lib/puppet/provider/sshkey/parsed.rb +0 -0
- data/lib/puppet/provider/user/hpux.rb +30 -0
- data/lib/puppet/provider/user/user_role_add.rb +156 -0
- data/lib/puppet/provider/user/useradd.rb +23 -14
- data/lib/puppet/rails/database/002_remove_duplicated_index_on_all_tables.rb +17 -0
- data/lib/puppet/rails/database/schema.rb +0 -8
- data/lib/puppet/rails/resource.rb +6 -6
- data/lib/puppet/reference/configuration.rb +0 -7
- data/lib/puppet/reports.rb +0 -0
- data/lib/puppet/reports/rrdgraph.rb +3 -2
- data/lib/puppet/sslcertificates.rb +0 -0
- data/lib/puppet/sslcertificates/inventory.rb +3 -2
- data/lib/puppet/sslcertificates/support.rb +3 -0
- data/lib/puppet/transaction/report.rb +1 -7
- data/lib/puppet/transportable.rb +10 -7
- data/lib/puppet/type.rb +2110 -14
- data/lib/puppet/type/cron.rb +0 -0
- data/lib/puppet/type/exec.rb +0 -0
- data/lib/puppet/type/file.rb +12 -2
- data/lib/puppet/type/file/checksum.rb +4 -0
- data/lib/puppet/type/file/content.rb +0 -0
- data/lib/puppet/type/file/ensure.rb +0 -0
- data/lib/puppet/type/file/group.rb +30 -43
- data/lib/puppet/type/file/mode.rb +0 -0
- data/lib/puppet/type/file/owner.rb +0 -0
- data/lib/puppet/type/file/selcontext.rb +104 -0
- data/lib/puppet/type/file/source.rb +0 -0
- data/lib/puppet/type/file/type.rb +0 -0
- data/lib/puppet/type/filebucket.rb +0 -0
- data/lib/puppet/type/group.rb +0 -8
- data/lib/puppet/type/host.rb +0 -0
- data/lib/puppet/type/mailalias.rb +0 -0
- data/lib/puppet/type/maillist.rb +0 -0
- data/lib/puppet/type/mount.rb +0 -0
- data/lib/puppet/type/package.rb +2 -2
- data/lib/puppet/type/port.rb +0 -0
- data/lib/puppet/type/schedule.rb +0 -0
- data/lib/puppet/type/selboolean.rb +31 -0
- data/lib/puppet/type/selmodule.rb +54 -0
- data/lib/puppet/type/ssh_authorized_key.rb +3 -3
- data/lib/puppet/type/sshkey.rb +0 -0
- data/lib/puppet/type/tidy.rb +0 -0
- data/lib/puppet/type/user.rb +153 -137
- data/lib/puppet/type/yumrepo.rb +18 -2
- data/lib/puppet/type/zone.rb +5 -1
- data/lib/puppet/util.rb +7 -7
- data/lib/puppet/util/filetype.rb +7 -0
- data/lib/puppet/util/instance_loader.rb +0 -0
- data/lib/puppet/util/ldap/connection.rb +11 -1
- data/lib/puppet/util/ldap/manager.rb +1 -1
- data/lib/puppet/util/loadedfile.rb +0 -0
- data/lib/puppet/util/log.rb +42 -43
- data/lib/puppet/util/metric.rb +23 -9
- data/lib/puppet/util/posix.rb +69 -18
- data/lib/puppet/util/selinux.rb +139 -0
- data/lib/puppet/util/settings.rb +5 -7
- data/lib/puppet/util/user_attr.rb +21 -0
- data/test/certmgr/ca.rb +0 -0
- data/test/certmgr/certmgr.rb +0 -0
- data/test/certmgr/inventory.rb +0 -0
- data/test/certmgr/support.rb +0 -0
- data/test/data/providers/ssh_authorized_key/parsed/authorized_keys1 +3 -0
- data/test/data/snippets/append.pp +11 -0
- data/test/data/snippets/arithmetic_expression.pp +8 -0
- data/test/data/snippets/arraytrailingcomma.pp +3 -0
- data/test/data/snippets/emptyifelse.pp +9 -0
- data/test/data/snippets/funccomma.pp +5 -0
- data/test/data/snippets/ifexpression.rb +6 -0
- data/test/data/snippets/subclass_name_duplication.pp +0 -0
- data/test/executables/filebucket.rb +0 -0
- data/test/executables/puppetbin.rb +0 -0
- data/test/executables/puppetca.rb +0 -0
- data/test/executables/puppetd.rb +0 -0
- data/test/executables/puppetmasterd.rb +0 -0
- data/test/executables/puppetmodule.rb +0 -0
- data/test/language/ast.rb +0 -0
- data/test/language/ast/casestatement.rb +0 -0
- data/test/language/ast/resource.rb +0 -0
- data/test/language/ast/resource_reference.rb +0 -28
- data/test/language/ast/selector.rb +0 -0
- data/test/language/ast/variable.rb +0 -0
- data/test/language/functions.rb +91 -12
- data/test/language/parser.rb +21 -0
- data/test/language/resource.rb +0 -0
- data/test/language/scope.rb +28 -0
- data/test/language/snippets.rb +14 -0
- data/test/language/transportable.rb +0 -0
- data/test/lib/puppettest.rb +0 -0
- data/test/lib/puppettest/reporttesting.rb +0 -2
- data/test/lib/puppettest/runnable_test.rb +2 -0
- data/test/lib/puppettest/support/resources.rb +0 -0
- data/test/network/authconfig.rb +0 -0
- data/test/network/authorization.rb +0 -0
- data/test/network/authstore.rb +0 -0
- data/test/network/client/ca.rb +0 -0
- data/test/network/client/client.rb +0 -0
- data/test/network/client/dipper.rb +0 -0
- data/test/network/client/master.rb +2 -6
- data/test/network/client/resource.rb +0 -0
- data/test/network/client_request.rb +0 -0
- data/test/network/daemon.rb +0 -0
- data/test/network/handler/bucket.rb +0 -0
- data/test/network/handler/ca.rb +0 -0
- data/test/network/handler/fileserver.rb +8 -0
- data/test/network/handler/handler.rb +0 -0
- data/test/network/handler/master.rb +3 -1
- data/test/network/handler/report.rb +0 -0
- data/test/network/handler/resource.rb +0 -0
- data/test/network/handler/runner.rb +0 -0
- data/test/network/rights.rb +0 -0
- data/test/network/server/mongrel_test.rb +0 -0
- data/test/network/server/webrick.rb +0 -0
- data/test/network/xmlrpc/client.rb +0 -0
- data/test/network/xmlrpc/processor.rb +0 -0
- data/test/network/xmlrpc/server.rb +0 -0
- data/test/network/xmlrpc/webrick_servlet.rb +0 -0
- data/test/other/dsl.rb +0 -0
- data/test/other/events.rb +0 -0
- data/test/other/overrides.rb +0 -0
- data/test/other/provider.rb +0 -0
- data/test/other/puppet.rb +0 -0
- data/test/other/relationships.rb +0 -0
- data/test/other/report.rb +2 -4
- data/test/other/transactions.rb +1 -1
- data/test/puppet/conffiles.rb +0 -0
- data/test/puppet/defaults.rb +0 -0
- data/test/puppet/errortest.rb +0 -0
- data/test/puppet/tc_suidmanager.rb +0 -0
- data/test/rails/ast.rb +0 -0
- data/test/rails/configuration.rb +0 -0
- data/test/rails/host.rb +0 -0
- data/test/rails/rails.rb +0 -0
- data/test/rails/railsparameter.rb +0 -0
- data/test/rails/railsresource.rb +0 -0
- data/test/ral/manager/attributes.rb +0 -0
- data/test/ral/manager/instances.rb +0 -0
- data/test/ral/manager/manager.rb +0 -0
- data/test/ral/manager/provider.rb +0 -0
- data/test/ral/manager/type.rb +0 -0
- data/test/ral/providers/cron/crontab.rb +0 -0
- data/test/ral/providers/group.rb +14 -13
- data/test/ral/providers/host/netinfo.rb +0 -0
- data/test/ral/providers/host/parsed.rb +0 -0
- data/test/ral/providers/mailalias/aliases.rb +0 -0
- data/test/ral/providers/mount/netinfo.rb +0 -0
- data/test/ral/providers/nameservice.rb +0 -0
- data/test/ral/providers/package.rb +0 -31
- data/test/ral/providers/package/aptitude.rb +1 -2
- data/test/ral/providers/package/aptrpm.rb +2 -2
- data/test/ral/providers/parsedfile.rb +0 -0
- data/test/ral/providers/port/parsed.rb +0 -0
- data/test/ral/providers/provider.rb +0 -0
- data/test/ral/providers/service/base.rb +0 -0
- data/test/ral/providers/service/debian.rb +0 -0
- data/test/ral/providers/sshkey/parsed.rb +0 -0
- data/test/ral/providers/user.rb +8 -8
- data/test/ral/providers/user/useradd.rb +0 -0
- data/test/ral/type/basic.rb +0 -0
- data/test/ral/type/cron.rb +0 -0
- data/test/ral/type/exec.rb +0 -0
- data/test/ral/type/file.rb +0 -0
- data/test/ral/type/file/target.rb +0 -0
- data/test/ral/type/filebucket.rb +0 -0
- data/test/ral/type/fileignoresource.rb +0 -0
- data/test/ral/type/filesources.rb +1 -3
- data/test/ral/type/group.rb +0 -0
- data/test/ral/type/host.rb +0 -0
- data/test/ral/type/mailalias.rb +1 -2
- data/test/ral/type/parameter.rb +0 -0
- data/test/ral/type/port.rb +0 -0
- data/test/ral/type/property.rb +0 -0
- data/test/ral/type/resources.rb +0 -0
- data/test/ral/type/service.rb +0 -0
- data/test/ral/type/sshkey.rb +0 -0
- data/test/ral/type/tidy.rb +0 -0
- data/test/ral/type/user.rb +0 -50
- data/test/ral/type/yumrepo.rb +7 -1
- data/test/ral/type/zone.rb +0 -0
- data/test/test +0 -0
- data/test/util/autoload.rb +0 -0
- data/test/util/classgen.rb +0 -0
- data/test/util/execution.rb +0 -0
- data/test/util/features.rb +0 -0
- data/test/util/fileparsing.rb +0 -0
- data/test/util/filetype.rb +0 -0
- data/test/util/inifile.rb +0 -0
- data/test/util/instance_loader.rb +0 -0
- data/test/util/log.rb +0 -59
- data/test/util/metrics.rb +0 -0
- data/test/util/package.rb +0 -0
- data/test/util/pidlock.rb +0 -0
- data/test/util/settings.rb +0 -0
- data/test/util/storage.rb +0 -0
- data/test/util/subclass_loader.rb +0 -0
- data/test/util/utiltest.rb +0 -0
- metadata +54 -19
- data/lib/puppet/metatype/attributes.rb +0 -685
- data/lib/puppet/metatype/closure.rb +0 -49
- data/lib/puppet/metatype/container.rb +0 -50
- data/lib/puppet/metatype/evaluation.rb +0 -163
- data/lib/puppet/metatype/instances.rb +0 -305
- data/lib/puppet/metatype/metaparams.rb +0 -423
- data/lib/puppet/metatype/providers.rb +0 -247
- data/lib/puppet/metatype/relationships.rb +0 -115
- data/lib/puppet/metatype/schedules.rb +0 -33
- data/lib/puppet/metatype/tags.rb +0 -38
- data/lib/puppet/util/plist.rb +0 -23
- data/lib/puppet/util/plist/generator.rb +0 -225
- data/lib/puppet/util/plist/parser.rb +0 -226
- data/test/ral/providers/package/apt.rb +0 -169
- data/test/ral/providers/package/dpkg.rb +0 -64
- data/test/util/posixtest.rb +0 -169
data/test/language/snippets.rb
CHANGED
@@ -446,6 +446,20 @@ class TestSnippets < Test::Unit::TestCase
|
|
446
446
|
"Did not make second file from duplicate subclass names")
|
447
447
|
end
|
448
448
|
|
449
|
+
def snippet_funccomma
|
450
|
+
assert_file("/tmp/funccomma1",
|
451
|
+
"Did not make first file from trailing function comma")
|
452
|
+
assert_file("/tmp/funccomma2",
|
453
|
+
"Did not make second file from trailing function comma")
|
454
|
+
end
|
455
|
+
|
456
|
+
def snippet_arraytrailingcomma
|
457
|
+
assert_file("/tmp/arraytrailingcomma1",
|
458
|
+
"Did not make first file from array")
|
459
|
+
assert_file("/tmp/arraytrailingcomma2",
|
460
|
+
"Did not make second file from array")
|
461
|
+
end
|
462
|
+
|
449
463
|
# Iterate across each of the snippets and create a test.
|
450
464
|
Dir.entries(snippetdir).sort.each { |file|
|
451
465
|
next if file =~ /^\./
|
File without changes
|
data/test/lib/puppettest.rb
CHANGED
File without changes
|
File without changes
|
data/test/network/authconfig.rb
CHANGED
File without changes
|
File without changes
|
data/test/network/authstore.rb
CHANGED
File without changes
|
data/test/network/client/ca.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
@@ -402,12 +402,9 @@ end
|
|
402
402
|
client.send(:splay)
|
403
403
|
end
|
404
404
|
|
405
|
-
time = Puppet::Util::Storage.cache(:configuration)[:splay_time]
|
406
|
-
assert(time, "Splay time was not cached")
|
407
|
-
|
408
405
|
# Now try it again
|
409
406
|
client = mkclient
|
410
|
-
client.expects(:sleep)
|
407
|
+
client.expects(:sleep)
|
411
408
|
|
412
409
|
assert_nothing_raised("Failed to call sleep when splay is true with a cached value") do
|
413
410
|
client.send(:splay)
|
@@ -419,8 +416,7 @@ end
|
|
419
416
|
assert_equal(facts["environment"], Puppet[:environment], "Did not add environment to client facts")
|
420
417
|
|
421
418
|
# Now set it to a real value
|
422
|
-
|
423
|
-
Puppet[:environment] = "something"
|
419
|
+
Puppet[:environment] = "something"
|
424
420
|
facts = Puppet::Network::Client::Master.facts
|
425
421
|
assert_equal(facts["environment"], Puppet[:environment], "Did not add environment to client facts")
|
426
422
|
end
|
File without changes
|
File without changes
|
data/test/network/daemon.rb
CHANGED
File without changes
|
File without changes
|
data/test/network/handler/ca.rb
CHANGED
File without changes
|
@@ -437,6 +437,14 @@ class TestFileServer < Test::Unit::TestCase
|
|
437
437
|
assert_nil(retval, "Description of non-existent mounts returned a value")
|
438
438
|
end
|
439
439
|
|
440
|
+
def test_describe_does_not_fail_when_mount_does_not_find_file
|
441
|
+
server = Puppet::Network::Handler.fileserver.new(:Local => true, :Config => false)
|
442
|
+
|
443
|
+
assert_nothing_raised("Failed when describing missing plugins") do
|
444
|
+
server.describe "/plugins"
|
445
|
+
end
|
446
|
+
end
|
447
|
+
|
440
448
|
# test that our config file is parsing and working as planned
|
441
449
|
def test_configfile
|
442
450
|
server = nil
|
File without changes
|
@@ -25,7 +25,9 @@ class TestMaster < Test::Unit::TestCase
|
|
25
25
|
now1 = mock 'now1'
|
26
26
|
Time.expects(:now).returns(now1)
|
27
27
|
|
28
|
-
|
28
|
+
now1.expects(:to_i).returns 10
|
29
|
+
|
30
|
+
assert_equal(@master.freshness, 10, "Did not return current time as freshness")
|
29
31
|
end
|
30
32
|
|
31
33
|
def test_hostname_is_used_if_client_is_missing
|
File without changes
|
File without changes
|
File without changes
|
data/test/network/rights.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/test/other/dsl.rb
CHANGED
File without changes
|
data/test/other/events.rb
CHANGED
File without changes
|
data/test/other/overrides.rb
CHANGED
File without changes
|
data/test/other/provider.rb
CHANGED
File without changes
|
data/test/other/puppet.rb
CHANGED
File without changes
|
data/test/other/relationships.rb
CHANGED
File without changes
|
data/test/other/report.rb
CHANGED
@@ -21,7 +21,7 @@ class TestReports < Test::Unit::TestCase
|
|
21
21
|
# Make every third file
|
22
22
|
File.open(file, "w") { |f| f.puts "" } if i % 3 == 0
|
23
23
|
|
24
|
-
objects << Puppet::Type.
|
24
|
+
objects << Puppet::Type.type(:file).create(
|
25
25
|
:path => file,
|
26
26
|
:ensure => "file"
|
27
27
|
)
|
@@ -44,7 +44,7 @@ class TestReports < Test::Unit::TestCase
|
|
44
44
|
}
|
45
45
|
|
46
46
|
# Now make a file for testing logging
|
47
|
-
file = Puppet::Type.
|
47
|
+
file = Puppet::Type.type(:file).create(:path => tempfile(), :ensure => "file")
|
48
48
|
file.finish
|
49
49
|
|
50
50
|
log = nil
|
@@ -91,8 +91,6 @@ class TestReports < Test::Unit::TestCase
|
|
91
91
|
|
92
92
|
3.times { |i|
|
93
93
|
log = Puppet.warning("Report test message %s" % i)
|
94
|
-
log.tags = %w{a list of tags}
|
95
|
-
log.tags << "tag%s" % i
|
96
94
|
|
97
95
|
report.newlog(log)
|
98
96
|
}
|
data/test/other/transactions.rb
CHANGED
data/test/puppet/conffiles.rb
CHANGED
File without changes
|
data/test/puppet/defaults.rb
CHANGED
File without changes
|
data/test/puppet/errortest.rb
CHANGED
File without changes
|
File without changes
|
data/test/rails/ast.rb
CHANGED
File without changes
|
data/test/rails/configuration.rb
CHANGED
File without changes
|
data/test/rails/host.rb
CHANGED
File without changes
|
data/test/rails/rails.rb
CHANGED
File without changes
|
File without changes
|
data/test/rails/railsresource.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
data/test/ral/manager/manager.rb
CHANGED
File without changes
|
File without changes
|
data/test/ral/manager/type.rb
CHANGED
File without changes
|
File without changes
|
data/test/ral/providers/group.rb
CHANGED
@@ -30,14 +30,18 @@ class TestGroupProvider < Test::Unit::TestCase
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def mkgroup(name, hash = {})
|
33
|
-
fakeresource =
|
33
|
+
fakeresource = stub 'group', :allowdupe? => false, :name => name
|
34
|
+
fakeresource.stubs(:[]).returns nil
|
35
|
+
fakeresource.stubs(:should).returns nil
|
36
|
+
fakeresource.stubs(:[]).with(:name).returns name
|
37
|
+
hash.each do |name, val|
|
38
|
+
fakeresource.stubs(:should).with(name).returns val
|
39
|
+
fakeresource.stubs(:[]).with(name).returns val
|
40
|
+
end
|
34
41
|
group = nil
|
35
42
|
assert_nothing_raised {
|
36
43
|
group = @provider.new(fakeresource)
|
37
44
|
}
|
38
|
-
hash.each do |name, val|
|
39
|
-
fakeresource[name] = val
|
40
|
-
end
|
41
45
|
assert(group, "Could not create provider group")
|
42
46
|
|
43
47
|
return group
|
@@ -108,19 +112,19 @@ class TestGroupProvider < Test::Unit::TestCase
|
|
108
112
|
def attrtest_ensure(group)
|
109
113
|
old = group.ensure
|
110
114
|
assert_nothing_raised {
|
111
|
-
group.
|
115
|
+
group.delete
|
112
116
|
}
|
113
117
|
|
114
118
|
assert(!group.exists?, "Group was not deleted")
|
115
119
|
|
116
120
|
assert_nothing_raised {
|
117
|
-
group.
|
121
|
+
group.create
|
118
122
|
}
|
119
123
|
assert(group.exists?, "Group was not created")
|
120
124
|
|
121
125
|
unless old == :present
|
122
126
|
assert_nothing_raised {
|
123
|
-
group.
|
127
|
+
group.delete
|
124
128
|
}
|
125
129
|
end
|
126
130
|
end
|
@@ -211,7 +215,6 @@ class TestGroupProvider < Test::Unit::TestCase
|
|
211
215
|
unless Facter["operatingsystem"].value == "FreeBSD"
|
212
216
|
def test_duplicateIDs
|
213
217
|
group1 = mkgroup("group1", :gid => 125)
|
214
|
-
group2 = mkgroup("group2", :gid => 125)
|
215
218
|
|
216
219
|
@@tmpgroups << "group1"
|
217
220
|
@@tmpgroups << "group2"
|
@@ -222,16 +225,14 @@ class TestGroupProvider < Test::Unit::TestCase
|
|
222
225
|
|
223
226
|
# Not all OSes fail here, so we can't test that it doesn't work with
|
224
227
|
# it off, only that it does work with it on.
|
225
|
-
|
226
|
-
|
227
|
-
}
|
228
|
+
group2 = mkgroup("group2", :gid => 125)
|
229
|
+
group2.resource.stubs(:allowdupe?).returns true
|
228
230
|
|
229
231
|
# Now create the second group
|
230
232
|
assert_nothing_raised {
|
231
233
|
group2.create
|
232
234
|
}
|
233
|
-
assert_equal(:present, group2.ensure,
|
234
|
-
"Group did not get created")
|
235
|
+
assert_equal(:present, group2.ensure, "Group did not get created")
|
235
236
|
end
|
236
237
|
end
|
237
238
|
else
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -244,36 +244,5 @@ class TestPackageProvider < Test::Unit::TestCase
|
|
244
244
|
pkg[:adminfile] = "/usr/local/pkg/admin_file"
|
245
245
|
end
|
246
246
|
end
|
247
|
-
|
248
|
-
# Make sure providers throw an error when you tell them to install a
|
249
|
-
# non-existent package.
|
250
|
-
def test_no_such_package
|
251
|
-
Puppet::Type.type(:package).suitableprovider.each do |provider|
|
252
|
-
assert_raise(ArgumentError, Puppet::Error, Puppet::ExecutionFailure,
|
253
|
-
"Successfully installed nonexistent package with %s" % provider.name) {
|
254
|
-
pkg = Puppet::Type.newpackage :name => "nosuch%s" % provider.name.to_s,
|
255
|
-
:provider => provider.name
|
256
|
-
provider = pkg.provider
|
257
|
-
provider.install
|
258
|
-
}
|
259
|
-
end
|
260
|
-
end
|
261
|
-
|
262
|
-
# Make sure all of the suitable providers on our platform can successfully
|
263
|
-
# list.
|
264
|
-
def test_instances
|
265
|
-
Puppet::Type.type(:package).suitableprovider.each do |provider|
|
266
|
-
result = nil
|
267
|
-
assert_nothing_raised("Could not list %s packages" % provider.name) do
|
268
|
-
result = provider.instances
|
269
|
-
end
|
270
|
-
result.each do |pkg|
|
271
|
-
assert_instance_of(provider, pkg,
|
272
|
-
"%s returned non-provider" % provider.name)
|
273
|
-
assert_equal(provider.name, pkg.class.name,
|
274
|
-
"Provider %s returned an instance of a different provider" % provider.name)
|
275
|
-
end
|
276
|
-
end
|
277
|
-
end
|
278
247
|
end
|
279
248
|
|
@@ -41,7 +41,6 @@ class AptitudePackageProviderTest < PuppetTest::TestCase
|
|
41
41
|
).returns(0)
|
42
42
|
|
43
43
|
pkg.evaluate.each { |state|
|
44
|
-
state.transaction = self
|
45
44
|
state.forward
|
46
45
|
}
|
47
46
|
end
|
@@ -67,6 +66,6 @@ class AptitudePackageProviderTest < PuppetTest::TestCase
|
|
67
66
|
'faff'
|
68
67
|
).returns(0)
|
69
68
|
|
70
|
-
pkg.evaluate.each { |state| state.
|
69
|
+
pkg.evaluate.each { |state| state.forward }
|
71
70
|
end
|
72
71
|
end
|
@@ -39,7 +39,7 @@ class AptrpmPackageProviderTest < PuppetTest::TestCase
|
|
39
39
|
'faff'
|
40
40
|
).returns(0)
|
41
41
|
|
42
|
-
pkg.evaluate.each { |state| state.
|
42
|
+
pkg.evaluate.each { |state| state.forward }
|
43
43
|
end
|
44
44
|
|
45
45
|
def test_uninstall
|
@@ -66,7 +66,7 @@ class AptrpmPackageProviderTest < PuppetTest::TestCase
|
|
66
66
|
'faff'
|
67
67
|
).returns(0)
|
68
68
|
|
69
|
-
pkg.evaluate.each { |state| state.
|
69
|
+
pkg.evaluate.each { |state| state.forward }
|
70
70
|
end
|
71
71
|
|
72
72
|
# LAK: I don't know where this test will ever return true..
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/test/ral/providers/user.rb
CHANGED
@@ -214,20 +214,20 @@ class TestUserProvider < Test::Unit::TestCase
|
|
214
214
|
def attrtest_ensure(user)
|
215
215
|
old = user.ensure
|
216
216
|
assert_nothing_raised {
|
217
|
-
user.
|
217
|
+
user.delete
|
218
218
|
}
|
219
219
|
|
220
220
|
assert(missing?(user.name), "User is still present")
|
221
221
|
assert_nothing_raised {
|
222
|
-
user.
|
222
|
+
user.create
|
223
223
|
}
|
224
224
|
assert(!missing?(user.name), "User is absent")
|
225
225
|
assert_nothing_raised {
|
226
|
-
user.
|
226
|
+
user.delete
|
227
227
|
}
|
228
228
|
|
229
229
|
unless old == :absent
|
230
|
-
user.
|
230
|
+
user.create
|
231
231
|
end
|
232
232
|
end
|
233
233
|
|
@@ -398,10 +398,10 @@ class TestUserProvider < Test::Unit::TestCase
|
|
398
398
|
|
399
399
|
# Some tests to verify that groups work correctly startig from nothing
|
400
400
|
# Remove our user
|
401
|
-
user.
|
401
|
+
user.delete
|
402
402
|
|
403
403
|
# And add it again
|
404
|
-
user.
|
404
|
+
user.create
|
405
405
|
|
406
406
|
# Make sure that the group list is added at creation time.
|
407
407
|
# This is necessary because we don't have default fakedata for groups.
|
@@ -498,8 +498,8 @@ class TestUserProvider < Test::Unit::TestCase
|
|
498
498
|
user2.resource[:uid] = 125
|
499
499
|
|
500
500
|
cleanup do
|
501
|
-
user1.
|
502
|
-
user2.
|
501
|
+
user1.delete
|
502
|
+
user2.delete
|
503
503
|
end
|
504
504
|
|
505
505
|
# Not all OSes fail here, so we can't test that it doesn't work with
|