puppet 3.0.2 → 3.1.0.rc1
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/Gemfile +13 -11
- data/README.md +9 -7
- data/README_DEVELOPER.md +21 -30
- data/bin/extlookup2hiera +0 -0
- data/conf/auth.conf +42 -26
- data/conf/fileserver.conf +41 -0
- data/conf/tagmail.conf +16 -0
- data/examples/hiera/modules/data/manifests/common.pp +2 -1
- data/examples/hiera/modules/ntp/manifests/config.pp +4 -3
- data/examples/hiera/modules/ntp/manifests/data.pp +2 -1
- data/examples/hiera/modules/users/manifests/common.pp +2 -1
- data/examples/hiera/modules/users/manifests/dc1.pp +2 -1
- data/examples/hiera/modules/users/manifests/development.pp +2 -1
- data/examples/hiera/site.pp +1 -1
- data/ext/debian/fileserver.conf +39 -15
- data/ext/envpuppet +2 -0
- data/ext/gentoo/puppet/fileserver.conf +41 -12
- data/ext/ips/puppet-agent +1 -6
- data/ext/ips/puppetagent.xml +0 -4
- data/ext/osx/postflight.erb +109 -0
- data/ext/project_data.yaml +2 -2
- data/ext/redhat/fileserver.conf +41 -12
- data/ext/redhat/puppet.spec.erb +8 -13
- data/install.rb +2 -5
- data/lib/puppet.rb +30 -13
- data/lib/puppet/application.rb +34 -16
- data/lib/puppet/application/agent.rb +4 -4
- data/lib/puppet/application/master.rb +25 -5
- data/lib/puppet/defaults.rb +11 -7
- data/lib/puppet/dsl.rb +7 -3
- data/lib/puppet/dsl/actions.rb +283 -0
- data/lib/puppet/dsl/blank_slate.rb +55 -0
- data/lib/puppet/dsl/context.rb +393 -0
- data/lib/puppet/dsl/parser.rb +57 -0
- data/lib/puppet/dsl/resource_decorator.rb +56 -0
- data/lib/puppet/dsl/resource_reference.rb +95 -0
- data/lib/puppet/dsl/type_reference.rb +102 -0
- data/lib/puppet/error.rb +1 -1
- data/lib/puppet/face/help.rb +2 -4
- data/lib/puppet/face/man.rb +8 -2
- data/lib/puppet/feature/pson.rb +1 -3
- data/lib/puppet/indirector/catalog/active_record.rb +3 -0
- data/lib/puppet/indirector/catalog/compiler.rb +1 -2
- data/lib/puppet/indirector/catalog/queue.rb +4 -0
- data/lib/puppet/indirector/catalog/static_compiler.rb +30 -0
- data/lib/puppet/indirector/catalog/store_configs.rb +3 -0
- data/lib/puppet/indirector/certificate_request/rest.rb +1 -0
- data/lib/puppet/indirector/certificate_revocation_list/rest.rb +1 -0
- data/lib/puppet/indirector/certificate_status/file.rb +4 -0
- data/lib/puppet/indirector/certificate_status/rest.rb +1 -0
- data/lib/puppet/indirector/facts/active_record.rb +3 -0
- data/lib/puppet/indirector/facts/couch.rb +3 -0
- data/lib/puppet/indirector/facts/inventory_active_record.rb +4 -0
- data/lib/puppet/indirector/facts/store_configs.rb +3 -0
- data/lib/puppet/indirector/file_metadata/rest.rb +2 -0
- data/lib/puppet/indirector/instrumentation_data/local.rb +3 -0
- data/lib/puppet/indirector/instrumentation_data/rest.rb +3 -0
- data/lib/puppet/indirector/instrumentation_listener/local.rb +3 -0
- data/lib/puppet/indirector/instrumentation_listener/rest.rb +3 -0
- data/lib/puppet/indirector/instrumentation_probe/local.rb +3 -0
- data/lib/puppet/indirector/instrumentation_probe/rest.rb +3 -0
- data/lib/puppet/indirector/node/active_record.rb +3 -0
- data/lib/puppet/indirector/node/rest.rb +2 -2
- data/lib/puppet/indirector/node/store_configs.rb +3 -0
- data/lib/puppet/indirector/node/write_only_yaml.rb +32 -0
- data/lib/puppet/indirector/queue.rb +0 -1
- data/lib/puppet/indirector/request.rb +1 -2
- data/lib/puppet/indirector/resource/active_record.rb +4 -0
- data/lib/puppet/indirector/resource/ral.rb +3 -0
- data/lib/puppet/indirector/resource/rest.rb +3 -0
- data/lib/puppet/indirector/resource/store_configs.rb +3 -0
- data/lib/puppet/indirector/run/local.rb +3 -0
- data/lib/puppet/indirector/ssl_file.rb +16 -14
- data/lib/puppet/indirector/status/local.rb +3 -0
- data/lib/puppet/indirector/status/rest.rb +4 -0
- data/lib/puppet/interface.rb +78 -3
- data/lib/puppet/interface/action.rb +39 -3
- data/lib/puppet/interface/action_builder.rb +74 -1
- data/lib/puppet/interface/action_manager.rb +33 -3
- data/lib/puppet/interface/documentation.rb +116 -5
- data/lib/puppet/interface/face_collection.rb +6 -7
- data/lib/puppet/interface/option.rb +10 -1
- data/lib/puppet/interface/option_builder.rb +29 -1
- data/lib/puppet/interface/option_manager.rb +21 -6
- data/lib/puppet/metatype/manager.rb +47 -9
- data/lib/puppet/module_tool.rb +0 -1
- data/lib/puppet/network/formats.rb +0 -2
- data/lib/puppet/node.rb +2 -3
- data/lib/puppet/node/environment.rb +14 -1
- data/lib/puppet/parameter.rb +309 -44
- data/lib/puppet/parameter/package_options.rb +5 -0
- data/lib/puppet/parameter/path.rb +26 -3
- data/lib/puppet/parameter/value.rb +30 -6
- data/lib/puppet/parameter/value_collection.rb +82 -20
- data/lib/puppet/parser.rb +3 -0
- data/lib/puppet/parser/ast/definition.rb +2 -5
- data/lib/puppet/parser/ast/hostclass.rb +2 -3
- data/lib/puppet/parser/ast/node.rb +2 -5
- data/lib/puppet/parser/ast/resourceparam.rb +1 -1
- data/lib/puppet/parser/compiler.rb +10 -0
- data/lib/puppet/parser/functions.rb +111 -7
- data/lib/puppet/parser/functions/create_resources.rb +23 -2
- data/lib/puppet/parser/functions/defined.rb +1 -1
- data/lib/puppet/parser/functions/extlookup.rb +2 -1
- data/lib/puppet/parser/functions/fail.rb +1 -1
- data/lib/puppet/parser/functions/file.rb +1 -1
- data/lib/puppet/parser/functions/fqdn_rand.rb +1 -1
- data/lib/puppet/parser/functions/generate.rb +1 -1
- data/lib/puppet/parser/functions/hiera.rb +1 -1
- data/lib/puppet/parser/functions/hiera_array.rb +1 -1
- data/lib/puppet/parser/functions/hiera_hash.rb +1 -1
- data/lib/puppet/parser/functions/hiera_include.rb +1 -1
- data/lib/puppet/parser/functions/include.rb +1 -1
- data/lib/puppet/parser/functions/inline_template.rb +1 -1
- data/lib/puppet/parser/functions/md5.rb +1 -1
- data/lib/puppet/parser/functions/realize.rb +1 -1
- data/lib/puppet/parser/functions/regsubst.rb +54 -57
- data/lib/puppet/parser/functions/require.rb +1 -0
- data/lib/puppet/parser/functions/search.rb +1 -1
- data/lib/puppet/parser/functions/sha1.rb +1 -1
- data/lib/puppet/parser/functions/shellquote.rb +1 -1
- data/lib/puppet/parser/functions/split.rb +1 -2
- data/lib/puppet/parser/functions/sprintf.rb +7 -10
- data/lib/puppet/parser/functions/tag.rb +1 -1
- data/lib/puppet/parser/functions/tagged.rb +1 -1
- data/lib/puppet/parser/functions/template.rb +1 -1
- data/lib/puppet/parser/functions/versioncmp.rb +1 -5
- data/lib/puppet/parser/parser_support.rb +11 -27
- data/lib/puppet/parser/scope.rb +48 -4
- data/lib/puppet/parser/type_loader.rb +31 -7
- data/lib/puppet/property.rb +304 -70
- data/lib/puppet/property/ensure.rb +14 -1
- data/lib/puppet/property/keyvalue.rb +17 -8
- data/lib/puppet/property/list.rb +3 -0
- data/lib/puppet/property/ordered_list.rb +7 -0
- data/lib/puppet/provider.rb +275 -53
- data/lib/puppet/provider/augeas/augeas.rb +17 -3
- data/lib/puppet/provider/confiner.rb +30 -1
- data/lib/puppet/provider/group/pw.rb +2 -2
- data/lib/puppet/provider/package/pip.rb +0 -1
- data/lib/puppet/provider/package/pkgin.rb +2 -0
- data/lib/puppet/provider/service/bsd.rb +1 -1
- data/lib/puppet/provider/service/freebsd.rb +10 -6
- data/lib/puppet/provider/service/init.rb +1 -1
- data/lib/puppet/provider/service/service.rb +1 -1
- data/lib/puppet/provider/user/pw.rb +2 -2
- data/lib/puppet/provider/user/useradd.rb +2 -3
- data/lib/puppet/reference/configuration.rb +6 -0
- data/lib/puppet/reports.rb +44 -4
- data/lib/puppet/reports/tagmail.rb +1 -1
- data/lib/puppet/resource.rb +38 -25
- data/lib/puppet/resource/type.rb +14 -6
- data/lib/puppet/settings.rb +66 -142
- data/lib/puppet/settings/config_file.rb +99 -0
- data/lib/puppet/settings/file_setting.rb +92 -24
- data/lib/puppet/settings/value_translator.rb +15 -0
- data/lib/puppet/ssl/certificate_authority/interface.rb +2 -2
- data/lib/puppet/test/test_helper.rb +8 -3
- data/lib/puppet/transaction.rb +1 -2
- data/lib/puppet/transaction/report.rb +122 -13
- data/lib/puppet/type.rb +763 -150
- data/lib/puppet/type/augeas.rb +4 -0
- data/lib/puppet/type/file/ensure.rb +1 -1
- data/lib/puppet/type/file/group.rb +1 -1
- data/lib/puppet/type/file/mode.rb +2 -0
- data/lib/puppet/type/file/selcontext.rb +1 -0
- data/lib/puppet/type/group.rb +12 -0
- data/lib/puppet/type/mount.rb +2 -2
- data/lib/puppet/type/notify.rb +1 -1
- data/lib/puppet/type/router.rb +1 -1
- data/lib/puppet/type/service.rb +1 -0
- data/lib/puppet/type/ssh_authorized_key.rb +3 -1
- data/lib/puppet/type/user.rb +8 -1
- data/lib/puppet/util.rb +8 -0
- data/lib/puppet/util/autoload.rb +7 -10
- data/lib/puppet/util/classgen.rb +58 -33
- data/lib/puppet/util/command_line.rb +120 -77
- data/lib/puppet/util/constant_inflector.rb +2 -0
- data/lib/puppet/util/execution.rb +63 -33
- data/lib/puppet/util/filetype.rb +1 -1
- data/lib/puppet/util/manifest_filetype_helper.rb +22 -0
- data/lib/puppet/util/methodhelper.rb +19 -0
- data/lib/puppet/util/monkey_patches.rb +46 -0
- data/lib/puppet/util/plugins.rb +2 -2
- data/lib/puppet/util/provider_features.rb +24 -8
- data/lib/puppet/util/rubygems.rb +8 -1
- data/lib/puppet/util/zaml.rb +1 -1
- data/lib/puppet/version.rb +74 -3
- data/spec/integration/application/apply_spec.rb +1 -1
- data/spec/integration/defaults_spec.rb +1 -0
- data/spec/integration/dsl/classes_spec.rb +191 -0
- data/spec/integration/dsl/defaults_spec.rb +38 -0
- data/spec/integration/dsl/definitions_spec.rb +73 -0
- data/spec/integration/dsl/functions_spec.rb +95 -0
- data/spec/integration/dsl/nodes_spec.rb +96 -0
- data/spec/integration/dsl/params_spec.rb +146 -0
- data/spec/integration/dsl/relationships_spec.rb +46 -0
- data/spec/integration/dsl/resources_spec.rb +202 -0
- data/spec/integration/dsl/type_loading_spec.rb +64 -0
- data/spec/integration/indirector/catalog/queue_spec.rb +1 -1
- data/spec/integration/network/formats_spec.rb +32 -45
- data/spec/integration/parser/collector_spec.rb +105 -25
- data/spec/integration/parser/scope_spec.rb +64 -1
- data/spec/integration/resource/catalog_spec.rb +2 -4
- data/spec/integration/type/package_spec.rb +1 -1
- data/spec/lib/matchers/catalog.rb +50 -0
- data/spec/lib/puppet_spec/compiler.rb +11 -0
- data/spec/lib/puppet_spec/dsl.rb +29 -0
- data/spec/spec_helper.rb +17 -3
- data/spec/unit/application/agent_spec.rb +0 -1
- data/spec/unit/application/apply_spec.rb +1 -1
- data/spec/unit/application/face_base_spec.rb +11 -4
- data/spec/unit/application/indirection_base_spec.rb +4 -8
- data/spec/unit/application/kick_spec.rb +5 -2
- data/spec/unit/application/master_spec.rb +0 -6
- data/spec/unit/application_spec.rb +38 -14
- data/spec/unit/dsl/actions_spec.rb +402 -0
- data/spec/unit/dsl/blank_slate_spec.rb +27 -0
- data/spec/unit/dsl/context_spec.rb +678 -0
- data/spec/unit/dsl/parser_spec.rb +56 -0
- data/spec/unit/dsl/resource_decorator_spec.rb +94 -0
- data/spec/unit/dsl/resource_reference_spec.rb +150 -0
- data/spec/unit/dsl/type_reference_spec.rb +164 -0
- data/spec/unit/face/help_spec.rb +5 -7
- data/spec/unit/indirector/certificate_request/rest_spec.rb +4 -0
- data/spec/unit/indirector/certificate_revocation_list/rest_spec.rb +4 -0
- data/spec/unit/indirector/certificate_status/rest_spec.rb +4 -0
- data/spec/unit/indirector/file_metadata/rest_spec.rb +5 -0
- data/spec/unit/indirector/hiera_spec.rb +3 -1
- data/spec/unit/indirector/queue_spec.rb +1 -7
- data/spec/unit/indirector/ssl_file_spec.rb +66 -39
- data/spec/unit/module_spec.rb +1 -1
- data/spec/unit/network/authstore_spec.rb +22 -1
- data/spec/unit/network/formats_spec.rb +1 -1
- data/spec/unit/node/environment_spec.rb +13 -0
- data/spec/unit/parser/collector_spec.rb +1 -1
- data/spec/unit/parser/compiler_spec.rb +26 -0
- data/spec/unit/parser/functions/create_resources_spec.rb +12 -1
- data/spec/unit/parser/functions/extlookup_spec.rb +4 -4
- data/spec/unit/parser/functions/hiera_array_spec.rb +1 -1
- data/spec/unit/parser/functions/hiera_hash_spec.rb +1 -1
- data/spec/unit/parser/functions/hiera_include_spec.rb +1 -1
- data/spec/unit/parser/functions/hiera_spec.rb +1 -1
- data/spec/unit/parser/functions/regsubst_spec.rb +4 -4
- data/spec/unit/parser/functions/split_spec.rb +4 -4
- data/spec/unit/parser/functions/sprintf_spec.rb +2 -2
- data/spec/unit/parser/functions/versioncmp_spec.rb +4 -4
- data/spec/unit/parser/functions_spec.rb +51 -1
- data/spec/unit/parser/parser_spec.rb +0 -14
- data/spec/unit/parser/type_loader_spec.rb +15 -1
- data/spec/unit/provider/augeas/augeas_spec.rb +31 -0
- data/spec/unit/provider/package/apt_spec.rb +0 -2
- data/spec/unit/provider/package/pip_spec.rb +12 -2
- data/spec/unit/provider/service/freebsd_spec.rb +8 -0
- data/spec/unit/provider/service/gentoo_spec.rb +20 -20
- data/spec/unit/provider/service/openrc_spec.rb +20 -20
- data/spec/unit/provider/service/src_spec.rb +4 -4
- data/spec/unit/provider/service/systemd_spec.rb +0 -8
- data/spec/unit/provider/service/windows_spec.rb +1 -1
- data/spec/unit/provider/user/useradd_spec.rb +2 -9
- data/spec/unit/relationship_spec.rb +2 -2
- data/spec/unit/resource/catalog_spec.rb +2 -2
- data/spec/unit/resource/type_spec.rb +49 -25
- data/spec/unit/resource_spec.rb +34 -2
- data/spec/unit/settings/config_file_spec.rb +100 -0
- data/spec/unit/settings/file_setting_spec.rb +87 -84
- data/spec/unit/settings/value_translator_spec.rb +77 -0
- data/spec/unit/settings_spec.rb +96 -29
- data/spec/unit/type/file/ensure_spec.rb +75 -36
- data/spec/unit/type/file_spec.rb +0 -68
- data/spec/unit/type/group_spec.rb +10 -0
- data/spec/unit/util/autoload_spec.rb +6 -0
- data/spec/unit/util/command_line_spec.rb +54 -62
- data/spec/unit/util/manifest_filetype_helper_spec.rb +29 -0
- data/spec/unit/util/metric_spec.rb +0 -9
- data/spec/unit/util/posix_spec.rb +0 -4
- data/spec/unit/util/rdoc_spec.rb +0 -12
- data/spec/unit/util/zaml_spec.rb +188 -130
- data/spec/unit/version_spec.rb +42 -0
- metadata +123 -90
- data/README_HIERA.md +0 -148
- data/conf/epm.list +0 -8
- data/conf/namespaceauth.conf +0 -20
- data/conf/puppet-queue.conf +0 -10
- data/examples/allatonce +0 -13
- data/examples/assignments +0 -11
- data/examples/components +0 -73
- data/examples/etc/init.d/sleeper +0 -70
- data/examples/etc/otherfile +0 -0
- data/examples/etc/puppet/fileserver.conf +0 -13
- data/examples/etc/puppet/namespaceauth.conf +0 -20
- data/examples/etc/puppet/puppet.conf +0 -10
- data/examples/etc/puppet/tagmail.conf +0 -1
- data/examples/execs +0 -16
- data/examples/file.bl +0 -11
- data/examples/filedefaults +0 -10
- data/examples/fileparsing +0 -116
- data/examples/filerecursion +0 -15
- data/examples/functions +0 -3
- data/examples/groups +0 -7
- data/examples/head +0 -30
- data/examples/importing +0 -8
- data/examples/mac_dscl.pp +0 -28
- data/examples/mac_dscl_revert.pp +0 -26
- data/examples/mac_pkgdmg.pp +0 -7
- data/examples/modules/sample_module.pp +0 -10
- data/examples/modules/sample_module/lib/puppet/parser/functions/hostname_to_dn.rb +0 -36
- data/examples/modules/sample_module/manifests/init.pp +0 -12
- data/examples/modules/sample_module/templates/sample.erb +0 -5
- data/examples/nodes +0 -20
- data/examples/one +0 -8
- data/examples/relationships +0 -34
- data/examples/selectors +0 -28
- data/examples/simpletests +0 -11
- data/examples/svncommit +0 -13
- data/lib/puppet/dsl/resource_api.rb +0 -120
- data/lib/puppet/dsl/resource_type_api.rb +0 -34
- data/spec/integration/parser/ruby_manifest_spec.rb +0 -127
- data/spec/unit/dsl/resource_api_spec.rb +0 -180
- data/spec/unit/dsl/resource_type_api_spec.rb +0 -53
@@ -35,12 +35,12 @@ describe provider_class do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
it "should execute the startsrc command" do
|
38
|
-
@provider.expects(:execute).with(['/usr/bin/startsrc', '-s', "myservice"], {:squelch => true, :failonfail => true})
|
38
|
+
@provider.expects(:execute).with(['/usr/bin/startsrc', '-s', "myservice"], {:override_locale => false, :squelch => true, :failonfail => true})
|
39
39
|
@provider.start
|
40
40
|
end
|
41
41
|
|
42
42
|
it "should execute the stopsrc command" do
|
43
|
-
@provider.expects(:execute).with(['/usr/bin/stopsrc', '-s', "myservice"], {:squelch => true, :failonfail => true})
|
43
|
+
@provider.expects(:execute).with(['/usr/bin/stopsrc', '-s', "myservice"], {:override_locale => false, :squelch => true, :failonfail => true})
|
44
44
|
@provider.stop
|
45
45
|
end
|
46
46
|
|
@@ -90,8 +90,8 @@ _EOF_
|
|
90
90
|
myservice::--no-daemonize:/usr/sbin/puppetd:0:0:/dev/null:/var/log/puppet.log:/var/log/puppet.log:-O:-Q:-S:0:0:20:15:9:-d:20::"
|
91
91
|
_EOF_
|
92
92
|
@provider.expects(:execute).with(['/usr/bin/lssrc', '-Ss', "myservice"]).returns sample_output
|
93
|
-
@provider.expects(:execute).with(['/usr/bin/stopsrc', '-s', "myservice"], {:squelch => true, :failonfail => true})
|
94
|
-
@provider.expects(:execute).with(['/usr/bin/startsrc', '-s', "myservice"], {:squelch => true, :failonfail => true})
|
93
|
+
@provider.expects(:execute).with(['/usr/bin/stopsrc', '-s', "myservice"], {:override_locale => false, :squelch => true, :failonfail => true})
|
94
|
+
@provider.expects(:execute).with(['/usr/bin/startsrc', '-s', "myservice"], {:override_locale => false, :squelch => true, :failonfail => true})
|
95
95
|
@provider.restart
|
96
96
|
end
|
97
97
|
end
|
@@ -17,14 +17,6 @@ describe provider_class do
|
|
17
17
|
@provider.resource = @resource
|
18
18
|
end
|
19
19
|
|
20
|
-
osfamily = [ 'redhat', 'suse' ]
|
21
|
-
|
22
|
-
osfamily.each do |osfamily|
|
23
|
-
it "should be the default provider on #{osfamily}" do
|
24
|
-
pending "This test is pending the change in RedHat-related Linuxes to systemd for service management"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
20
|
[:enabled?, :enable, :disable, :start, :stop, :status, :restart].each do |method|
|
29
21
|
it "should have a #{method} method" do
|
30
22
|
@provider.should respond_to(method)
|
@@ -119,7 +119,7 @@ describe Puppet::Type.type(:service).provider(:windows), :if => Puppet.features.
|
|
119
119
|
resource[:restart] = 'c:/bin/foo'
|
120
120
|
|
121
121
|
provider.expects(:execute).never
|
122
|
-
provider.expects(:execute).with(['c:/bin/foo'], :failonfail => true, :squelch => true)
|
122
|
+
provider.expects(:execute).with(['c:/bin/foo'], :failonfail => true, :override_locale => false, :squelch => true)
|
123
123
|
|
124
124
|
provider.restart
|
125
125
|
end
|
@@ -126,25 +126,18 @@ describe Puppet::Type.type(:user).provider(:useradd) do
|
|
126
126
|
end
|
127
127
|
|
128
128
|
it "should return an array with -M if home is not managed and on Redhat" do
|
129
|
-
Facter.stubs(:value).with(:
|
129
|
+
Facter.stubs(:value).with(:osfamily).returns("RedHat")
|
130
130
|
resource[:managehome] = :false
|
131
131
|
provider.check_manage_home.must == ["-M"]
|
132
132
|
end
|
133
133
|
|
134
134
|
it "should return an empty array if home is not managed and not on Redhat" do
|
135
|
-
Facter.stubs(:value).with(:
|
135
|
+
Facter.stubs(:value).with(:osfamily).returns("not RedHat")
|
136
136
|
resource[:managehome] = :false
|
137
137
|
provider.check_manage_home.must == []
|
138
138
|
end
|
139
139
|
end
|
140
140
|
|
141
|
-
describe "when adding properties" do
|
142
|
-
it "should get the valid properties"
|
143
|
-
it "should not add the ensure property"
|
144
|
-
it "should add the flag and value to an array"
|
145
|
-
it "should return and array of flags and values"
|
146
|
-
end
|
147
|
-
|
148
141
|
describe "#addcmd" do
|
149
142
|
before do
|
150
143
|
resource[:allowdupe] = :true
|
@@ -151,7 +151,7 @@ describe Puppet::Relationship, " when matching edges with a non-standard event"
|
|
151
151
|
end
|
152
152
|
end
|
153
153
|
|
154
|
-
describe Puppet::Relationship, "when converting to pson"
|
154
|
+
describe Puppet::Relationship, "when converting to pson" do
|
155
155
|
before do
|
156
156
|
@edge = Puppet::Relationship.new(:a, :b, :event => :random, :callback => :whatever)
|
157
157
|
end
|
@@ -184,7 +184,7 @@ describe Puppet::Relationship, "when converting to pson", :if => Puppet.features
|
|
184
184
|
end
|
185
185
|
end
|
186
186
|
|
187
|
-
describe Puppet::Relationship, "when converting from pson"
|
187
|
+
describe Puppet::Relationship, "when converting from pson" do
|
188
188
|
before do
|
189
189
|
@event = "random"
|
190
190
|
@callback = "whatever"
|
@@ -775,7 +775,7 @@ describe Puppet::Resource::Catalog, "when compiling" do
|
|
775
775
|
end
|
776
776
|
end
|
777
777
|
|
778
|
-
describe Puppet::Resource::Catalog, "when converting to pson"
|
778
|
+
describe Puppet::Resource::Catalog, "when converting to pson" do
|
779
779
|
before do
|
780
780
|
@catalog = Puppet::Resource::Catalog.new("myhost")
|
781
781
|
end
|
@@ -833,7 +833,7 @@ describe Puppet::Resource::Catalog, "when converting to pson", :if => Puppet.fea
|
|
833
833
|
end
|
834
834
|
end
|
835
835
|
|
836
|
-
describe Puppet::Resource::Catalog, "when converting from pson"
|
836
|
+
describe Puppet::Resource::Catalog, "when converting from pson" do
|
837
837
|
def pson_result_should
|
838
838
|
Puppet::Resource::Catalog.expects(:new).with { |hash| yield hash }
|
839
839
|
end
|
@@ -8,7 +8,7 @@ describe Puppet::Resource::Type do
|
|
8
8
|
Puppet::Resource::Type.new(:hostclass, "foo").name.should == "foo"
|
9
9
|
end
|
10
10
|
|
11
|
-
[:code, :doc, :line, :file, :resource_type_collection
|
11
|
+
[:code, :doc, :line, :file, :resource_type_collection].each do |attr|
|
12
12
|
it "should have a '#{attr}' attribute" do
|
13
13
|
type = Puppet::Resource::Type.new(:hostclass, "foo")
|
14
14
|
type.send(attr.to_s + "=", "yay")
|
@@ -16,6 +16,22 @@ describe Puppet::Resource::Type do
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
+
it "returns array when calling ruby_code" do
|
20
|
+
Puppet::Resource::Type.new(:hostclass, "foo").ruby_code.should be_an Array
|
21
|
+
end
|
22
|
+
|
23
|
+
it "assignment operator should append to ruby_code" do
|
24
|
+
type = Puppet::Resource::Type.new :hostclass, 'foo'
|
25
|
+
type.ruby_code << "code"
|
26
|
+
type.ruby_code << "more code"
|
27
|
+
type.ruby_code.should == ["code", "more code"]
|
28
|
+
end
|
29
|
+
|
30
|
+
it "has ruby_code attribute" do
|
31
|
+
type = Puppet::Resource::Type.new(:hostclass, "foo")
|
32
|
+
type.ruby_code.should == []
|
33
|
+
end
|
34
|
+
|
19
35
|
[:hostclass, :node, :definition].each do |type|
|
20
36
|
it "should know when it is a #{type}" do
|
21
37
|
Puppet::Resource::Type.new(type, "foo").send("#{type}?").should be_true
|
@@ -150,24 +166,6 @@ describe Puppet::Resource::Type do
|
|
150
166
|
Puppet::Resource::Type.new(:node, "fOo").match("foO").should be_true
|
151
167
|
end
|
152
168
|
end
|
153
|
-
|
154
|
-
it "should return the name converted to a string when the name is not a regex" do
|
155
|
-
pending "Need to define LoadedCode behaviour first"
|
156
|
-
name = Puppet::Parser::AST::HostName.new(:value => "foo")
|
157
|
-
Puppet::Resource::Type.new(:node, name).name.should == "foo"
|
158
|
-
end
|
159
|
-
|
160
|
-
it "should return the name converted to a string when the name is a regex" do
|
161
|
-
pending "Need to define LoadedCode behaviour first"
|
162
|
-
name = Puppet::Parser::AST::HostName.new(:value => /regex/)
|
163
|
-
Puppet::Resource::Type.new(:node, name).name.should == /regex/.to_s
|
164
|
-
end
|
165
|
-
|
166
|
-
it "should mark any created scopes as a node scope" do
|
167
|
-
pending "Need to define LoadedCode behaviour first"
|
168
|
-
name = Puppet::Parser::AST::HostName.new(:value => /regex/)
|
169
|
-
Puppet::Resource::Type.new(:node, name).name.should == /regex/.to_s
|
170
|
-
end
|
171
169
|
end
|
172
170
|
|
173
171
|
describe "when initializing" do
|
@@ -469,12 +467,10 @@ describe Puppet::Resource::Type do
|
|
469
467
|
end
|
470
468
|
|
471
469
|
describe "and ruby code is provided" do
|
472
|
-
it "should
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
@api.expects(:evaluate)
|
477
|
-
|
470
|
+
it "should evaluate ruby code" do
|
471
|
+
code = stub 'code'
|
472
|
+
code.expects(:evaluate).with {|scope, type_collection| scope.is_a? Puppet::Parser::Scope and type_collection.is_a? Puppet::Resource::TypeCollection }
|
473
|
+
@type.stubs(:ruby_code).returns(Array(code))
|
478
474
|
@type.evaluate_code(@resource)
|
479
475
|
end
|
480
476
|
end
|
@@ -733,6 +729,34 @@ describe Puppet::Resource::Type do
|
|
733
729
|
dest.doc.should == "foonessyayness"
|
734
730
|
end
|
735
731
|
|
732
|
+
it "copies other's ruby code if it has no ruby code" do
|
733
|
+
dest = Puppet::Resource::Type.new :hostclass, "bar"
|
734
|
+
source = Puppet::Resource::Type.new :hostclass, "foo"
|
735
|
+
source.ruby_code << "bar"
|
736
|
+
|
737
|
+
dest.merge source
|
738
|
+
dest.ruby_code.should == ["bar"]
|
739
|
+
end
|
740
|
+
|
741
|
+
it "appends other's ruby code if it has ruby code" do
|
742
|
+
dest = Puppet::Resource::Type.new :hostclass, "bar"
|
743
|
+
source = Puppet::Resource::Type.new :hostclass, "foo"
|
744
|
+
dest.ruby_code << "foo"
|
745
|
+
source.ruby_code << "bar"
|
746
|
+
|
747
|
+
dest.merge source
|
748
|
+
dest.ruby_code.should == ["foo", "bar"]
|
749
|
+
end
|
750
|
+
|
751
|
+
it "returns own ruby code if the other has no ruby code" do
|
752
|
+
dest = Puppet::Resource::Type.new :hostclass, "bar", :ruby_code => "foo"
|
753
|
+
source = Puppet::Resource::Type.new :hostclass, "foo"
|
754
|
+
dest.ruby_code << "foo"
|
755
|
+
|
756
|
+
dest.merge source
|
757
|
+
dest.ruby_code.should == ["foo"]
|
758
|
+
end
|
759
|
+
|
736
760
|
it "should turn its code into an ASTArray if necessary" do
|
737
761
|
dest = Puppet::Resource::Type.new(:hostclass, "bar", :code => code("foo"))
|
738
762
|
source = Puppet::Resource::Type.new(:hostclass, "foo", :code => code("bar"))
|
data/spec/unit/resource_spec.rb
CHANGED
@@ -15,6 +15,7 @@ describe Puppet::Resource do
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
+
|
18
19
|
it "should have a :title attribute" do
|
19
20
|
Puppet::Resource.new(:user, "foo").title.should == "foo"
|
20
21
|
end
|
@@ -305,6 +306,33 @@ describe Puppet::Resource do
|
|
305
306
|
resource.set_default_parameters(@scope).should == ["a"]
|
306
307
|
end
|
307
308
|
|
309
|
+
it "doesn't call safeevaluate on default value when it doesn't respond to safeevaluate" do
|
310
|
+
Puppet[:manifest] = "test.rb"
|
311
|
+
value = mock
|
312
|
+
value.stubs(:respond_to?).with(:safeevaluate).returns false
|
313
|
+
value.expects(:safeevaluate).never
|
314
|
+
Puppet::Node::Environment.new.known_resource_types.add(
|
315
|
+
Puppet::Resource::Type.new :definition, "default_param", :arguments => {"a" => value}
|
316
|
+
)
|
317
|
+
|
318
|
+
resource = Puppet::Parser::Resource.new "default_param", "name", :scope => Puppet::Parser::Scope.new(Puppet::Parser::Compiler.new(Puppet::Node.new("foo")))
|
319
|
+
resource.set_default_parameters @scope
|
320
|
+
end
|
321
|
+
|
322
|
+
|
323
|
+
it "calls safeevaluate on default when it responds to safeevaluate" do
|
324
|
+
value = mock
|
325
|
+
value.expects(:safeevaluate).returns 42
|
326
|
+
Puppet::Node::Environment.new.known_resource_types.add(
|
327
|
+
Puppet::Resource::Type.new :definition, "default_param", :arguments => {"a" => value}
|
328
|
+
)
|
329
|
+
|
330
|
+
resource = Puppet::Parser::Resource.new "default_param", "name", :scope => Puppet::Parser::Scope.new(Puppet::Parser::Compiler.new(Puppet::Node.new("foo")))
|
331
|
+
resource.set_default_parameters @scope
|
332
|
+
end
|
333
|
+
|
334
|
+
|
335
|
+
|
308
336
|
describe "when the resource type is :hostclass" do
|
309
337
|
let(:environment_name) { "testing env" }
|
310
338
|
let(:fact_values) { { :a => 1 } }
|
@@ -647,7 +675,7 @@ type: File
|
|
647
675
|
end
|
648
676
|
end
|
649
677
|
|
650
|
-
describe "when converting to pson"
|
678
|
+
describe "when converting to pson" do
|
651
679
|
def pson_output_should
|
652
680
|
@resource.class.expects(:pson_create).with { |hash| yield hash }
|
653
681
|
end
|
@@ -726,7 +754,7 @@ type: File
|
|
726
754
|
end
|
727
755
|
end
|
728
756
|
|
729
|
-
describe "when converting from pson"
|
757
|
+
describe "when converting from pson" do
|
730
758
|
def pson_result_should
|
731
759
|
Puppet::Resource.expects(:new).with { |hash| yield hash }
|
732
760
|
end
|
@@ -965,4 +993,8 @@ type: File
|
|
965
993
|
})
|
966
994
|
end
|
967
995
|
end
|
996
|
+
|
997
|
+
it "should be able to return canonical type name" do
|
998
|
+
Puppet::Resource.canonicalize_type("foo").should == "Foo"
|
999
|
+
end
|
968
1000
|
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
#! /usr/bin/env ruby -S rspec
|
2
|
+
require 'spec_helper'
|
3
|
+
require 'puppet/settings/config_file'
|
4
|
+
|
5
|
+
describe Puppet::Settings::ConfigFile do
|
6
|
+
NOTHING = {}
|
7
|
+
|
8
|
+
def section_containing(data)
|
9
|
+
meta = data[:meta] || {}
|
10
|
+
values = data.reject { |key, _| key == :meta }
|
11
|
+
values.merge({ :_meta => Hash[values.keys.collect { |key| [key, meta[key] || {}] }] })
|
12
|
+
end
|
13
|
+
|
14
|
+
def the_parse_of(*lines)
|
15
|
+
config.parse_file(filename, lines.join("\n"))
|
16
|
+
end
|
17
|
+
|
18
|
+
let(:identity_transformer) { Proc.new { |value| value } }
|
19
|
+
let(:config) { Puppet::Settings::ConfigFile.new(identity_transformer) }
|
20
|
+
|
21
|
+
let(:filename) { "a/fake/filename.conf" }
|
22
|
+
|
23
|
+
it "interprets an empty file to contain a main section with no entries" do
|
24
|
+
the_parse_of("").should == { :main => section_containing(NOTHING) }
|
25
|
+
end
|
26
|
+
|
27
|
+
it "interprets an empty main section the same as an empty file" do
|
28
|
+
the_parse_of("").should == config.parse_file(filename, "[main]")
|
29
|
+
end
|
30
|
+
|
31
|
+
it "places an entry in no section in main" do
|
32
|
+
the_parse_of("var = value").should == { :main => section_containing(:var => "value") }
|
33
|
+
end
|
34
|
+
|
35
|
+
it "places an entry after a section header in that section" do
|
36
|
+
the_parse_of("[section]", "var = value").should == { :main => section_containing(NOTHING),
|
37
|
+
:section => section_containing(:var => "value") }
|
38
|
+
end
|
39
|
+
|
40
|
+
it "does not include trailing whitespace in the value" do
|
41
|
+
the_parse_of("var = value\t ").should == { :main => section_containing(:var => "value") }
|
42
|
+
end
|
43
|
+
|
44
|
+
it "does not include leading whitespace in the name" do
|
45
|
+
the_parse_of(" \t var=value").should == { :main => section_containing(:var => "value") }
|
46
|
+
end
|
47
|
+
|
48
|
+
it "skips lines that are commented out" do
|
49
|
+
the_parse_of("#var = value").should == { :main => section_containing(NOTHING) }
|
50
|
+
end
|
51
|
+
|
52
|
+
it "skips lines that are entirely whitespace" do
|
53
|
+
the_parse_of(" \t ").should == { :main => section_containing(NOTHING) }
|
54
|
+
end
|
55
|
+
|
56
|
+
it "errors when a line is not a known form" do
|
57
|
+
expect { the_parse_of("unknown") }.to raise_error Puppet::Settings::ParseError, /Could not match line/
|
58
|
+
end
|
59
|
+
|
60
|
+
it "stores file meta information in the _meta section" do
|
61
|
+
the_parse_of("var = value { owner = me, group = you, mode = 0666 }").should ==
|
62
|
+
{ :main => section_containing(:var => "value", :meta => { :var => { :owner => "me",
|
63
|
+
:group => "you",
|
64
|
+
:mode => "0666" } }) }
|
65
|
+
end
|
66
|
+
|
67
|
+
it "errors when there is unknown meta information" do
|
68
|
+
expect { the_parse_of("var = value { unknown = no }") }.
|
69
|
+
to raise_error ArgumentError, /Invalid file option 'unknown'/
|
70
|
+
end
|
71
|
+
|
72
|
+
it "errors when the mode is not numeric" do
|
73
|
+
expect { the_parse_of("var = value { mode = no }") }.
|
74
|
+
to raise_error ArgumentError, "File modes must be numbers"
|
75
|
+
end
|
76
|
+
|
77
|
+
it "errors when the options are not key-value pairs" do
|
78
|
+
expect { the_parse_of("var = value { mode }") }.
|
79
|
+
to raise_error ArgumentError, "Could not parse 'value { mode }'"
|
80
|
+
end
|
81
|
+
|
82
|
+
it "errors when an application_defaults section is created" do
|
83
|
+
expect { the_parse_of("[application_defaults]") }.
|
84
|
+
to raise_error Puppet::Error,
|
85
|
+
"Illegal section 'application_defaults' in config file #{filename} at line [application_defaults]"
|
86
|
+
end
|
87
|
+
|
88
|
+
it "transforms values with the given function" do
|
89
|
+
config = Puppet::Settings::ConfigFile.new(Proc.new { |value| value + " changed" })
|
90
|
+
|
91
|
+
config.parse_file(filename, "var = value").should == { :main => section_containing(:var => "value changed") }
|
92
|
+
end
|
93
|
+
|
94
|
+
it "does not try to transform an entry named 'mode'" do
|
95
|
+
config = Puppet::Settings::ConfigFile.new(Proc.new { raise "Should not transform" })
|
96
|
+
|
97
|
+
config.parse_file(filename, "mode = value").should == { :main => section_containing(:mode => "value") }
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
@@ -9,111 +9,113 @@ describe Puppet::Settings::FileSetting do
|
|
9
9
|
|
10
10
|
include PuppetSpec::Files
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
describe "when controlling permissions" do
|
13
|
+
def settings(wanted_values = {})
|
14
|
+
real_values = {
|
15
|
+
:user => 'root',
|
16
|
+
:group => 'root',
|
17
|
+
:mkusers => false,
|
18
|
+
:service_user_available? => false,
|
19
|
+
:service_group_available? => false
|
20
|
+
}.merge(wanted_values)
|
15
21
|
|
16
|
-
|
17
|
-
before do
|
18
|
-
@settings = mock 'settings'
|
19
|
-
@settings.stubs(:[]).with(:mkusers).returns false
|
20
|
-
@settings.stubs(:service_user_available?).returns true
|
21
|
-
end
|
22
|
+
settings = mock("settings")
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
settings.stubs(:[]).with(:user).returns real_values[:user]
|
25
|
+
settings.stubs(:[]).with(:group).returns real_values[:group]
|
26
|
+
settings.stubs(:[]).with(:mkusers).returns real_values[:mkusers]
|
27
|
+
settings.stubs(:service_user_available?).returns real_values[:service_user_available?]
|
28
|
+
settings.stubs(:service_group_available?).returns real_values[:service_group_available?]
|
28
29
|
|
29
|
-
|
30
|
-
@settings.expects(:[]).with(:mkusers).returns true
|
31
|
-
setting = FileSetting.new(:settings => @settings, :owner => "root", :desc => "a setting")
|
32
|
-
setting.should be_use_service_user
|
30
|
+
settings
|
33
31
|
end
|
34
32
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
end
|
39
|
-
end
|
33
|
+
context "owner" do
|
34
|
+
it "can always be root" do
|
35
|
+
settings = settings(:user => "the_service", :mkusers => true)
|
40
36
|
|
41
|
-
|
42
|
-
it "should allow the file to be owned by root" do
|
43
|
-
root_owner = lambda { FileSetting.new(:settings => mock("settings"), :owner => "root", :desc => "a setting") }
|
44
|
-
root_owner.should_not raise_error
|
45
|
-
end
|
37
|
+
setting = FileSetting.new(:settings => settings, :owner => "root", :desc => "a setting")
|
46
38
|
|
47
|
-
|
48
|
-
|
49
|
-
service_owner.should_not raise_error
|
50
|
-
end
|
39
|
+
setting.owner.should == "root"
|
40
|
+
end
|
51
41
|
|
52
|
-
|
53
|
-
|
54
|
-
no_owner.should_not raise_error
|
55
|
-
end
|
42
|
+
it "is the service user if we are making users" do
|
43
|
+
settings = settings(:user => "the_service", :mkusers => true, :service_user_available? => false)
|
56
44
|
|
57
|
-
|
58
|
-
invalid_owner = lambda { FileSetting.new(:settings => mock("settings"), :owner => "invalid", :desc => "a setting") }
|
59
|
-
invalid_owner.should raise_error(FileSetting::SettingError)
|
60
|
-
end
|
61
|
-
end
|
45
|
+
setting = FileSetting.new(:settings => settings, :owner => "service", :desc => "a setting")
|
62
46
|
|
63
|
-
|
64
|
-
|
65
|
-
setting = FileSetting.new(:settings => mock("settings"), :owner => "root", :desc => "a setting")
|
66
|
-
setting.owner.should == "root"
|
67
|
-
end
|
47
|
+
setting.owner.should == "the_service"
|
48
|
+
end
|
68
49
|
|
69
|
-
|
70
|
-
|
71
|
-
settings.stubs(:[]).returns "the_service"
|
50
|
+
it "is the service user if the user is available on the system" do
|
51
|
+
settings = settings(:user => "the_service", :mkusers => false, :service_user_available? => true)
|
72
52
|
|
73
|
-
|
74
|
-
setting.expects(:use_service_user?).returns true
|
75
|
-
setting.owner.should == "the_service"
|
76
|
-
end
|
53
|
+
setting = FileSetting.new(:settings => settings, :owner => "service", :desc => "a setting")
|
77
54
|
|
78
|
-
|
79
|
-
|
80
|
-
settings.stubs(:[]).returns "the_service"
|
55
|
+
setting.owner.should == "the_service"
|
56
|
+
end
|
81
57
|
|
82
|
-
|
83
|
-
|
84
|
-
setting.owner.should == "root"
|
85
|
-
end
|
58
|
+
it "is root when the setting specifies service and the user is not available on the system" do
|
59
|
+
settings = settings(:user => "the_service", :mkusers => false, :service_user_available? => false)
|
86
60
|
|
87
|
-
|
88
|
-
FileSetting.new(:settings => mock("settings"), :desc => "a setting").owner.should be_nil
|
89
|
-
end
|
90
|
-
end
|
61
|
+
setting = FileSetting.new(:settings => settings, :owner => "service", :desc => "a setting")
|
91
62
|
|
92
|
-
|
93
|
-
|
94
|
-
service_group = lambda { FileSetting.new(:settings => mock("settings"), :group => "service", :desc => "a setting") }
|
95
|
-
service_group.should_not raise_error
|
96
|
-
end
|
63
|
+
setting.owner.should == "root"
|
64
|
+
end
|
97
65
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
end
|
66
|
+
it "is unspecified when no specific owner is wanted" do
|
67
|
+
FileSetting.new(:settings => settings(), :desc => "a setting").owner.should be_nil
|
68
|
+
end
|
102
69
|
|
103
|
-
|
104
|
-
|
105
|
-
|
70
|
+
it "does not allow other owners" do
|
71
|
+
expect { FileSetting.new(:settings => settings(), :desc => "a setting", :name => "testing", :default => "the default", :owner => "invalid") }.
|
72
|
+
to raise_error(FileSetting::SettingError, /The :owner parameter for the setting 'testing' must be either 'root' or 'service'/)
|
73
|
+
end
|
106
74
|
end
|
107
|
-
end
|
108
75
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
76
|
+
context "group" do
|
77
|
+
it "is unspecified when no specific group is wanted" do
|
78
|
+
setting = FileSetting.new(:settings => settings(), :desc => "a setting")
|
79
|
+
|
80
|
+
setting.group.should be_nil
|
81
|
+
end
|
82
|
+
|
83
|
+
it "is root if root is requested" do
|
84
|
+
settings = settings(:group => "the_group")
|
85
|
+
|
86
|
+
setting = FileSetting.new(:settings => settings, :group => "root", :desc => "a setting")
|
87
|
+
|
88
|
+
setting.group.should == "root"
|
89
|
+
end
|
90
|
+
|
91
|
+
it "is the service group if we are making users" do
|
92
|
+
settings = settings(:group => "the_service", :mkusers => true)
|
114
93
|
|
115
|
-
|
116
|
-
|
94
|
+
setting = FileSetting.new(:settings => settings, :group => "service", :desc => "a setting")
|
95
|
+
|
96
|
+
setting.group.should == "the_service"
|
97
|
+
end
|
98
|
+
|
99
|
+
it "is the service user if the group is available on the system" do
|
100
|
+
settings = settings(:group => "the_service", :mkusers => false, :service_group_available? => true)
|
101
|
+
|
102
|
+
setting = FileSetting.new(:settings => settings, :group => "service", :desc => "a setting")
|
103
|
+
|
104
|
+
setting.group.should == "the_service"
|
105
|
+
end
|
106
|
+
|
107
|
+
it "is unspecified when the setting specifies service and the group is not available on the system" do
|
108
|
+
settings = settings(:group => "the_service", :mkusers => false, :service_group_available? => false)
|
109
|
+
|
110
|
+
setting = FileSetting.new(:settings => settings, :group => "service", :desc => "a setting")
|
111
|
+
|
112
|
+
setting.group.should be_nil
|
113
|
+
end
|
114
|
+
|
115
|
+
it "does not allow other groups" do
|
116
|
+
expect { FileSetting.new(:settings => settings(), :group => "invalid", :name => 'testing', :desc => "a setting") }.
|
117
|
+
to raise_error(FileSetting::SettingError, /The :group parameter for the setting 'testing' must be either 'root' or 'service'/)
|
118
|
+
end
|
117
119
|
end
|
118
120
|
end
|
119
121
|
|
@@ -123,6 +125,7 @@ describe Puppet::Settings::FileSetting do
|
|
123
125
|
|
124
126
|
describe "when being converted to a resource" do
|
125
127
|
before do
|
128
|
+
@basepath = make_absolute("/somepath")
|
126
129
|
@settings = mock 'settings'
|
127
130
|
@file = Puppet::Settings::FileSetting.new(:settings => @settings, :desc => "eh", :name => :myfile, :section => "mysect")
|
128
131
|
@file.stubs(:create_files?).returns true
|