puppet 2.7.3 → 2.7.4
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 +166 -0
- data/install.rb +27 -7
- data/lib/puppet/application/agent.rb +29 -29
- data/lib/puppet/application/doc.rb +1 -1
- data/lib/puppet/application/inspect.rb +9 -1
- data/lib/puppet/application/master.rb +2 -0
- data/lib/puppet/application/queue.rb +1 -1
- data/lib/puppet/application/resource.rb +3 -0
- data/lib/puppet/application.rb +4 -5
- data/lib/puppet/configurer.rb +1 -4
- data/lib/puppet/defaults.rb +45 -15
- data/lib/puppet/feature/base.rb +28 -17
- data/lib/puppet/feature/rails.rb +0 -3
- data/lib/puppet/feature/rubygems.rb +0 -3
- data/lib/puppet/file_bucket/dipper.rb +3 -2
- data/lib/puppet/file_bucket/file.rb +3 -3
- data/lib/puppet/file_serving/base.rb +4 -5
- data/lib/puppet/file_serving/configuration.rb +7 -13
- data/lib/puppet/file_serving/content.rb +0 -4
- data/lib/puppet/file_serving/fileset.rb +7 -6
- data/lib/puppet/file_serving/indirection_hooks.rb +1 -4
- data/lib/puppet/file_serving/metadata.rb +0 -4
- data/lib/puppet/file_serving/mount/file.rb +9 -12
- data/lib/puppet/file_serving/mount.rb +0 -5
- data/lib/puppet/file_serving/terminus_helper.rb +0 -4
- data/lib/puppet/file_serving.rb +0 -4
- data/lib/puppet/indirector/catalog/compiler.rb +0 -18
- data/lib/puppet/indirector/catalog/store_configs.rb +5 -0
- data/lib/puppet/indirector/direct_file_server.rb +0 -4
- data/lib/puppet/indirector/facts/facter.rb +2 -2
- data/lib/puppet/indirector/facts/store_configs.rb +5 -0
- data/lib/puppet/indirector/file_content/file.rb +0 -4
- data/lib/puppet/indirector/file_content/file_server.rb +0 -4
- data/lib/puppet/indirector/file_content/rest.rb +0 -4
- data/lib/puppet/indirector/file_metadata/file.rb +0 -4
- data/lib/puppet/indirector/file_metadata/file_server.rb +0 -4
- data/lib/puppet/indirector/file_metadata/rest.rb +0 -4
- data/lib/puppet/indirector/file_server.rb +1 -5
- data/lib/puppet/indirector/indirection.rb +3 -5
- data/lib/puppet/indirector/node/store_configs.rb +5 -0
- data/lib/puppet/indirector/request.rb +3 -1
- data/lib/puppet/indirector/resource/active_record.rb +97 -0
- data/lib/puppet/indirector/resource/store_configs.rb +3 -0
- data/lib/puppet/indirector/ssl_file.rb +5 -1
- data/lib/puppet/indirector/store_configs.rb +30 -0
- data/lib/puppet/indirector/yaml.rb +5 -0
- data/lib/puppet/indirector.rb +7 -0
- data/lib/puppet/network/client.rb +0 -5
- data/lib/puppet/network/http_pool.rb +0 -56
- data/lib/puppet/node/environment.rb +9 -11
- data/lib/puppet/parameter/path.rb +1 -5
- data/lib/puppet/parameter.rb +1 -7
- data/lib/puppet/parser/ast/collection.rb +2 -2
- data/lib/puppet/parser/ast/collexpr.rb +10 -39
- data/lib/puppet/parser/collector.rb +41 -90
- data/lib/puppet/parser/compiler.rb +0 -3
- data/lib/puppet/parser/functions/create_resources.rb +22 -10
- data/lib/puppet/parser/functions/versioncmp.rb +9 -6
- data/lib/puppet/parser/resource.rb +1 -1
- data/lib/puppet/parser/type_loader.rb +2 -1
- data/lib/puppet/provider/augeas/augeas.rb +5 -3
- data/lib/puppet/provider/cron/crontab.rb +2 -2
- data/lib/puppet/provider/exec/posix.rb +23 -96
- data/lib/puppet/provider/exec/shell.rb +11 -2
- data/lib/puppet/provider/exec/windows.rb +35 -0
- data/lib/puppet/provider/exec.rb +79 -0
- data/lib/puppet/provider/group/windows_adsi.rb +48 -0
- data/lib/puppet/provider/host/parsed.rb +3 -0
- data/lib/puppet/provider/macauthorization/macauthorization.rb +4 -4
- data/lib/puppet/provider/mount.rb +0 -3
- data/lib/puppet/provider/naginator.rb +0 -3
- data/lib/puppet/provider/package/appdmg.rb +0 -1
- data/lib/puppet/provider/package/apple.rb +3 -7
- data/lib/puppet/provider/package/apt.rb +0 -1
- data/lib/puppet/provider/package/aptitude.rb +0 -1
- data/lib/puppet/provider/package/aptrpm.rb +0 -1
- data/lib/puppet/provider/package/blastwave.rb +0 -1
- data/lib/puppet/provider/package/dpkg.rb +5 -6
- data/lib/puppet/provider/package/fink.rb +3 -4
- data/lib/puppet/provider/package/freebsd.rb +0 -1
- data/lib/puppet/provider/package/gem.rb +0 -1
- data/lib/puppet/provider/package/hpux.rb +3 -3
- data/lib/puppet/provider/package/macports.rb +0 -1
- data/lib/puppet/provider/package/msi.rb +82 -0
- data/lib/puppet/provider/package/openbsd.rb +18 -19
- data/lib/puppet/provider/package/pip.rb +0 -1
- data/lib/puppet/provider/package/pkg.rb +0 -1
- data/lib/puppet/provider/package/pkgdmg.rb +9 -7
- data/lib/puppet/provider/package/pkgutil.rb +0 -1
- data/lib/puppet/provider/package/ports.rb +0 -1
- data/lib/puppet/provider/package/portupgrade.rb +183 -193
- data/lib/puppet/provider/package/rpm.rb +1 -1
- data/lib/puppet/provider/package/sun.rb +0 -1
- data/lib/puppet/provider/package/sunfreeware.rb +0 -2
- data/lib/puppet/provider/package/up2date.rb +0 -1
- data/lib/puppet/provider/package/urpmi.rb +0 -1
- data/lib/puppet/provider/package/yum.rb +1 -1
- data/lib/puppet/provider/package.rb +4 -3
- data/lib/puppet/provider/service/systemd.rb +64 -0
- data/lib/puppet/provider/service/windows.rb +110 -0
- data/lib/puppet/provider/user/windows_adsi.rb +71 -0
- data/lib/puppet/rails/resource.rb +1 -1
- data/lib/puppet/relationship.rb +0 -3
- data/lib/puppet/reports/tagmail.rb +15 -11
- data/lib/puppet/resource/catalog.rb +17 -24
- data/lib/puppet/ssl/certificate_authority.rb +7 -5
- data/lib/puppet/ssl/host.rb +6 -10
- data/lib/puppet/type/augeas.rb +19 -13
- data/lib/puppet/type/cron.rb +13 -12
- data/lib/puppet/type/exec.rb +17 -17
- data/lib/puppet/type/file/content.rb +7 -3
- data/lib/puppet/type/file/source.rb +14 -9
- data/lib/puppet/type/file.rb +44 -23
- data/lib/puppet/type/filebucket.rb +13 -5
- data/lib/puppet/type/package.rb +14 -1
- data/lib/puppet/type/service.rb +11 -1
- data/lib/puppet/type/ssh_authorized_key.rb +3 -1
- data/lib/puppet/type.rb +8 -17
- data/lib/puppet/util/adsi.rb +278 -0
- data/lib/puppet/util/autoload.rb +0 -2
- data/lib/puppet/util/cacher.rb +15 -67
- data/lib/puppet/util/feature.rb +0 -3
- data/lib/puppet/util/graph.rb +0 -3
- data/lib/puppet/util/ldap/connection.rb +0 -3
- data/lib/puppet/util/ldap/generator.rb +0 -3
- data/lib/puppet/util/ldap.rb +0 -3
- data/lib/puppet/util/log_paths.rb +0 -3
- data/lib/puppet/util/network_device/cisco/device.rb +2 -1
- data/lib/puppet/util/network_device/cisco/facts.rb +1 -1
- data/lib/puppet/util/pidlock.rb +5 -1
- data/lib/puppet/util/rdoc/parser.rb +3 -1
- data/lib/puppet/util/run_mode.rb +2 -2
- data/lib/puppet/util/settings/file_setting.rb +3 -2
- data/lib/puppet/util/settings.rb +4 -6
- data/lib/puppet/util/suidmanager.rb +62 -15
- data/lib/puppet/util.rb +113 -131
- data/lib/puppet.rb +1 -1
- data/spec/integration/application/doc_spec.rb +1 -1
- data/spec/integration/defaults_spec.rb +22 -17
- data/spec/integration/file_serving/content_spec.rb +0 -6
- data/spec/integration/file_serving/metadata_spec.rb +0 -6
- data/spec/integration/file_serving/terminus_helper_spec.rb +1 -1
- data/spec/integration/indirector/direct_file_server_spec.rb +5 -7
- data/spec/integration/indirector/file_content/file_server_spec.rb +2 -6
- data/spec/integration/indirector/file_metadata/file_server_spec.rb +1 -5
- data/spec/integration/network/server/webrick_spec.rb +6 -9
- data/spec/integration/node/facts_spec.rb +0 -6
- data/spec/integration/node_spec.rb +3 -4
- data/spec/integration/parser/compiler_spec.rb +2 -1
- data/spec/integration/parser/parser_spec.rb +2 -4
- data/spec/integration/provider/mount_spec.rb +1 -1
- data/spec/integration/provider/package_spec.rb +13 -3
- data/spec/integration/provider/ssh_authorized_key_spec.rb +4 -4
- data/spec/integration/reports_spec.rb +0 -4
- data/spec/integration/resource/catalog_spec.rb +0 -5
- data/spec/integration/ssl/certificate_authority_spec.rb +6 -14
- data/spec/integration/ssl/certificate_request_spec.rb +10 -17
- data/spec/integration/ssl/certificate_revocation_list_spec.rb +8 -13
- data/spec/integration/ssl/host_spec.rb +8 -14
- data/spec/integration/transaction/report_spec.rb +0 -5
- data/spec/integration/transaction_spec.rb +11 -13
- data/spec/integration/type/file_spec.rb +16 -16
- data/spec/integration/type/tidy_spec.rb +1 -1
- data/spec/integration/util/settings_spec.rb +2 -2
- data/spec/integration/util_spec.rb +13 -0
- data/spec/lib/puppet_spec/files.rb +18 -10
- data/spec/shared_behaviours/file_server_terminus.rb +1 -5
- data/spec/shared_behaviours/file_serving.rb +0 -4
- data/spec/shared_behaviours/memory_terminus.rb +0 -4
- data/spec/shared_behaviours/path_parameters.rb +20 -18
- data/spec/shared_behaviours/store_configs_terminus.rb +21 -0
- data/spec/spec_helper.rb +31 -0
- data/spec/unit/agent_spec.rb +0 -4
- data/spec/unit/application/apply_spec.rb +8 -2
- data/spec/unit/application/certificate_spec.rb +2 -0
- data/spec/unit/application/device_spec.rb +8 -6
- data/spec/unit/application/inspect_spec.rb +2 -1
- data/spec/unit/application/master_spec.rb +7 -2
- data/spec/unit/application/queue_spec.rb +3 -4
- data/spec/unit/application/resource_spec.rb +26 -0
- data/spec/unit/application/secret_agent_spec.rb +3 -1
- data/spec/unit/application_spec.rb +4 -0
- data/spec/unit/configurer/downloader_spec.rb +4 -3
- data/spec/unit/configurer_spec.rb +11 -4
- data/spec/unit/daemon_spec.rb +3 -1
- data/spec/unit/face/ca_spec.rb +1 -1
- data/spec/unit/face/node_spec.rb +5 -1
- data/spec/unit/face/secret_agent_spec.rb +3 -1
- data/spec/unit/file_bucket/dipper_spec.rb +4 -4
- data/spec/unit/file_bucket/file_spec.rb +9 -3
- data/spec/unit/file_serving/configuration_spec.rb +26 -37
- data/spec/unit/file_serving/fileset_spec.rb +71 -55
- data/spec/unit/file_serving/indirection_hooks_spec.rb +0 -4
- data/spec/unit/file_serving/mount/file_spec.rb +163 -169
- data/spec/unit/file_serving/terminus_helper_spec.rb +0 -4
- data/spec/unit/indirector/catalog/compiler_spec.rb +0 -22
- data/spec/unit/indirector/catalog/store_configs_spec.rb +17 -0
- data/spec/unit/indirector/certificate/ca_spec.rb +0 -4
- data/spec/unit/indirector/certificate/file_spec.rb +0 -4
- data/spec/unit/indirector/certificate_request/ca_spec.rb +1 -5
- data/spec/unit/indirector/certificate_request/file_spec.rb +0 -4
- data/spec/unit/indirector/certificate_revocation_list/ca_spec.rb +0 -4
- data/spec/unit/indirector/certificate_revocation_list/file_spec.rb +0 -4
- data/spec/unit/indirector/certificate_status/file_spec.rb +1 -1
- data/spec/unit/indirector/direct_file_server_spec.rb +0 -4
- data/spec/unit/indirector/facts/facter_spec.rb +0 -4
- data/spec/unit/indirector/facts/inventory_active_record_spec.rb +3 -0
- data/spec/unit/indirector/facts/store_configs_spec.rb +17 -0
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +3 -3
- data/spec/unit/indirector/file_content/file_server_spec.rb +0 -4
- data/spec/unit/indirector/file_content/file_spec.rb +0 -4
- data/spec/unit/indirector/file_metadata/file_server_spec.rb +0 -4
- data/spec/unit/indirector/file_metadata/file_spec.rb +0 -4
- data/spec/unit/indirector/file_server_spec.rb +1 -5
- data/spec/unit/indirector/indirection_spec.rb +0 -4
- data/spec/unit/indirector/key/ca_spec.rb +0 -4
- data/spec/unit/indirector/key/file_spec.rb +0 -4
- data/spec/unit/indirector/node/store_configs_spec.rb +16 -0
- data/spec/unit/indirector/report/processor_spec.rb +0 -4
- data/spec/unit/indirector/resource/active_record_spec.rb +192 -0
- data/spec/unit/indirector/resource/ral_spec.rb +1 -1
- data/spec/unit/indirector/resource/store_configs_spec.rb +12 -0
- data/spec/unit/indirector/resource_type/parser_spec.rb +3 -3
- data/spec/unit/indirector/ssl_file_spec.rb +25 -6
- data/spec/unit/indirector/store_configs_spec.rb +8 -0
- data/spec/unit/indirector/yaml_spec.rb +14 -0
- data/spec/unit/module_spec.rb +2 -2
- data/spec/unit/network/handler/fileserver_spec.rb +5 -5
- data/spec/unit/network/http/mongrel_spec.rb +0 -4
- data/spec/unit/network/http/webrick_spec.rb +5 -9
- data/spec/unit/network/http_pool_spec.rb +4 -75
- data/spec/unit/network/http_spec.rb +0 -4
- data/spec/unit/network/server_spec.rb +0 -4
- data/spec/unit/node/environment_spec.rb +18 -31
- data/spec/unit/node/facts_spec.rb +0 -4
- data/spec/unit/node_spec.rb +1 -8
- data/spec/unit/other/selinux_spec.rb +3 -1
- data/spec/unit/parameter_spec.rb +0 -10
- data/spec/unit/parser/ast/collexpr_spec.rb +17 -13
- data/spec/unit/parser/collector_spec.rb +147 -263
- data/spec/unit/parser/compiler_spec.rb +3 -1
- data/spec/unit/parser/files_spec.rb +7 -4
- data/spec/unit/parser/functions/extlookup_spec.rb +6 -3
- data/spec/unit/parser/functions/sprintf_spec.rb +2 -1
- data/spec/unit/parser/type_loader_spec.rb +7 -7
- data/spec/unit/property_spec.rb +1 -1
- data/spec/unit/provider/augeas/augeas_spec.rb +14 -0
- data/spec/unit/provider/exec/posix_spec.rb +102 -106
- data/spec/unit/provider/exec/shell_spec.rb +1 -1
- data/spec/unit/provider/exec/windows_spec.rb +119 -0
- data/spec/unit/provider/group/ldap_spec.rb +0 -4
- data/spec/unit/provider/group/windows_adsi_spec.rb +79 -0
- data/spec/unit/provider/ldap_spec.rb +0 -4
- data/spec/unit/provider/macauthorization_spec.rb +5 -0
- data/spec/unit/provider/mount/parsed_spec.rb +1 -5
- data/spec/unit/provider/package/msi_spec.rb +170 -0
- data/spec/unit/provider/service/redhat_spec.rb +2 -0
- data/spec/unit/provider/service/smf_spec.rb +3 -0
- data/spec/unit/provider/service/systemd_spec.rb +25 -0
- data/spec/unit/provider/service/windows_spec.rb +166 -0
- data/spec/unit/provider/ssh_authorized_key/parsed_spec.rb +2 -2
- data/spec/unit/provider/user/ldap_spec.rb +0 -4
- data/spec/unit/provider/user/user_role_add_spec.rb +1 -1
- data/spec/unit/provider/user/useradd_spec.rb +1 -1
- data/spec/unit/provider/user/windows_adsi_spec.rb +110 -0
- data/spec/unit/relationship_spec.rb +0 -4
- data/spec/unit/resource/catalog_spec.rb +37 -25
- data/spec/unit/resource/status_spec.rb +4 -2
- data/spec/unit/resource_spec.rb +5 -5
- data/spec/unit/simple_graph_spec.rb +0 -4
- data/spec/unit/ssl/certificate_authority_spec.rb +2 -2
- data/spec/unit/ssl/host_spec.rb +12 -13
- data/spec/unit/ssl/inventory_spec.rb +2 -2
- data/spec/unit/sslcertificates/ca_spec.rb +6 -10
- data/spec/unit/transaction/event_manager_spec.rb +4 -2
- data/spec/unit/transaction/event_spec.rb +3 -1
- data/spec/unit/transaction/report_spec.rb +2 -6
- data/spec/unit/transaction/resource_harness_spec.rb +9 -5
- data/spec/unit/transaction_spec.rb +3 -1
- data/spec/unit/type/cron_spec.rb +1 -1
- data/spec/unit/type/exec_spec.rb +80 -47
- data/spec/unit/type/file/checksum_spec.rb +9 -8
- data/spec/unit/type/file/content_spec.rb +2 -1
- data/spec/unit/type/file/selinux_spec.rb +10 -8
- data/spec/unit/type/file/source_spec.rb +18 -36
- data/spec/unit/type/file_spec.rb +170 -217
- data/spec/unit/type/group_spec.rb +1 -1
- data/spec/unit/type/mount_spec.rb +5 -5
- data/spec/unit/type/noop_metaparam_spec.rb +3 -1
- data/spec/unit/type/package_spec.rb +15 -3
- data/spec/unit/type/resources_spec.rb +2 -2
- data/spec/unit/type/service_spec.rb +19 -4
- data/spec/unit/type/ssh_authorized_key_spec.rb +10 -4
- data/spec/unit/type/tidy_spec.rb +3 -1
- data/spec/unit/type/user_spec.rb +1 -1
- data/spec/unit/type_spec.rb +29 -34
- data/spec/unit/util/adsi_spec.rb +202 -0
- data/spec/unit/util/autoload_spec.rb +23 -19
- data/spec/unit/util/backups_spec.rb +16 -13
- data/spec/unit/util/cacher_spec.rb +64 -141
- data/spec/unit/util/checksums_spec.rb +0 -4
- data/spec/unit/util/constant_inflector_spec.rb +0 -4
- data/spec/unit/util/execution_stub_spec.rb +1 -1
- data/spec/unit/util/ldap/connection_spec.rb +0 -4
- data/spec/unit/util/ldap/generator_spec.rb +0 -4
- data/spec/unit/util/ldap/manager_spec.rb +0 -4
- data/spec/unit/util/log_spec.rb +4 -2
- data/spec/unit/util/logging_spec.rb +2 -2
- data/spec/unit/util/nagios_maker_spec.rb +0 -4
- data/spec/unit/util/network_device/cisco/device_spec.rb +2 -1
- data/spec/unit/util/network_device/cisco/facts_spec.rb +3 -1
- data/spec/unit/util/network_device/config_spec.rb +5 -3
- data/spec/unit/util/rdoc/parser_spec.rb +7 -1
- data/spec/unit/util/run_mode_spec.rb +6 -2
- data/spec/unit/util/settings/file_setting_spec.rb +29 -2
- data/spec/unit/util/settings_spec.rb +28 -15
- data/spec/unit/util/storage_spec.rb +1 -1
- data/spec/unit/util/suidmanager_spec.rb +310 -0
- data/spec/unit/util/tagging_spec.rb +0 -4
- data/spec/unit/util_spec.rb +335 -0
- data/test/language/ast/variable.rb +0 -4
- data/test/lib/puppettest/support/resources.rb +0 -4
- data/test/lib/puppettest/testcase.rb +0 -4
- data/test/lib/puppettest.rb +0 -1
- data/test/network/handler/master.rb +0 -5
- data/test/network/server/webrick.rb +5 -22
- data/test/ral/manager/attributes.rb +0 -4
- data/test/ral/manager/instances.rb +0 -4
- data/test/ral/manager/manager.rb +0 -4
- data/test/ral/providers/cron/crontab.rb +1 -0
- data/test/ral/providers/service/base.rb +0 -4
- data/test/ral/type/filesources.rb +0 -1
- data/test/ral/type/resources.rb +0 -4
- data/test/util/utiltest.rb +0 -13
- metadata +36 -9
- data/spec/unit/network/client_spec.rb +0 -45
- data/test/puppet/tc_suidmanager.rb +0 -120
@@ -10,12 +10,6 @@ module FileServingMountTesting
|
|
10
10
|
end
|
11
11
|
|
12
12
|
describe Puppet::FileServing::Mount::File do
|
13
|
-
it "should provide a method for clearing its cached host information" do
|
14
|
-
old = Puppet::FileServing::Mount::File.localmap
|
15
|
-
Puppet::Util::Cacher.expire
|
16
|
-
Puppet::FileServing::Mount::File.localmap.should_not equal(old)
|
17
|
-
end
|
18
|
-
|
19
13
|
it "should be invalid if it does not have a path" do
|
20
14
|
lambda { Puppet::FileServing::Mount::File.new("foo").validate }.should raise_error(ArgumentError)
|
21
15
|
end
|
@@ -27,169 +21,169 @@ describe Puppet::FileServing::Mount::File do
|
|
27
21
|
mount.path = "/foo"
|
28
22
|
lambda { mount.validate }.should_not raise_error(ArgumentError)
|
29
23
|
end
|
30
|
-
end
|
31
|
-
|
32
|
-
describe Puppet::FileServing::Mount::File, " when setting the path" do
|
33
|
-
before do
|
34
|
-
@mount = Puppet::FileServing::Mount::File.new("test")
|
35
|
-
@dir = "/this/path/does/not/exist"
|
36
|
-
end
|
37
|
-
|
38
|
-
it "should fail if the path is not a directory" do
|
39
|
-
FileTest.expects(:directory?).returns(false)
|
40
|
-
proc { @mount.path = @dir }.should raise_error(ArgumentError)
|
41
|
-
end
|
42
|
-
|
43
|
-
it "should fail if the path is not readable" do
|
44
|
-
FileTest.expects(:directory?).returns(true)
|
45
|
-
FileTest.expects(:readable?).returns(false)
|
46
|
-
proc { @mount.path = @dir }.should raise_error(ArgumentError)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
describe Puppet::FileServing::Mount::File, " when substituting hostnames and ip addresses into file paths" do
|
51
|
-
include FileServingMountTesting
|
52
|
-
|
53
|
-
before do
|
54
|
-
FileTest.stubs(:directory?).returns(true)
|
55
|
-
FileTest.stubs(:readable?).returns(true)
|
56
|
-
@mount = Puppet::FileServing::Mount::File.new("test")
|
57
|
-
@host = "host.domain.com"
|
58
|
-
end
|
59
|
-
|
60
|
-
it "should replace incidences of %h in the path with the client's short name" do
|
61
|
-
@mount.path = "/dir/%h/yay"
|
62
|
-
@mount.path(@host).should == "/dir/host/yay"
|
63
|
-
end
|
64
|
-
|
65
|
-
it "should replace incidences of %H in the path with the client's fully qualified name" do
|
66
|
-
@mount.path = "/dir/%H/yay"
|
67
|
-
@mount.path(@host).should == "/dir/host.domain.com/yay"
|
68
|
-
end
|
69
|
-
|
70
|
-
it "should replace incidences of %d in the path with the client's domain name" do
|
71
|
-
@mount.path = "/dir/%d/yay"
|
72
|
-
@mount.path(@host).should == "/dir/domain.com/yay"
|
73
|
-
end
|
74
|
-
|
75
|
-
it "should perform all necessary replacements" do
|
76
|
-
@mount.path = "/%h/%d/%H"
|
77
|
-
@mount.path(@host).should == "/host/domain.com/host.domain.com"
|
78
|
-
end
|
79
|
-
|
80
|
-
it "should use local host information if no client data is provided" do
|
81
|
-
stub_facter("myhost.mydomain.com")
|
82
|
-
@mount.path = "/%h/%d/%H"
|
83
|
-
@mount.path.should == "/myhost/mydomain.com/myhost.mydomain.com"
|
84
|
-
end
|
85
|
-
|
86
|
-
after do
|
87
|
-
Puppet::Util::Cacher.expire
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
describe Puppet::FileServing::Mount::File, "when determining the complete file path" do
|
92
|
-
include FileServingMountTesting
|
93
|
-
|
94
|
-
before do
|
95
|
-
FileTest.stubs(:exist?).returns(true)
|
96
|
-
FileTest.stubs(:directory?).returns(true)
|
97
|
-
FileTest.stubs(:readable?).returns(true)
|
98
|
-
@mount = Puppet::FileServing::Mount::File.new("test")
|
99
|
-
@mount.path = "/mount"
|
100
|
-
stub_facter("myhost.mydomain.com")
|
101
|
-
@host = "host.domain.com"
|
102
|
-
end
|
103
|
-
|
104
|
-
it "should return nil if the file is absent" do
|
105
|
-
FileTest.stubs(:exist?).returns(false)
|
106
|
-
@mount.complete_path("/my/path", nil).should be_nil
|
107
|
-
end
|
108
|
-
|
109
|
-
it "should write a log message if the file is absent" do
|
110
|
-
FileTest.stubs(:exist?).returns(false)
|
111
|
-
|
112
|
-
Puppet.expects(:info).with("File does not exist or is not accessible: /mount/my/path")
|
113
|
-
|
114
|
-
@mount.complete_path("/my/path", nil)
|
115
|
-
end
|
116
|
-
|
117
|
-
it "should return the file path if the file is present" do
|
118
|
-
FileTest.stubs(:exist?).with("/my/path").returns(true)
|
119
|
-
@mount.complete_path("/my/path", nil).should == "/mount/my/path"
|
120
|
-
end
|
121
|
-
|
122
|
-
it "should treat a nil file name as the path to the mount itself" do
|
123
|
-
FileTest.stubs(:exist?).returns(true)
|
124
|
-
@mount.complete_path(nil, nil).should == "/mount"
|
125
|
-
end
|
126
|
-
|
127
|
-
it "should use the client host name if provided in the options" do
|
128
|
-
@mount.path = "/mount/%h"
|
129
|
-
@mount.complete_path("/my/path", @host).should == "/mount/host/my/path"
|
130
|
-
end
|
131
|
-
|
132
|
-
it "should perform replacements on the base path" do
|
133
|
-
@mount.path = "/blah/%h"
|
134
|
-
@mount.complete_path("/my/stuff", @host).should == "/blah/host/my/stuff"
|
135
|
-
end
|
136
|
-
|
137
|
-
it "should not perform replacements on the per-file path" do
|
138
|
-
@mount.path = "/blah"
|
139
|
-
@mount.complete_path("/%h/stuff", @host).should == "/blah/%h/stuff"
|
140
|
-
end
|
141
|
-
|
142
|
-
it "should look for files relative to its base directory" do
|
143
|
-
@mount.complete_path("/my/stuff", @host).should == "/mount/my/stuff"
|
144
|
-
end
|
145
|
-
end
|
146
|
-
|
147
|
-
describe Puppet::FileServing::Mount::File, "when finding files" do
|
148
|
-
include FileServingMountTesting
|
149
|
-
|
150
|
-
before do
|
151
|
-
FileTest.stubs(:exist?).returns(true)
|
152
|
-
FileTest.stubs(:directory?).returns(true)
|
153
|
-
FileTest.stubs(:readable?).returns(true)
|
154
|
-
@mount = Puppet::FileServing::Mount::File.new("test")
|
155
|
-
@mount.path = "/mount"
|
156
|
-
stub_facter("myhost.mydomain.com")
|
157
|
-
@host = "host.domain.com"
|
158
|
-
|
159
|
-
@request = stub 'request', :node => "foo"
|
160
|
-
end
|
161
|
-
|
162
|
-
it "should return the results of the complete file path" do
|
163
|
-
FileTest.stubs(:exist?).returns(false)
|
164
|
-
@mount.expects(:complete_path).with("/my/path", "foo").returns "eh"
|
165
|
-
@mount.find("/my/path", @request).should == "eh"
|
166
|
-
end
|
167
|
-
end
|
168
|
-
|
169
|
-
describe Puppet::FileServing::Mount::File, "when searching for files" do
|
170
|
-
include FileServingMountTesting
|
171
|
-
|
172
|
-
before do
|
173
|
-
FileTest.stubs(:exist?).returns(true)
|
174
|
-
FileTest.stubs(:directory?).returns(true)
|
175
|
-
FileTest.stubs(:readable?).returns(true)
|
176
|
-
@mount = Puppet::FileServing::Mount::File.new("test")
|
177
|
-
@mount.path = "/mount"
|
178
|
-
stub_facter("myhost.mydomain.com")
|
179
|
-
@host = "host.domain.com"
|
180
|
-
|
181
|
-
@request = stub 'request', :node => "foo"
|
182
|
-
end
|
183
|
-
|
184
|
-
it "should return the results of the complete file path as an array" do
|
185
|
-
FileTest.stubs(:exist?).returns(false)
|
186
|
-
@mount.expects(:complete_path).with("/my/path", "foo").returns "eh"
|
187
|
-
@mount.search("/my/path", @request).should == ["eh"]
|
188
|
-
end
|
189
24
|
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
25
|
+
describe "when setting the path" do
|
26
|
+
before do
|
27
|
+
@mount = Puppet::FileServing::Mount::File.new("test")
|
28
|
+
@dir = "/this/path/does/not/exist"
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should fail if the path is not a directory" do
|
32
|
+
FileTest.expects(:directory?).returns(false)
|
33
|
+
proc { @mount.path = @dir }.should raise_error(ArgumentError)
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should fail if the path is not readable" do
|
37
|
+
FileTest.expects(:directory?).returns(true)
|
38
|
+
FileTest.expects(:readable?).returns(false)
|
39
|
+
proc { @mount.path = @dir }.should raise_error(ArgumentError)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
describe "when substituting hostnames and ip addresses into file paths" do
|
44
|
+
include FileServingMountTesting
|
45
|
+
|
46
|
+
before do
|
47
|
+
FileTest.stubs(:directory?).returns(true)
|
48
|
+
FileTest.stubs(:readable?).returns(true)
|
49
|
+
@mount = Puppet::FileServing::Mount::File.new("test")
|
50
|
+
@host = "host.domain.com"
|
51
|
+
end
|
52
|
+
|
53
|
+
after :each do
|
54
|
+
Puppet::FileServing::Mount::File.instance_variable_set(:@localmap, nil)
|
55
|
+
end
|
56
|
+
|
57
|
+
it "should replace incidences of %h in the path with the client's short name" do
|
58
|
+
@mount.path = "/dir/%h/yay"
|
59
|
+
@mount.path(@host).should == "/dir/host/yay"
|
60
|
+
end
|
61
|
+
|
62
|
+
it "should replace incidences of %H in the path with the client's fully qualified name" do
|
63
|
+
@mount.path = "/dir/%H/yay"
|
64
|
+
@mount.path(@host).should == "/dir/host.domain.com/yay"
|
65
|
+
end
|
66
|
+
|
67
|
+
it "should replace incidences of %d in the path with the client's domain name" do
|
68
|
+
@mount.path = "/dir/%d/yay"
|
69
|
+
@mount.path(@host).should == "/dir/domain.com/yay"
|
70
|
+
end
|
71
|
+
|
72
|
+
it "should perform all necessary replacements" do
|
73
|
+
@mount.path = "/%h/%d/%H"
|
74
|
+
@mount.path(@host).should == "/host/domain.com/host.domain.com"
|
75
|
+
end
|
76
|
+
|
77
|
+
it "should use local host information if no client data is provided" do
|
78
|
+
stub_facter("myhost.mydomain.com")
|
79
|
+
@mount.path = "/%h/%d/%H"
|
80
|
+
@mount.path.should == "/myhost/mydomain.com/myhost.mydomain.com"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
describe "when determining the complete file path" do
|
85
|
+
include FileServingMountTesting
|
86
|
+
|
87
|
+
before do
|
88
|
+
FileTest.stubs(:exist?).returns(true)
|
89
|
+
FileTest.stubs(:directory?).returns(true)
|
90
|
+
FileTest.stubs(:readable?).returns(true)
|
91
|
+
@mount = Puppet::FileServing::Mount::File.new("test")
|
92
|
+
@mount.path = "/mount"
|
93
|
+
stub_facter("myhost.mydomain.com")
|
94
|
+
@host = "host.domain.com"
|
95
|
+
end
|
96
|
+
|
97
|
+
it "should return nil if the file is absent" do
|
98
|
+
FileTest.stubs(:exist?).returns(false)
|
99
|
+
@mount.complete_path("/my/path", nil).should be_nil
|
100
|
+
end
|
101
|
+
|
102
|
+
it "should write a log message if the file is absent" do
|
103
|
+
FileTest.stubs(:exist?).returns(false)
|
104
|
+
|
105
|
+
Puppet.expects(:info).with("File does not exist or is not accessible: /mount/my/path")
|
106
|
+
|
107
|
+
@mount.complete_path("/my/path", nil)
|
108
|
+
end
|
109
|
+
|
110
|
+
it "should return the file path if the file is present" do
|
111
|
+
FileTest.stubs(:exist?).with("/my/path").returns(true)
|
112
|
+
@mount.complete_path("/my/path", nil).should == "/mount/my/path"
|
113
|
+
end
|
114
|
+
|
115
|
+
it "should treat a nil file name as the path to the mount itself" do
|
116
|
+
FileTest.stubs(:exist?).returns(true)
|
117
|
+
@mount.complete_path(nil, nil).should == "/mount"
|
118
|
+
end
|
119
|
+
|
120
|
+
it "should use the client host name if provided in the options" do
|
121
|
+
@mount.path = "/mount/%h"
|
122
|
+
@mount.complete_path("/my/path", @host).should == "/mount/host/my/path"
|
123
|
+
end
|
124
|
+
|
125
|
+
it "should perform replacements on the base path" do
|
126
|
+
@mount.path = "/blah/%h"
|
127
|
+
@mount.complete_path("/my/stuff", @host).should == "/blah/host/my/stuff"
|
128
|
+
end
|
129
|
+
|
130
|
+
it "should not perform replacements on the per-file path" do
|
131
|
+
@mount.path = "/blah"
|
132
|
+
@mount.complete_path("/%h/stuff", @host).should == "/blah/%h/stuff"
|
133
|
+
end
|
134
|
+
|
135
|
+
it "should look for files relative to its base directory" do
|
136
|
+
@mount.complete_path("/my/stuff", @host).should == "/mount/my/stuff"
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
describe "when finding files" do
|
141
|
+
include FileServingMountTesting
|
142
|
+
|
143
|
+
before do
|
144
|
+
FileTest.stubs(:exist?).returns(true)
|
145
|
+
FileTest.stubs(:directory?).returns(true)
|
146
|
+
FileTest.stubs(:readable?).returns(true)
|
147
|
+
@mount = Puppet::FileServing::Mount::File.new("test")
|
148
|
+
@mount.path = "/mount"
|
149
|
+
stub_facter("myhost.mydomain.com")
|
150
|
+
@host = "host.domain.com"
|
151
|
+
|
152
|
+
@request = stub 'request', :node => "foo"
|
153
|
+
end
|
154
|
+
|
155
|
+
it "should return the results of the complete file path" do
|
156
|
+
FileTest.stubs(:exist?).returns(false)
|
157
|
+
@mount.expects(:complete_path).with("/my/path", "foo").returns "eh"
|
158
|
+
@mount.find("/my/path", @request).should == "eh"
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
describe "when searching for files" do
|
163
|
+
include FileServingMountTesting
|
164
|
+
|
165
|
+
before do
|
166
|
+
FileTest.stubs(:exist?).returns(true)
|
167
|
+
FileTest.stubs(:directory?).returns(true)
|
168
|
+
FileTest.stubs(:readable?).returns(true)
|
169
|
+
@mount = Puppet::FileServing::Mount::File.new("test")
|
170
|
+
@mount.path = "/mount"
|
171
|
+
stub_facter("myhost.mydomain.com")
|
172
|
+
@host = "host.domain.com"
|
173
|
+
|
174
|
+
@request = stub 'request', :node => "foo"
|
175
|
+
end
|
176
|
+
|
177
|
+
it "should return the results of the complete file path as an array" do
|
178
|
+
FileTest.stubs(:exist?).returns(false)
|
179
|
+
@mount.expects(:complete_path).with("/my/path", "foo").returns "eh"
|
180
|
+
@mount.search("/my/path", @request).should == ["eh"]
|
181
|
+
end
|
182
|
+
|
183
|
+
it "should return nil if the complete path is nil" do
|
184
|
+
FileTest.stubs(:exist?).returns(false)
|
185
|
+
@mount.expects(:complete_path).with("/my/path", "foo").returns nil
|
186
|
+
@mount.search("/my/path", @request).should be_nil
|
187
|
+
end
|
194
188
|
end
|
195
189
|
end
|
@@ -1,8 +1,4 @@
|
|
1
1
|
#!/usr/bin/env rspec
|
2
|
-
#
|
3
|
-
# Created by Luke Kanies on 2007-9-23.
|
4
|
-
# Copyright (c) 2007. All rights reserved.
|
5
|
-
|
6
2
|
require 'spec_helper'
|
7
3
|
|
8
4
|
require 'puppet/indirector/catalog/compiler'
|
@@ -43,24 +39,6 @@ describe Puppet::Resource::Catalog::Compiler do
|
|
43
39
|
compiler = Puppet::Resource::Catalog::Compiler.new
|
44
40
|
compiler.should respond_to(:networked?)
|
45
41
|
end
|
46
|
-
|
47
|
-
describe "and storeconfigs is enabled" do
|
48
|
-
before do
|
49
|
-
Puppet.settings.expects(:value).with(:storeconfigs).returns true
|
50
|
-
end
|
51
|
-
|
52
|
-
it "should initialize Rails if it is available" do
|
53
|
-
Puppet.features.expects(:rails?).returns true
|
54
|
-
Puppet::Rails.expects(:init)
|
55
|
-
Puppet::Resource::Catalog::Compiler.new
|
56
|
-
end
|
57
|
-
|
58
|
-
it "should fail if Rails is unavailable" do
|
59
|
-
Puppet.features.expects(:rails?).returns false
|
60
|
-
Puppet::Rails.expects(:init).never
|
61
|
-
lambda { Puppet::Resource::Catalog::Compiler.new }.should raise_error(Puppet::Error)
|
62
|
-
end
|
63
|
-
end
|
64
42
|
end
|
65
43
|
|
66
44
|
describe "when finding catalogs" do
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env rspec
|
2
|
+
require 'spec_helper'
|
3
|
+
require 'puppet/node'
|
4
|
+
require 'puppet/indirector/memory'
|
5
|
+
require 'puppet/indirector/catalog/store_configs'
|
6
|
+
|
7
|
+
class Puppet::Resource::Catalog::StoreConfigsTesting < Puppet::Indirector::Memory
|
8
|
+
end
|
9
|
+
|
10
|
+
describe Puppet::Resource::Catalog::StoreConfigs do
|
11
|
+
after :each do
|
12
|
+
Puppet::Resource::Catalog.indirection.reset_terminus_class
|
13
|
+
Puppet::Resource::Catalog.indirection.cache_class = nil
|
14
|
+
end
|
15
|
+
|
16
|
+
it_should_behave_like "a StoreConfigs terminus"
|
17
|
+
end
|
@@ -1,8 +1,4 @@
|
|
1
1
|
#!/usr/bin/env rspec
|
2
|
-
#
|
3
|
-
# Created by Luke Kanies on 2008-3-7.
|
4
|
-
# Copyright (c) 2007. All rights reserved.
|
5
|
-
|
6
2
|
require 'spec_helper'
|
7
3
|
|
8
4
|
require 'puppet/ssl/host'
|
@@ -10,7 +6,7 @@ require 'puppet/sslcertificates'
|
|
10
6
|
require 'puppet/sslcertificates/ca'
|
11
7
|
require 'puppet/indirector/certificate_request/ca'
|
12
8
|
|
13
|
-
describe Puppet::SSL::CertificateRequest::Ca do
|
9
|
+
describe Puppet::SSL::CertificateRequest::Ca, :unless => Puppet.features.microsoft_windows? do
|
14
10
|
include PuppetSpec::Files
|
15
11
|
|
16
12
|
before :each do
|
@@ -4,7 +4,7 @@ require 'puppet/ssl/host'
|
|
4
4
|
require 'puppet/indirector/certificate_status'
|
5
5
|
require 'tempfile'
|
6
6
|
|
7
|
-
describe "Puppet::Indirector::CertificateStatus::File" do
|
7
|
+
describe "Puppet::Indirector::CertificateStatus::File", :fails_on_windows => true do
|
8
8
|
include PuppetSpec::Files
|
9
9
|
|
10
10
|
before :all do
|
@@ -22,6 +22,9 @@ describe "Puppet::Node::Facts::InventoryActiveRecord", :if => (Puppet.features.r
|
|
22
22
|
end
|
23
23
|
|
24
24
|
before :each do
|
25
|
+
Puppet::Node.indirection.reset_terminus_class
|
26
|
+
Puppet::Node.indirection.cache_class = nil
|
27
|
+
|
25
28
|
Puppet::Node::Facts.indirection.terminus_class = :inventory_active_record
|
26
29
|
Puppet[:dbadapter] = 'sqlite3'
|
27
30
|
Puppet[:dblocation] = @dbfile.path
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env rspec
|
2
|
+
require 'spec_helper'
|
3
|
+
require 'puppet/node'
|
4
|
+
require 'puppet/indirector/memory'
|
5
|
+
require 'puppet/indirector/facts/store_configs'
|
6
|
+
|
7
|
+
class Puppet::Node::Facts::StoreConfigsTesting < Puppet::Indirector::Memory
|
8
|
+
end
|
9
|
+
|
10
|
+
describe Puppet::Node::Facts::StoreConfigs do
|
11
|
+
after :all do
|
12
|
+
Puppet::Node::Facts.indirection.reset_terminus_class
|
13
|
+
Puppet::Node::Facts.indirection.cache_class = nil
|
14
|
+
end
|
15
|
+
|
16
|
+
it_should_behave_like "a StoreConfigs terminus"
|
17
|
+
end
|
@@ -111,7 +111,7 @@ describe Puppet::FileBucketFile::File do
|
|
111
111
|
end
|
112
112
|
end
|
113
113
|
|
114
|
-
describe "when diffing files" do
|
114
|
+
describe "when diffing files", :unless => Puppet.features.microsoft_windows? do
|
115
115
|
it "should generate an empty string if there is no diff" do
|
116
116
|
checksum = save_bucket_file("I'm the contents of a file")
|
117
117
|
Puppet::FileBucket::File.indirection.find("md5/#{checksum}", :diff_with => checksum).should == ''
|
@@ -243,11 +243,11 @@ HERE
|
|
243
243
|
describe "when verifying identical files" do
|
244
244
|
before do
|
245
245
|
# this is the default from spec_helper, but it keeps getting reset at odd times
|
246
|
-
Puppet[:bucketdir] = "/dev/null/bucket"
|
246
|
+
Puppet[:bucketdir] = make_absolute("/dev/null/bucket")
|
247
247
|
|
248
248
|
@digest = "4a8ec4fa5f01b4ab1a0ab8cbccb709f0"
|
249
249
|
@checksum = "{md5}4a8ec4fa5f01b4ab1a0ab8cbccb709f0"
|
250
|
-
@dir = '/dev/null/bucket/4/a/8/e/c/4/f/a/4a8ec4fa5f01b4ab1a0ab8cbccb709f0'
|
250
|
+
@dir = make_absolute('/dev/null/bucket/4/a/8/e/c/4/f/a/4a8ec4fa5f01b4ab1a0ab8cbccb709f0')
|
251
251
|
|
252
252
|
@contents = "file contents"
|
253
253
|
|
@@ -1,8 +1,4 @@
|
|
1
1
|
#!/usr/bin/env rspec
|
2
|
-
#
|
3
|
-
# Created by Luke Kanies on 2007-10-19.
|
4
|
-
# Copyright (c) 2007. All rights reserved.
|
5
|
-
|
6
2
|
require 'spec_helper'
|
7
3
|
|
8
4
|
require 'puppet/indirector/file_server'
|
@@ -27,7 +23,7 @@ describe Puppet::Indirector::FileServer do
|
|
27
23
|
|
28
24
|
@uri = "puppet://host/my/local/file"
|
29
25
|
@configuration = mock 'configuration'
|
30
|
-
Puppet::FileServing::Configuration.stubs(:
|
26
|
+
Puppet::FileServing::Configuration.stubs(:configuration).returns(@configuration)
|
31
27
|
|
32
28
|
@request = Puppet::Indirector::Request.new(:myind, :mymethod, @uri, :environment => "myenv")
|
33
29
|
end
|
@@ -102,9 +102,6 @@ shared_examples_for "Delegation Authorizer" do
|
|
102
102
|
end
|
103
103
|
|
104
104
|
describe Puppet::Indirector::Indirection do
|
105
|
-
after do
|
106
|
-
Puppet::Util::Cacher.expire
|
107
|
-
end
|
108
105
|
describe "when initializing" do
|
109
106
|
# (LAK) I've no idea how to test this, really.
|
110
107
|
it "should store a reference to itself before it consumes its options" do
|
@@ -643,7 +640,6 @@ describe Puppet::Indirector::Indirection do
|
|
643
640
|
|
644
641
|
after :each do
|
645
642
|
@indirection.delete
|
646
|
-
Puppet::Util::Cacher.expire
|
647
643
|
end
|
648
644
|
end
|
649
645
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env rspec
|
2
|
+
require 'spec_helper'
|
3
|
+
require 'puppet/node'
|
4
|
+
require 'puppet/indirector/node/store_configs'
|
5
|
+
|
6
|
+
class Puppet::Node::StoreConfigsTesting < Puppet::Indirector::Memory
|
7
|
+
end
|
8
|
+
|
9
|
+
describe Puppet::Node::StoreConfigs do
|
10
|
+
after :each do
|
11
|
+
Puppet::Node.indirection.reset_terminus_class
|
12
|
+
Puppet::Node.indirection.cache_class = nil
|
13
|
+
end
|
14
|
+
|
15
|
+
it_should_behave_like "a StoreConfigs terminus"
|
16
|
+
end
|