puppet 3.3.2 → 3.4.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/CONTRIBUTING.md +22 -0
- data/Gemfile +11 -2
- data/README.md +13 -17
- data/README_DEVELOPER.md +1 -1
- data/Rakefile +1 -1
- data/examples/hiera/README.md +4 -4
- data/ext/debian/puppetmaster.init +1 -0
- data/ext/debian/rules +2 -5
- data/ext/nagios/check_puppet.rb +7 -7
- data/ext/osx/file_mapping.yaml +1 -1
- data/ext/osx/preflight.erb +34 -19
- data/ext/rack/{files/config.ru → config.ru} +0 -0
- data/ext/rack/{files/apache2.conf → example-passenger-vhost.conf} +6 -0
- data/ext/redhat/puppet.spec.erb +20 -2
- data/ext/systemd/{puppetagent.service → puppet.service} +0 -0
- data/lib/hiera_puppet.rb +2 -2
- data/lib/puppet/agent.rb +1 -6
- data/lib/puppet/application.rb +15 -2
- data/lib/puppet/application/agent.rb +2 -7
- data/lib/puppet/application/apply.rb +8 -13
- data/lib/puppet/application/cert.rb +47 -7
- data/lib/puppet/application/device.rb +1 -6
- data/lib/puppet/application/face_base.rb +1 -1
- data/lib/puppet/application/filebucket.rb +1 -1
- data/lib/puppet/application/inspect.rb +3 -12
- data/lib/puppet/application/master.rb +1 -6
- data/lib/puppet/application/queue.rb +1 -6
- data/lib/puppet/application/resource.rb +2 -6
- data/lib/puppet/coercion.rb +11 -0
- data/lib/puppet/configurer.rb +5 -3
- data/lib/puppet/configurer/downloader.rb +3 -1
- data/lib/puppet/configurer/plugin_handler.rb +10 -0
- data/lib/puppet/confine.rb +80 -0
- data/lib/puppet/{provider/confine → confine}/exists.rb +3 -3
- data/lib/puppet/{provider/confine → confine}/false.rb +2 -2
- data/lib/puppet/{provider/confine → confine}/feature.rb +2 -2
- data/lib/puppet/{provider/confine → confine}/true.rb +2 -2
- data/lib/puppet/{provider/confine → confine}/variable.rb +2 -2
- data/lib/puppet/{provider/confine_collection.rb → confine_collection.rb} +4 -4
- data/lib/puppet/{provider/confiner.rb → confiner.rb} +4 -4
- data/lib/puppet/daemon.rb +2 -6
- data/lib/puppet/data_binding.rb +2 -30
- data/lib/puppet/defaults.rb +283 -174
- data/lib/puppet/error.rb +1 -0
- data/lib/puppet/external/nagios.rb +0 -2
- data/lib/puppet/external/nagios/base.rb +4 -3
- data/lib/puppet/external/nagios/grammar.ry +173 -112
- data/lib/puppet/external/nagios/parser.rb +233 -184
- data/lib/puppet/face/file/store.rb +1 -1
- data/lib/puppet/face/module/generate.rb +5 -7
- data/lib/puppet/face/parser.rb +12 -2
- data/lib/puppet/face/plugin.rb +6 -0
- data/lib/puppet/feature/base.rb +16 -0
- data/lib/puppet/feature/external_facts.rb +5 -0
- data/lib/puppet/feature/libuser.rb +1 -1
- data/lib/puppet/feature/msgpack.rb +1 -0
- data/lib/puppet/feature/rails.rb +2 -2
- data/lib/puppet/file_bucket/dipper.rb +8 -6
- data/lib/puppet/file_bucket/file.rb +17 -1
- data/lib/puppet/file_serving/base.rb +21 -10
- data/lib/puppet/file_serving/configuration.rb +5 -7
- data/lib/puppet/file_serving/configuration/parser.rb +1 -1
- data/lib/puppet/file_serving/content.rb +1 -1
- data/lib/puppet/file_serving/fileset.rb +3 -3
- data/lib/puppet/file_serving/metadata.rb +22 -18
- data/lib/puppet/file_serving/mount/file.rb +1 -1
- data/lib/puppet/file_serving/mount/pluginfacts.rb +35 -0
- data/lib/puppet/file_system.rb +3 -0
- data/lib/puppet/file_system/file.rb +261 -0
- data/lib/puppet/file_system/file18.rb +5 -0
- data/lib/puppet/file_system/file19.rb +5 -0
- data/lib/puppet/file_system/file19windows.rb +113 -0
- data/lib/puppet/file_system/memory_file.rb +31 -0
- data/lib/puppet/file_system/tempfile.rb +20 -0
- data/lib/puppet/indirector/active_record.rb +1 -0
- data/lib/puppet/indirector/catalog/compiler.rb +28 -0
- data/lib/puppet/indirector/certificate_request/memory.rb +6 -0
- data/lib/puppet/indirector/data_binding/hiera.rb +46 -2
- data/lib/puppet/indirector/direct_file_server.rb +2 -2
- data/lib/puppet/indirector/facts/facter.rb +25 -0
- data/lib/puppet/indirector/file_bucket_file/file.rb +60 -74
- data/lib/puppet/indirector/indirection.rb +5 -1
- data/lib/puppet/indirector/json.rb +1 -1
- data/lib/puppet/indirector/key/ca.rb +4 -0
- data/lib/puppet/indirector/key/file.rb +7 -3
- data/lib/puppet/indirector/key/memory.rb +6 -0
- data/lib/puppet/indirector/node/write_only_yaml.rb +2 -2
- data/lib/puppet/indirector/request.rb +17 -11
- data/lib/puppet/indirector/resource/ral.rb +5 -0
- data/lib/puppet/indirector/resource/rest.rb +1 -0
- data/lib/puppet/indirector/resource/store_configs.rb +4 -0
- data/lib/puppet/indirector/rest.rb +2 -1
- data/lib/puppet/indirector/ssl_file.rb +7 -7
- data/lib/puppet/indirector/terminus.rb +4 -0
- data/lib/puppet/indirector/yaml.rb +3 -3
- data/lib/puppet/interface/documentation.rb +4 -11
- data/lib/puppet/module.rb +19 -6
- data/lib/puppet/module_tool/applications/builder.rb +1 -1
- data/lib/puppet/module_tool/applications/installer.rb +1 -1
- data/lib/puppet/module_tool/checksums.rb +1 -1
- data/lib/puppet/module_tool/dependency.rb +7 -3
- data/lib/puppet/module_tool/metadata.rb +6 -2
- data/lib/puppet/module_tool/tar.rb +2 -1
- data/lib/puppet/module_tool/tar/gnu.rb +6 -2
- data/lib/puppet/module_tool/tar/mini.rb +2 -0
- data/lib/puppet/module_tool/tar/solaris.rb +2 -5
- data/lib/puppet/network/authconfig.rb +0 -2
- data/lib/puppet/network/authentication.rb +1 -1
- data/lib/puppet/network/authstore.rb +6 -7
- data/lib/puppet/network/format.rb +2 -3
- data/lib/puppet/network/format_handler.rb +16 -11
- data/lib/puppet/network/format_support.rb +14 -0
- data/lib/puppet/network/formats.rb +26 -0
- data/lib/puppet/network/http/connection.rb +8 -41
- data/lib/puppet/network/http/handler.rb +28 -32
- data/lib/puppet/network/http/webrick.rb +15 -22
- data/lib/puppet/network/http_pool.rb +43 -9
- data/lib/puppet/network/rights.rb +0 -0
- data/lib/puppet/node.rb +24 -8
- data/lib/puppet/node/environment.rb +18 -20
- data/lib/puppet/node/facts.rb +23 -6
- data/lib/puppet/parameter.rb +15 -2
- data/lib/puppet/parameter/boolean.rb +5 -0
- data/lib/puppet/parameter/value_collection.rb +6 -4
- data/lib/puppet/parser/ast/resourceparam.rb +2 -1
- data/lib/puppet/parser/compiler.rb +25 -9
- data/lib/puppet/parser/files.rb +1 -1
- data/lib/puppet/parser/functions.rb +12 -21
- data/lib/puppet/parser/functions/collect.rb +6 -35
- data/lib/puppet/parser/functions/contain.rb +26 -0
- data/lib/puppet/parser/functions/create_resources.rb +5 -0
- data/lib/puppet/parser/functions/extlookup.rb +2 -2
- data/lib/puppet/parser/functions/file.rb +1 -1
- data/lib/puppet/parser/functions/{reject.rb → filter.rb} +13 -12
- data/lib/puppet/parser/functions/fqdn_rand.rb +13 -5
- data/lib/puppet/parser/functions/include.rb +18 -1
- data/lib/puppet/parser/functions/map.rb +44 -0
- data/lib/puppet/parser/functions/select.rb +6 -38
- data/lib/puppet/parser/lexer.rb +1 -1
- data/lib/puppet/parser/parser_support.rb +1 -1
- data/lib/puppet/parser/resource.rb +6 -45
- data/lib/puppet/parser/scope.rb +33 -2
- data/lib/puppet/parser/type_loader.rb +4 -60
- data/lib/puppet/pops/binder/bindings_loader.rb +1 -1
- data/lib/puppet/pops/binder/config/binder_config.rb +3 -3
- data/lib/puppet/pops/binder/hiera2/bindings_provider.rb +1 -1
- data/lib/puppet/pops/binder/scheme_handler/confdir_hiera_scheme.rb +1 -1
- data/lib/puppet/pops/binder/scheme_handler/module_hiera_scheme.rb +2 -2
- data/lib/puppet/pops/issues.rb +4 -0
- data/lib/puppet/pops/model/ast_transformer.rb +4 -1
- data/lib/puppet/pops/model/model_label_provider.rb +1 -1
- data/lib/puppet/pops/parser/egrammar.ra +5 -24
- data/lib/puppet/pops/parser/eparser.rb +859 -902
- data/lib/puppet/pops/parser/lexer.rb +48 -30
- data/lib/puppet/pops/parser/parser_support.rb +1 -1
- data/lib/puppet/pops/patterns.rb +4 -4
- data/lib/puppet/pops/utils.rb +1 -1
- data/lib/puppet/pops/validation/checker3_1.rb +25 -20
- data/lib/puppet/provider.rb +23 -6
- data/lib/puppet/provider/aixobject.rb +0 -0
- data/lib/puppet/provider/augeas/augeas.rb +21 -5
- data/lib/puppet/provider/confine.rb +5 -79
- data/lib/puppet/provider/cron/crontab.rb +0 -0
- data/lib/puppet/provider/exec.rb +9 -7
- data/lib/puppet/provider/exec/posix.rb +10 -1
- data/lib/puppet/provider/exec/windows.rb +1 -1
- data/lib/puppet/provider/file/posix.rb +1 -0
- data/lib/puppet/provider/file/windows.rb +16 -5
- data/lib/puppet/provider/group/aix.rb +0 -0
- data/lib/puppet/provider/group/windows_adsi.rb +33 -1
- data/lib/puppet/provider/macauthorization/macauthorization.rb +1 -1
- 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/directoryservice.rb +3 -3
- data/lib/puppet/provider/package/appdmg.rb +1 -1
- data/lib/puppet/provider/package/apple.rb +1 -1
- data/lib/puppet/provider/package/apt.rb +1 -1
- data/lib/puppet/provider/package/aptitude.rb +0 -0
- data/lib/puppet/provider/package/blastwave.rb +1 -1
- data/lib/puppet/provider/package/dpkg.rb +1 -1
- 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/macports.rb +0 -0
- data/lib/puppet/provider/package/msi.rb +4 -10
- data/lib/puppet/provider/package/nim.rb +8 -8
- data/lib/puppet/provider/package/openbsd.rb +1 -1
- data/lib/puppet/provider/package/opkg.rb +0 -0
- data/lib/puppet/provider/package/pacman.rb +2 -2
- data/lib/puppet/provider/package/pkgdmg.rb +1 -1
- data/lib/puppet/provider/package/pkgutil.rb +1 -1
- data/lib/puppet/provider/package/ports.rb +0 -0
- data/lib/puppet/provider/package/rpm.rb +39 -3
- data/lib/puppet/provider/package/sun.rb +3 -3
- data/lib/puppet/provider/package/sunfreeware.rb +0 -0
- data/lib/puppet/provider/package/windows.rb +12 -19
- data/lib/puppet/provider/package/windows/package.rb +1 -1
- data/lib/puppet/provider/package/yum.rb +2 -2
- data/lib/puppet/provider/parsedfile.rb +0 -0
- data/lib/puppet/provider/port/parsed.rb +0 -0
- data/lib/puppet/provider/service/base.rb +0 -0
- data/lib/puppet/provider/service/bsd.rb +3 -3
- data/lib/puppet/provider/service/daemontools.rb +8 -8
- data/lib/puppet/provider/service/debian.rb +0 -0
- data/lib/puppet/provider/service/freebsd.rb +3 -3
- data/lib/puppet/provider/service/init.rb +5 -4
- data/lib/puppet/provider/service/launchd.rb +35 -24
- data/lib/puppet/provider/service/openbsd.rb +23 -0
- data/lib/puppet/provider/service/redhat.rb +0 -0
- data/lib/puppet/provider/service/runit.rb +3 -3
- data/lib/puppet/provider/service/smf.rb +0 -0
- data/lib/puppet/provider/service/src.rb +0 -0
- data/lib/puppet/provider/service/systemd.rb +0 -0
- data/lib/puppet/provider/service/upstart.rb +3 -3
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +2 -2
- data/lib/puppet/provider/sshkey/parsed.rb +0 -0
- data/lib/puppet/provider/user/aix.rb +0 -0
- data/lib/puppet/provider/user/directoryservice.rb +1 -1
- data/lib/puppet/provider/user/useradd.rb +1 -1
- data/lib/puppet/provider/zone/solaris.rb +1 -1
- data/lib/puppet/rails/benchmark.rb +1 -1
- data/lib/puppet/reference/configuration.rb +1 -2
- data/lib/puppet/reference/indirection.rb +12 -14
- data/lib/puppet/relationship.rb +7 -4
- data/lib/puppet/reports.rb +2 -2
- data/lib/puppet/reports/rrdgraph.rb +1 -1
- data/lib/puppet/reports/store.rb +3 -3
- data/lib/puppet/reports/tagmail.rb +2 -2
- data/lib/puppet/resource.rb +66 -8
- data/lib/puppet/resource/catalog.rb +18 -25
- data/lib/puppet/resource/status.rb +10 -4
- data/lib/puppet/run.rb +6 -2
- data/lib/puppet/settings.rb +39 -119
- data/lib/puppet/settings/base_setting.rb +8 -9
- data/lib/puppet/settings/directory_setting.rb +8 -0
- data/lib/puppet/settings/file_setting.rb +35 -1
- data/lib/puppet/settings/priority_setting.rb +42 -0
- data/lib/puppet/ssl.rb +4 -0
- data/lib/puppet/ssl/certificate.rb +18 -0
- data/lib/puppet/ssl/certificate_authority.rb +101 -72
- data/lib/puppet/ssl/certificate_authority/autosign_command.rb +44 -0
- data/lib/puppet/ssl/certificate_authority/interface.rb +21 -17
- data/lib/puppet/ssl/certificate_factory.rb +38 -12
- data/lib/puppet/ssl/certificate_request.rb +201 -47
- data/lib/puppet/ssl/certificate_request_attributes.rb +34 -0
- data/lib/puppet/ssl/certificate_revocation_list.rb +2 -2
- data/lib/puppet/ssl/host.rb +21 -10
- data/lib/puppet/ssl/inventory.rb +6 -10
- data/lib/puppet/ssl/key.rb +1 -1
- data/lib/puppet/ssl/oids.rb +78 -0
- data/lib/puppet/ssl/validator.rb +41 -97
- data/lib/puppet/ssl/validator/default_validator.rb +153 -0
- data/lib/puppet/ssl/validator/no_validator.rb +17 -0
- data/lib/puppet/status.rb +4 -0
- data/lib/puppet/test/test_helper.rb +5 -0
- data/lib/puppet/transaction.rb +13 -0
- data/lib/puppet/transaction/event.rb +8 -3
- data/lib/puppet/transaction/report.rb +6 -2
- data/lib/puppet/transaction/resource_harness.rb +173 -115
- data/lib/puppet/type.rb +30 -13
- data/lib/puppet/type/augeas.rb +12 -46
- data/lib/puppet/type/component.rb +1 -7
- data/lib/puppet/type/cron.rb +0 -0
- data/lib/puppet/type/exec.rb +13 -1
- data/lib/puppet/type/file.rb +19 -10
- data/lib/puppet/type/file/checksum.rb +0 -0
- data/lib/puppet/type/file/content.rb +3 -0
- data/lib/puppet/type/file/ensure.rb +33 -15
- data/lib/puppet/type/file/group.rb +0 -0
- data/lib/puppet/type/file/mode.rb +6 -2
- data/lib/puppet/type/file/owner.rb +0 -0
- data/lib/puppet/type/file/source.rb +65 -14
- data/lib/puppet/type/file/target.rb +6 -6
- data/lib/puppet/type/file/type.rb +0 -0
- data/lib/puppet/type/filebucket.rb +0 -0
- data/lib/puppet/type/group.rb +18 -0
- data/lib/puppet/type/host.rb +0 -0
- data/lib/puppet/type/k5login.rb +4 -4
- data/lib/puppet/type/mailalias.rb +0 -0
- data/lib/puppet/type/maillist.rb +0 -0
- data/lib/puppet/type/mount.rb +15 -1
- data/lib/puppet/type/package.rb +7 -1
- data/lib/puppet/type/port.rb +0 -0
- data/lib/puppet/type/schedule.rb +9 -4
- data/lib/puppet/type/service.rb +1 -1
- data/lib/puppet/type/sshkey.rb +0 -0
- data/lib/puppet/type/tidy.rb +1 -1
- data/lib/puppet/type/user.rb +3 -0
- data/lib/puppet/type/yumrepo.rb +8 -6
- data/lib/puppet/type/zpool.rb +0 -0
- data/lib/puppet/util.rb +4 -31
- data/lib/puppet/util/adsi.rb +73 -17
- data/lib/puppet/util/autoload.rb +3 -3
- data/lib/puppet/util/backups.rb +4 -4
- data/lib/puppet/util/cacher.rb +7 -13
- data/lib/puppet/util/checksums.rb +2 -2
- data/lib/puppet/util/classgen.rb +3 -1
- data/lib/puppet/util/colors.rb +1 -0
- data/lib/puppet/util/command_line.rb +5 -0
- data/lib/puppet/util/docs.rb +33 -27
- data/lib/puppet/util/execution.rb +42 -18
- data/lib/puppet/util/filetype.rb +3 -3
- data/lib/puppet/util/instance_loader.rb +2 -2
- data/lib/puppet/util/instrumentation.rb +23 -42
- data/lib/puppet/util/instrumentation/data.rb +11 -4
- data/lib/puppet/util/instrumentation/indirection_probe.rb +11 -4
- data/lib/puppet/util/instrumentation/instrumentable.rb +7 -14
- data/lib/puppet/util/instrumentation/listener.rb +15 -8
- data/lib/puppet/util/instrumentation/listeners/log.rb +4 -10
- data/lib/puppet/util/instrumentation/listeners/performance.rb +8 -14
- data/lib/puppet/util/limits.rb +12 -0
- data/lib/puppet/util/lockfile.rb +2 -2
- data/lib/puppet/util/log.rb +14 -6
- data/lib/puppet/util/log/destinations.rb +23 -1
- data/lib/puppet/util/metric.rb +9 -3
- data/lib/puppet/util/monkey_patches.rb +7 -2
- data/lib/puppet/util/network_device/config.rb +1 -1
- data/lib/puppet/util/plugins.rb +1 -1
- data/lib/puppet/util/posix.rb +0 -0
- data/lib/puppet/util/profiler.rb +7 -2
- data/lib/puppet/util/provider_features.rb +2 -2
- data/lib/puppet/util/rdoc.rb +28 -30
- data/lib/puppet/util/rdoc/code_objects.rb +75 -25
- data/lib/puppet/util/rdoc/generators/puppet_generator.rb +1 -1
- data/lib/puppet/util/rdoc/parser.rb +12 -487
- data/lib/puppet/util/rdoc/parser/puppet_parser_core.rb +477 -0
- data/lib/puppet/util/rdoc/parser/puppet_parser_rdoc1.rb +19 -0
- data/lib/puppet/util/rdoc/parser/puppet_parser_rdoc2.rb +14 -0
- data/lib/puppet/util/reference.rb +1 -1
- data/lib/puppet/util/resource_template.rb +1 -1
- data/lib/puppet/util/selinux.rb +1 -1
- data/lib/puppet/util/storage.rb +2 -2
- data/lib/puppet/util/suidmanager.rb +1 -1
- data/lib/puppet/util/tag_set.rb +29 -0
- data/lib/puppet/util/tagging.rb +8 -24
- data/lib/puppet/util/watched_file.rb +1 -1
- data/lib/puppet/util/watcher.rb +1 -1
- data/lib/puppet/util/windows.rb +3 -0
- data/lib/puppet/util/windows/access_control_entry.rb +84 -0
- data/lib/puppet/util/windows/access_control_list.rb +106 -0
- data/lib/puppet/util/windows/file.rb +213 -0
- data/lib/puppet/util/windows/process.rb +199 -0
- data/lib/puppet/util/windows/root_certs.rb +52 -37
- data/lib/puppet/util/windows/security.rb +270 -245
- data/lib/puppet/util/windows/security_descriptor.rb +62 -0
- data/lib/puppet/util/windows/sid.rb +26 -4
- data/lib/puppet/version.rb +2 -2
- data/spec/fixtures/releases/jamtur01-apache/lib/puppet/provider/a2mod/debian.rb +1 -1
- data/spec/fixtures/unit/indirector/{hiera → data_binding/hiera}/global.yaml +0 -0
- data/spec/fixtures/unit/indirector/data_binding/hiera/invalid.yaml +1 -0
- data/spec/fixtures/unit/module/trailing-comma.json +24 -0
- data/spec/fixtures/unit/util/monkey_patches/x509.pem +32 -0
- data/spec/integration/application/apply_spec.rb +1 -1
- data/spec/integration/application/doc_spec.rb +1 -1
- data/spec/integration/configurer_spec.rb +4 -2
- data/spec/integration/data_binding.rb +100 -0
- data/spec/integration/indirector/catalog/compiler_spec.rb +16 -13
- data/spec/integration/indirector/direct_file_server_spec.rb +3 -5
- data/spec/integration/indirector/file_content/file_server_spec.rb +2 -2
- data/spec/integration/node/facts_spec.rb +1 -1
- data/spec/integration/node_spec.rb +1 -1
- data/spec/integration/parser/compiler_spec.rb +90 -0
- data/spec/integration/parser/parser_spec.rb +2 -2
- data/spec/integration/provider/cron/crontab_spec.rb +3 -5
- data/spec/integration/resource/catalog_spec.rb +1 -1
- data/spec/integration/ssl/autosign_spec.rb +90 -0
- data/spec/integration/ssl/certificate_authority_spec.rb +62 -69
- data/spec/integration/ssl/certificate_revocation_list_spec.rb +1 -1
- data/spec/integration/ssl/host_spec.rb +1 -1
- data/spec/integration/transaction_spec.rb +13 -13
- data/spec/integration/type/exec_spec.rb +2 -2
- data/spec/integration/type/file_spec.rb +287 -45
- data/spec/integration/type/tidy_spec.rb +3 -3
- data/spec/integration/util/rdoc/parser_spec.rb +236 -35
- data/spec/integration/util/settings_spec.rb +1 -1
- data/spec/integration/util/windows/process_spec.rb +22 -0
- data/spec/integration/util/windows/security_spec.rb +316 -106
- data/spec/lib/matchers/containment_matchers.rb +52 -0
- data/spec/lib/puppet_spec/compiler.rb +6 -0
- data/spec/lib/puppet_spec/files.rb +20 -21
- data/spec/shared_behaviours/documentation_on_faces.rb +3 -3
- data/spec/shared_behaviours/file_server_terminus.rb +2 -2
- data/spec/shared_contexts/platform.rb +1 -0
- data/spec/spec_helper.rb +13 -1
- data/spec/unit/agent_spec.rb +0 -12
- data/spec/unit/application/agent_spec.rb +4 -4
- data/spec/unit/application/apply_spec.rb +18 -2
- data/spec/unit/application/cert_spec.rb +8 -6
- data/spec/unit/application/device_spec.rb +1 -1
- data/spec/unit/application/filebucket_spec.rb +1 -1
- data/spec/unit/application/inspect_spec.rb +1 -1
- data/spec/unit/application_spec.rb +24 -0
- data/spec/unit/configurer/downloader_spec.rb +8 -7
- data/spec/unit/configurer/fact_handler_spec.rb +23 -0
- data/spec/unit/configurer/plugin_handler_spec.rb +7 -2
- data/spec/unit/configurer_spec.rb +15 -5
- data/spec/unit/{provider/confine → confine}/exists_spec.rb +12 -12
- data/spec/unit/{provider/confine → confine}/false_spec.rb +9 -9
- data/spec/unit/{provider/confine → confine}/feature_spec.rb +10 -10
- data/spec/unit/{provider/confine → confine}/true_spec.rb +7 -7
- data/spec/unit/{provider/confine → confine}/variable_spec.rb +16 -16
- data/spec/unit/{provider/confine_collection_spec.rb → confine_collection_spec.rb} +30 -30
- data/spec/unit/{provider/confine_spec.rb → confine_spec.rb} +11 -11
- data/spec/unit/{provider/confiner_spec.rb → confiner_spec.rb} +4 -4
- data/spec/unit/face/parser_spec.rb +54 -0
- data/spec/unit/file_bucket/dipper_spec.rb +2 -2
- data/spec/unit/file_serving/base_spec.rb +32 -9
- data/spec/unit/file_serving/configuration_spec.rb +7 -7
- data/spec/unit/file_serving/content_spec.rb +12 -7
- data/spec/unit/file_serving/fileset_spec.rb +57 -27
- data/spec/unit/file_serving/metadata_spec.rb +74 -12
- data/spec/unit/file_serving/mount/file_spec.rb +10 -10
- data/spec/unit/file_serving/mount/pluginfacts_spec.rb +73 -0
- data/spec/unit/file_system/file_spec.rb +486 -0
- data/spec/unit/file_system/tempfile_spec.rb +48 -0
- data/spec/unit/graph/relationship_graph_spec.rb +0 -6
- data/spec/unit/hiera_puppet_spec.rb +2 -2
- data/spec/unit/indirector/catalog/compiler_spec.rb +15 -19
- data/spec/unit/indirector/certificate_status/file_spec.rb +30 -40
- data/spec/unit/indirector/data_binding/hiera_spec.rb +95 -2
- data/spec/unit/indirector/direct_file_server_spec.rb +6 -6
- data/spec/unit/indirector/facts/facter_spec.rb +33 -0
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +61 -52
- data/spec/unit/indirector/file_metadata/file_spec.rb +2 -2
- data/spec/unit/indirector/file_server_spec.rb +4 -4
- data/spec/unit/indirector/json_spec.rb +4 -4
- data/spec/unit/indirector/key/file_spec.rb +13 -14
- data/spec/unit/indirector/resource/ral_spec.rb +7 -0
- data/spec/unit/indirector/resource/store_configs_spec.rb +11 -0
- data/spec/unit/indirector/rest_spec.rb +7 -3
- data/spec/unit/indirector/ssl_file_spec.rb +14 -17
- data/spec/unit/indirector/yaml_spec.rb +4 -4
- data/spec/unit/module_spec.rb +43 -15
- data/spec/unit/module_tool/tar/gnu_spec.rb +2 -2
- data/spec/unit/module_tool/tar/solaris_spec.rb +2 -2
- data/spec/unit/module_tool/tar_spec.rb +45 -0
- data/spec/unit/network/authconfig_spec.rb +2 -1
- data/spec/unit/network/authentication_spec.rb +2 -2
- data/spec/unit/network/format_handler_spec.rb +2 -2
- data/spec/unit/network/formats_spec.rb +24 -0
- data/spec/unit/network/http/connection_spec.rb +76 -199
- data/spec/unit/network/http/handler_spec.rb +33 -34
- data/spec/unit/network/http_pool_spec.rb +8 -5
- data/spec/unit/node/environment_spec.rb +76 -90
- data/spec/unit/node/facts_spec.rb +20 -3
- data/spec/unit/node_spec.rb +43 -0
- data/spec/unit/parameter/boolean_spec.rb +22 -12
- data/spec/unit/parser/ast/resourceparam_spec.rb +51 -0
- data/spec/unit/parser/compiler_spec.rb +103 -35
- data/spec/unit/parser/eparser_adapter_spec.rb +12 -12
- data/spec/unit/parser/files_spec.rb +11 -11
- data/spec/unit/parser/functions/contain_spec.rb +185 -0
- data/spec/unit/parser/functions/create_resources_spec.rb +13 -5
- data/spec/unit/parser/functions/generate_spec.rb +1 -1
- data/spec/unit/parser/functions_spec.rb +2 -2
- data/spec/unit/parser/lexer_spec.rb +1 -1
- data/spec/unit/parser/methods/each_spec.rb +1 -1
- data/spec/unit/parser/methods/{select_spec.rb → filter_spec.rb} +11 -11
- data/spec/unit/parser/methods/map_spec.rb +95 -0
- data/spec/unit/parser/methods/reduce_spec.rb +12 -11
- data/spec/unit/parser/methods/shared.rb +5 -5
- data/spec/unit/parser/methods/slice_spec.rb +13 -13
- data/spec/unit/parser/parser_spec.rb +1 -1
- data/spec/unit/parser/resource/param_spec.rb +44 -0
- data/spec/unit/parser/resource_spec.rb +16 -15
- data/spec/unit/pops/model/ast_transformer_spec.rb +18 -4
- data/spec/unit/pops/parser/lexer_spec.rb +22 -5
- data/spec/unit/pops/parser/parse_calls_spec.rb +5 -5
- data/spec/unit/pops/transformer/transform_calls_spec.rb +6 -6
- data/spec/unit/pops/transformer/transform_containers_spec.rb +2 -2
- data/spec/unit/pops/validator/validator_spec.rb +31 -0
- data/spec/unit/provider/augeas/augeas_spec.rb +57 -2
- data/spec/unit/provider/exec/posix_spec.rb +8 -3
- data/spec/unit/provider/file/posix_spec.rb +2 -2
- data/spec/unit/provider/group/windows_adsi_spec.rb +70 -3
- data/spec/unit/provider/nameservice/directoryservice_spec.rb +3 -3
- data/spec/unit/provider/package/apt_spec.rb +1 -1
- data/spec/unit/provider/package/msi_spec.rb +15 -42
- data/spec/unit/provider/package/openbsd_spec.rb +3 -3
- data/spec/unit/provider/package/rpm_spec.rb +56 -13
- data/spec/unit/provider/package/windows_spec.rb +15 -19
- data/spec/unit/provider/service/base_spec.rb +1 -1
- data/spec/unit/provider/service/daemontools_spec.rb +18 -8
- data/spec/unit/provider/service/freebsd_spec.rb +3 -3
- data/spec/unit/provider/service/gentoo_spec.rb +5 -2
- data/spec/unit/provider/service/init_spec.rb +17 -17
- data/spec/unit/provider/service/launchd_spec.rb +76 -23
- data/spec/unit/provider/service/openbsd_spec.rb +125 -0
- data/spec/unit/provider/service/openwrt_spec.rb +1 -1
- data/spec/unit/provider/service/runit_spec.rb +12 -5
- data/spec/unit/provider/service/upstart_spec.rb +4 -4
- data/spec/unit/provider/ssh_authorized_key/parsed_spec.rb +5 -5
- data/spec/unit/provider/user/directoryservice_spec.rb +4 -4
- data/spec/unit/provider/zone/solaris_spec.rb +1 -1
- data/spec/unit/provider_spec.rb +2 -2
- data/spec/unit/reports/http_spec.rb +19 -34
- data/spec/unit/reports/store_spec.rb +2 -2
- data/spec/unit/resource/catalog_spec.rb +81 -11
- data/spec/unit/resource/status_spec.rb +11 -1
- data/spec/unit/resource/type_spec.rb +30 -1
- data/spec/unit/resource_spec.rb +40 -4
- data/spec/unit/settings/file_setting_spec.rb +2 -2
- data/spec/unit/settings/path_setting_spec.rb +2 -2
- data/spec/unit/settings/priority_setting_spec.rb +66 -0
- data/spec/unit/settings_spec.rb +16 -31
- data/spec/unit/ssl/certificate_authority/autosign_command_spec.rb +30 -0
- data/spec/unit/ssl/certificate_authority_spec.rb +129 -134
- data/spec/unit/ssl/certificate_factory_spec.rb +18 -0
- data/spec/unit/ssl/certificate_request_attributes_spec.rb +61 -0
- data/spec/unit/ssl/certificate_request_spec.rb +103 -0
- data/spec/unit/ssl/certificate_spec.rb +31 -18
- data/spec/unit/ssl/host_spec.rb +34 -8
- data/spec/unit/ssl/inventory_spec.rb +27 -62
- data/spec/unit/ssl/key_spec.rb +4 -4
- data/spec/unit/ssl/oids_spec.rb +48 -0
- data/spec/unit/ssl/validator_spec.rb +49 -6
- data/spec/unit/status_spec.rb +9 -0
- data/spec/unit/transaction/event_spec.rb +1 -9
- data/spec/unit/transaction/report_spec.rb +20 -1
- data/spec/unit/transaction/resource_harness_spec.rb +60 -210
- data/spec/unit/transaction_spec.rb +54 -8
- data/spec/unit/type/component_spec.rb +2 -2
- data/spec/unit/type/exec_spec.rb +14 -7
- data/spec/unit/type/file/content_spec.rb +13 -2
- data/spec/unit/type/file/ctime_spec.rb +1 -1
- data/spec/unit/type/file/mode_spec.rb +48 -2
- data/spec/unit/type/file/mtime_spec.rb +1 -1
- data/spec/unit/type/file/source_spec.rb +177 -7
- data/spec/unit/type/file_spec.rb +63 -71
- data/spec/unit/type/group_spec.rb +20 -0
- data/spec/unit/type/k5login_spec.rb +3 -3
- data/spec/unit/type/mount_spec.rb +53 -0
- data/spec/unit/type/nagios_spec.rb +216 -0
- data/spec/unit/type/package_spec.rb +7 -1
- data/spec/unit/type/schedule_spec.rb +6 -0
- data/spec/unit/type/service_spec.rb +3 -3
- data/spec/unit/type/tidy_spec.rb +14 -14
- data/spec/unit/type/user_spec.rb +9 -0
- data/spec/unit/type_spec.rb +86 -4
- data/spec/unit/util/adsi_spec.rb +120 -12
- data/spec/unit/util/autoload_spec.rb +14 -14
- data/spec/unit/util/backups_spec.rb +29 -21
- data/spec/unit/util/checksums_spec.rb +2 -1
- data/spec/unit/util/command_line_spec.rb +41 -0
- data/spec/unit/util/docs_spec.rb +91 -0
- data/spec/unit/util/execution_spec.rb +26 -2
- data/spec/unit/util/filetype_spec.rb +7 -7
- data/spec/unit/util/lockfile_spec.rb +2 -2
- data/spec/unit/util/log/destinations_spec.rb +32 -0
- data/spec/unit/util/monkey_patches_spec.rb +41 -0
- data/spec/unit/util/pidlock_spec.rb +6 -6
- data/spec/unit/util/rdoc/parser_spec.rb +15 -13
- data/spec/unit/util/rdoc_spec.rb +18 -24
- data/spec/unit/util/resource_template_spec.rb +3 -3
- data/spec/unit/util/selinux_spec.rb +4 -2
- data/spec/unit/util/storage_spec.rb +4 -4
- data/spec/unit/util/suidmanager_spec.rb +7 -0
- data/spec/unit/util/tag_set_spec.rb +46 -0
- data/spec/unit/util/tagging_spec.rb +82 -45
- data/spec/unit/util/watcher_spec.rb +4 -1
- data/spec/unit/util/windows/access_control_entry_spec.rb +67 -0
- data/spec/unit/util/windows/access_control_list_spec.rb +133 -0
- data/spec/unit/util/windows/root_certs_spec.rb +10 -8
- data/spec/unit/util/windows/security_descriptor_spec.rb +117 -0
- data/spec/unit/util/windows/sid_spec.rb +69 -0
- data/spec/unit/util_spec.rb +7 -7
- data/tasks/ci.rake +17 -36
- metadata +2811 -2746
- checksums.yaml +0 -7
- data/examples/mac_automount.pp +0 -16
- data/examples/mcx_dock_absent.pp +0 -4
- data/examples/mcx_dock_default.pp +0 -118
- data/examples/mcx_dock_full.pp +0 -125
- data/examples/mcx_dock_invalid.pp +0 -9
- data/examples/mcx_nogroup.pp +0 -118
- data/examples/mcx_notexists_absent.pp +0 -4
- data/ext/rack/README +0 -58
- data/ext/rack/manifest.pp +0 -59
- data/lib/puppet/external/lock.rb +0 -63
- data/lib/puppet/indirector/hiera.rb +0 -39
- data/lib/puppet/parser/functions/foreach.rb +0 -95
- data/spec/integration/network/server/webrick_spec.rb +0 -76
- data/spec/integration/parser/functions_spec.rb +0 -16
- data/spec/unit/indirector/hiera_spec.rb +0 -154
- data/spec/unit/parser/methods/collect_spec.rb +0 -153
- data/spec/unit/parser/methods/foreach_spec.rb +0 -91
- data/spec/unit/parser/methods/reject_spec.rb +0 -73
- data/spec/unit/resource/resource_type.json +0 -34
@@ -149,15 +149,15 @@ describe Puppet::Indirector::Yaml do
|
|
149
149
|
end
|
150
150
|
|
151
151
|
it "should unlink the right yaml file if it exists" do
|
152
|
-
File.expects(:
|
153
|
-
File.expects(:unlink).with(path)
|
152
|
+
Puppet::FileSystem::File.expects(:exist?).with(path).returns true
|
153
|
+
Puppet::FileSystem::File.expects(:unlink).with(path)
|
154
154
|
|
155
155
|
@store.destroy(@request)
|
156
156
|
end
|
157
157
|
|
158
158
|
it "should not unlink the yaml file if it does not exists" do
|
159
|
-
File.expects(:
|
160
|
-
File.expects(:unlink).with(path).never
|
159
|
+
Puppet::FileSystem::File.expects(:exist?).with(path).returns false
|
160
|
+
Puppet::FileSystem::File.expects(:unlink).with(path).never
|
161
161
|
|
162
162
|
@store.destroy(@request)
|
163
163
|
end
|
data/spec/unit/module_spec.rb
CHANGED
@@ -15,7 +15,7 @@ describe Puppet::Module do
|
|
15
15
|
before do
|
16
16
|
# This is necessary because of the extra checks we have for the deprecated
|
17
17
|
# 'plugins' directory
|
18
|
-
|
18
|
+
Puppet::FileSystem::File.stubs(:exist?).returns false
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should have a class method that returns a named module from a given environment" do
|
@@ -90,12 +90,14 @@ describe Puppet::Module do
|
|
90
90
|
|
91
91
|
describe "when finding unmet dependencies" do
|
92
92
|
before do
|
93
|
-
|
93
|
+
Puppet::FileSystem::File.unstub(:exist?)
|
94
94
|
@modpath = tmpdir('modpath')
|
95
95
|
Puppet.settings[:modulepath] = @modpath
|
96
96
|
end
|
97
97
|
|
98
98
|
it "should list modules that are missing" do
|
99
|
+
metadata_file = "#{@modpath}/needy/metadata.json"
|
100
|
+
Puppet::FileSystem::File.expects(:exist?).twice.with(metadata_file).returns true
|
99
101
|
mod = PuppetSpec::Modules.create(
|
100
102
|
'needy',
|
101
103
|
@modpath,
|
@@ -116,6 +118,8 @@ describe Puppet::Module do
|
|
116
118
|
end
|
117
119
|
|
118
120
|
it "should list modules that are missing and have invalid names" do
|
121
|
+
metadata_file = "#{@modpath}/needy/metadata.json"
|
122
|
+
Puppet::FileSystem::File.expects(:exist?).with(metadata_file).twice.returns true
|
119
123
|
mod = PuppetSpec::Modules.create(
|
120
124
|
'needy',
|
121
125
|
@modpath,
|
@@ -136,6 +140,10 @@ describe Puppet::Module do
|
|
136
140
|
end
|
137
141
|
|
138
142
|
it "should list modules with unmet version requirement" do
|
143
|
+
['foobar', 'foobaz'].each do |mod_name|
|
144
|
+
metadata_file = "#{@modpath}/#{mod_name}/metadata.json"
|
145
|
+
Puppet::FileSystem::File.stubs(:exist?).with(metadata_file).returns true
|
146
|
+
end
|
139
147
|
mod = PuppetSpec::Modules.create(
|
140
148
|
'foobar',
|
141
149
|
@modpath,
|
@@ -204,6 +212,8 @@ describe Puppet::Module do
|
|
204
212
|
end
|
205
213
|
|
206
214
|
it "should consider a dependency without a semantic version to be unmet" do
|
215
|
+
metadata_file = "#{@modpath}/foobar/metadata.json"
|
216
|
+
Puppet::FileSystem::File.expects(:exist?).with(metadata_file).times(3).returns true
|
207
217
|
mod = PuppetSpec::Modules.create(
|
208
218
|
'foobar',
|
209
219
|
@modpath,
|
@@ -244,6 +254,10 @@ describe Puppet::Module do
|
|
244
254
|
end
|
245
255
|
|
246
256
|
it "should only list unmet dependencies" do
|
257
|
+
[name, 'satisfied'].each do |mod_name|
|
258
|
+
metadata_file = "#{@modpath}/#{mod_name}/metadata.json"
|
259
|
+
Puppet::FileSystem::File.expects(:exist?).with(metadata_file).twice.returns true
|
260
|
+
end
|
247
261
|
mod = PuppetSpec::Modules.create(
|
248
262
|
name,
|
249
263
|
@modpath,
|
@@ -357,35 +371,42 @@ describe Puppet::Module do
|
|
357
371
|
end
|
358
372
|
end
|
359
373
|
|
360
|
-
[:plugins, :templates, :files, :manifests].each do |filetype|
|
361
|
-
|
374
|
+
[:plugins, :pluginfacts, :templates, :files, :manifests].each do |filetype|
|
375
|
+
case filetype
|
376
|
+
when :plugins
|
377
|
+
dirname = "lib"
|
378
|
+
when :pluginfacts
|
379
|
+
dirname = "facts.d"
|
380
|
+
else
|
381
|
+
dirname = filetype.to_s
|
382
|
+
end
|
362
383
|
it "should be able to return individual #{filetype}" do
|
363
384
|
module_file = File.join(path, dirname, "my/file")
|
364
|
-
|
385
|
+
Puppet::FileSystem::File.expects(:exist?).with(module_file).returns true
|
365
386
|
mod.send(filetype.to_s.sub(/s$/, ''), "my/file").should == module_file
|
366
387
|
end
|
367
388
|
|
368
389
|
it "should consider #{filetype} to be present if their base directory exists" do
|
369
390
|
module_file = File.join(path, dirname)
|
370
|
-
|
391
|
+
Puppet::FileSystem::File.expects(:exist?).with(module_file).returns true
|
371
392
|
mod.send(filetype.to_s + "?").should be_true
|
372
393
|
end
|
373
394
|
|
374
395
|
it "should consider #{filetype} to be absent if their base directory does not exist" do
|
375
396
|
module_file = File.join(path, dirname)
|
376
|
-
|
397
|
+
Puppet::FileSystem::File.expects(:exist?).with(module_file).returns false
|
377
398
|
mod.send(filetype.to_s + "?").should be_false
|
378
399
|
end
|
379
400
|
|
380
401
|
it "should return nil if asked to return individual #{filetype} that don't exist" do
|
381
402
|
module_file = File.join(path, dirname, "my/file")
|
382
|
-
|
403
|
+
Puppet::FileSystem::File.expects(:exist?).with(module_file).returns false
|
383
404
|
mod.send(filetype.to_s.sub(/s$/, ''), "my/file").should be_nil
|
384
405
|
end
|
385
406
|
|
386
407
|
it "should return the base directory if asked for a nil path" do
|
387
408
|
base = File.join(path, dirname)
|
388
|
-
|
409
|
+
Puppet::FileSystem::File.expects(:exist?).with(base).returns true
|
389
410
|
mod.send(filetype.to_s.sub(/s$/, ''), nil).should == base
|
390
411
|
end
|
391
412
|
end
|
@@ -418,8 +439,8 @@ describe Puppet::Module, "when finding matching manifests" do
|
|
418
439
|
end
|
419
440
|
|
420
441
|
it "should default to the 'init' file if no glob pattern is specified" do
|
421
|
-
|
422
|
-
|
442
|
+
Puppet::FileSystem::File.expects(:exist?).with("/a/manifests/init.pp").returns(true)
|
443
|
+
Puppet::FileSystem::File.expects(:exist?).with("/a/manifests/init.rb").returns(false)
|
423
444
|
|
424
445
|
@mod.match_manifests(nil).should == %w{/a/manifests/init.pp}
|
425
446
|
end
|
@@ -471,21 +492,21 @@ describe Puppet::Module do
|
|
471
492
|
end
|
472
493
|
|
473
494
|
it "should have metadata if it has a metadata file and its data is not empty" do
|
474
|
-
|
495
|
+
Puppet::FileSystem::File.expects(:exist?).with(@module.metadata_file).returns true
|
475
496
|
File.stubs(:read).with(@module.metadata_file).returns "{\"foo\" : \"bar\"}"
|
476
497
|
|
477
498
|
@module.should be_has_metadata
|
478
499
|
end
|
479
500
|
|
480
501
|
it "should have metadata if it has a metadata file and its data is not empty" do
|
481
|
-
|
502
|
+
Puppet::FileSystem::File.expects(:exist?).with(@module.metadata_file).returns true
|
482
503
|
File.stubs(:read).with(@module.metadata_file).returns "{\"foo\" : \"bar\"}"
|
483
504
|
|
484
505
|
@module.should be_has_metadata
|
485
506
|
end
|
486
507
|
|
487
508
|
it "should not have metadata if has a metadata file and its data is empty" do
|
488
|
-
|
509
|
+
Puppet::FileSystem::File.expects(:exist?).with(@module.metadata_file).returns true
|
489
510
|
File.stubs(:read).with(@module.metadata_file).returns "/*
|
490
511
|
+-----------------------------------------------------------------------+
|
491
512
|
| |
|
@@ -503,7 +524,7 @@ describe Puppet::Module do
|
|
503
524
|
end
|
504
525
|
|
505
526
|
it "should know if it is missing a metadata file" do
|
506
|
-
|
527
|
+
Puppet::FileSystem::File.expects(:exist?).with(@module.metadata_file).returns false
|
507
528
|
|
508
529
|
@module.should_not be_has_metadata
|
509
530
|
end
|
@@ -519,6 +540,13 @@ describe Puppet::Module do
|
|
519
540
|
Puppet::Module.new("yay", "/path", mock("env"))
|
520
541
|
end
|
521
542
|
|
543
|
+
it "should tolerate failure to parse" do
|
544
|
+
Puppet::FileSystem::File.expects(:exist?).with(@module.metadata_file).returns true
|
545
|
+
File.stubs(:read).with(@module.metadata_file).returns(my_fixture('trailing-comma.json'))
|
546
|
+
|
547
|
+
@module.has_metadata?.should be_false
|
548
|
+
end
|
549
|
+
|
522
550
|
def a_module_with_metadata(data)
|
523
551
|
text = data.to_pson
|
524
552
|
|
@@ -8,9 +8,9 @@ describe Puppet::ModuleTool::Tar::Gnu do
|
|
8
8
|
let(:destfile) { '/the/dest/file.tar.gz' }
|
9
9
|
|
10
10
|
it "unpacks a tar file" do
|
11
|
-
Puppet::Util::Execution.expects(:execute).with("tar xzf #{sourcefile} --no-same-
|
11
|
+
Puppet::Util::Execution.expects(:execute).with("tar xzf #{sourcefile} --no-same-owner -C #{destdir}")
|
12
12
|
Puppet::Util::Execution.expects(:execute).with("find #{destdir} -type d -exec chmod 755 {} +")
|
13
|
-
Puppet::Util::Execution.expects(:execute).with("find #{destdir} -type f -exec chmod
|
13
|
+
Puppet::Util::Execution.expects(:execute).with("find #{destdir} -type f -exec chmod a-wst {} +")
|
14
14
|
Puppet::Util::Execution.expects(:execute).with("chown -R <owner:group> #{destdir}")
|
15
15
|
subject.unpack(sourcefile, destdir, '<owner:group>')
|
16
16
|
end
|
@@ -8,9 +8,9 @@ describe Puppet::ModuleTool::Tar::Solaris do
|
|
8
8
|
let(:destfile) { '/the/dest/file.tar.gz' }
|
9
9
|
|
10
10
|
it "unpacks a tar file" do
|
11
|
-
Puppet::Util::Execution.expects(:execute).with("gtar xzf #{sourcefile} --no-same-
|
11
|
+
Puppet::Util::Execution.expects(:execute).with("gtar xzf #{sourcefile} --no-same-owner -C #{destdir}")
|
12
12
|
Puppet::Util::Execution.expects(:execute).with("find #{destdir} -type d -exec chmod 755 {} +")
|
13
|
-
Puppet::Util::Execution.expects(:execute).with("find #{destdir} -type f -exec chmod
|
13
|
+
Puppet::Util::Execution.expects(:execute).with("find #{destdir} -type f -exec chmod a-wst {} +")
|
14
14
|
Puppet::Util::Execution.expects(:execute).with("chown -R <owner:group> #{destdir}")
|
15
15
|
subject.unpack(sourcefile, destdir, '<owner:group>')
|
16
16
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'puppet/module_tool/tar'
|
3
|
+
|
4
|
+
describe Puppet::ModuleTool::Tar do
|
5
|
+
|
6
|
+
it "uses gtar when present on Solaris" do
|
7
|
+
Facter.stubs(:value).with('osfamily').returns 'Solaris'
|
8
|
+
Puppet::Util.stubs(:which).with('gtar').returns '/usr/bin/gtar'
|
9
|
+
|
10
|
+
described_class.instance(nil).should be_a_kind_of Puppet::ModuleTool::Tar::Solaris
|
11
|
+
end
|
12
|
+
|
13
|
+
it "uses gtar when present on OpenBSD" do
|
14
|
+
Facter.stubs(:value).with('osfamily').returns 'OpenBSD'
|
15
|
+
Puppet::Util.stubs(:which).with('gtar').returns '/usr/bin/gtar'
|
16
|
+
|
17
|
+
described_class.instance(nil).should be_a_kind_of Puppet::ModuleTool::Tar::Solaris
|
18
|
+
end
|
19
|
+
|
20
|
+
it "uses tar when present and not on Windows" do
|
21
|
+
Facter.stubs(:value).with('osfamily').returns 'ObscureLinuxDistro'
|
22
|
+
Puppet::Util.stubs(:which).with('tar').returns '/usr/bin/tar'
|
23
|
+
Puppet::Util::Platform.stubs(:windows?).returns false
|
24
|
+
|
25
|
+
described_class.instance(nil).should be_a_kind_of Puppet::ModuleTool::Tar::Gnu
|
26
|
+
end
|
27
|
+
|
28
|
+
it "falls back to minitar when it and zlib are present" do
|
29
|
+
Facter.stubs(:value).with('osfamily').returns 'Windows'
|
30
|
+
Puppet::Util.stubs(:which).with('tar')
|
31
|
+
Puppet::Util::Platform.stubs(:windows?).returns true
|
32
|
+
Puppet.stubs(:features).returns(stub(:minitar? => true, :zlib? => true))
|
33
|
+
|
34
|
+
described_class.instance(nil).should be_a_kind_of Puppet::ModuleTool::Tar::Mini
|
35
|
+
end
|
36
|
+
|
37
|
+
it "fails when there is no possible implementation" do
|
38
|
+
Facter.stubs(:value).with('osfamily').returns 'Windows'
|
39
|
+
Puppet::Util.stubs(:which).with('tar')
|
40
|
+
Puppet::Util::Platform.stubs(:windows?).returns true
|
41
|
+
Puppet.stubs(:features).returns(stub(:minitar? => false, :zlib? => false))
|
42
|
+
|
43
|
+
expect { described_class.instance(nil) }.to raise_error RuntimeError, /No suitable tar/
|
44
|
+
end
|
45
|
+
end
|
@@ -5,7 +5,8 @@ require 'puppet/network/authconfig'
|
|
5
5
|
|
6
6
|
describe Puppet::Network::AuthConfig do
|
7
7
|
before :each do
|
8
|
-
|
8
|
+
stub_file = stub('file', :stat => stub('stat', :ctime => :now))
|
9
|
+
Puppet::FileSystem::File.stubs(:new).returns stub_file
|
9
10
|
Time.stubs(:now).returns Time.now
|
10
11
|
|
11
12
|
Puppet::Network::AuthConfig.any_instance.stubs(:exists?).returns(true)
|
@@ -20,7 +20,7 @@ describe Puppet::Network::Authentication do
|
|
20
20
|
describe "when warning about upcoming expirations" do
|
21
21
|
before do
|
22
22
|
Puppet::SSL::CertificateAuthority.stubs(:ca?).returns(false)
|
23
|
-
|
23
|
+
Puppet::FileSystem::File.stubs(:exist?).returns(false)
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should check the expiration of the CA certificate" do
|
@@ -34,7 +34,7 @@ describe Puppet::Network::Authentication do
|
|
34
34
|
it "should check the expiration of the localhost certificate" do
|
35
35
|
Puppet::SSL::Host.stubs(:localhost).returns(host)
|
36
36
|
cert.expects(:near_expiration?).returns(false)
|
37
|
-
|
37
|
+
Puppet::FileSystem::File.stubs(:exist?).with(Puppet[:hostcert]).returns(true)
|
38
38
|
subject.warn_if_near_expiration
|
39
39
|
end
|
40
40
|
|
@@ -63,8 +63,8 @@ describe Puppet::Network::FormatHandler do
|
|
63
63
|
Puppet::Network::FormatHandler.most_suitable_format_for(accepted, [:one, :two])
|
64
64
|
end
|
65
65
|
|
66
|
-
it "finds
|
67
|
-
|
66
|
+
it "finds the most preferred format when anything is acceptable" do
|
67
|
+
Puppet::Network::FormatHandler.most_suitable_format_for(["*/*"], [:two, :one]).should == format_two
|
68
68
|
end
|
69
69
|
|
70
70
|
it "finds no format when none are acceptable" do
|
@@ -26,6 +26,30 @@ class PsonTest
|
|
26
26
|
end
|
27
27
|
|
28
28
|
describe "Puppet Network Format" do
|
29
|
+
it "should include a msgpack format", :if => Puppet.features.msgpack? do
|
30
|
+
Puppet::Network::FormatHandler.format(:msgpack).should_not be_nil
|
31
|
+
end
|
32
|
+
|
33
|
+
describe "msgpack", :if => Puppet.features.msgpack? do
|
34
|
+
before do
|
35
|
+
@msgpack = Puppet::Network::FormatHandler.format(:msgpack)
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should have its mime type set to application/x-msgpack" do
|
39
|
+
@msgpack.mime.should == "application/x-msgpack"
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should have a weight of 20" do
|
43
|
+
@msgpack.weight.should == 20
|
44
|
+
end
|
45
|
+
|
46
|
+
it "should fail when one element does not have a from_pson" do
|
47
|
+
expect do
|
48
|
+
@msgpack.intern_multiple(Hash, MessagePack.pack(["foo"]))
|
49
|
+
end.to raise_error(NoMethodError)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
29
53
|
it "should include a yaml format" do
|
30
54
|
Puppet::Network::FormatHandler.format(:yaml).should_not be_nil
|
31
55
|
end
|
@@ -7,19 +7,13 @@ describe Puppet::Network::HTTP::Connection do
|
|
7
7
|
|
8
8
|
let (:host) { "me" }
|
9
9
|
let (:port) { 54321 }
|
10
|
-
subject { Puppet::Network::HTTP::Connection.new(host, port) }
|
10
|
+
subject { Puppet::Network::HTTP::Connection.new(host, port, :verify => Puppet::SSL::Validator.no_validator) }
|
11
11
|
|
12
12
|
context "when providing HTTP connections" do
|
13
13
|
after do
|
14
14
|
Puppet::Network::HTTP::Connection.instance_variable_set("@ssl_host", nil)
|
15
15
|
end
|
16
16
|
|
17
|
-
it "should use the global SSL::Host instance to get its certificate information" do
|
18
|
-
host = mock 'host'
|
19
|
-
Puppet::SSL::Host.expects(:localhost).with.returns host
|
20
|
-
subject.send(:ssl_host).should equal(host)
|
21
|
-
end
|
22
|
-
|
23
17
|
context "when initializing http instances" do
|
24
18
|
before :each do
|
25
19
|
# All of the cert stuff is tested elsewhere
|
@@ -39,51 +33,12 @@ describe Puppet::Network::HTTP::Connection do
|
|
39
33
|
end
|
40
34
|
|
41
35
|
it "can set ssl using an option" do
|
42
|
-
Puppet::Network::HTTP::Connection.new(host, port, :use_ssl => false).send(:connection).should_not be_use_ssl
|
43
|
-
Puppet::Network::HTTP::Connection.new(host, port, :use_ssl => true).send(:connection).should be_use_ssl
|
44
|
-
end
|
45
|
-
|
46
|
-
describe "peer verification" do
|
47
|
-
def setup_standard_ssl_configuration
|
48
|
-
ca_cert_file = File.expand_path('/path/to/ssl/certs/ca_cert.pem')
|
49
|
-
FileTest.stubs(:exist?).with(ca_cert_file).returns(true)
|
50
|
-
|
51
|
-
ssl_configuration = stub('ssl_configuration', :ca_auth_file => ca_cert_file)
|
52
|
-
Puppet::Network::HTTP::Connection.any_instance.stubs(:ssl_configuration).returns(ssl_configuration)
|
53
|
-
end
|
54
|
-
|
55
|
-
def setup_standard_hostcert
|
56
|
-
host_cert_file = File.expand_path('/path/to/ssl/certs/host_cert.pem')
|
57
|
-
FileTest.stubs(:exist?).with(host_cert_file).returns(true)
|
58
|
-
|
59
|
-
Puppet[:hostcert] = host_cert_file
|
60
|
-
end
|
61
|
-
|
62
|
-
def setup_standard_ssl_host
|
63
|
-
cert = stub('cert', :content => 'real_cert')
|
64
|
-
key = stub('key', :content => 'real_key')
|
65
|
-
host = stub('host', :certificate => cert, :key => key, :ssl_store => stub('store'))
|
66
|
-
|
67
|
-
Puppet::Network::HTTP::Connection.any_instance.stubs(:ssl_host).returns(host)
|
68
|
-
end
|
69
|
-
|
70
|
-
before do
|
71
|
-
setup_standard_ssl_configuration
|
72
|
-
setup_standard_hostcert
|
73
|
-
setup_standard_ssl_host
|
74
|
-
end
|
75
|
-
|
76
|
-
it "can enable peer verification" do
|
77
|
-
Puppet::Network::HTTP::Connection.new(host, port, :verify_peer => true).send(:connection).verify_mode.should == OpenSSL::SSL::VERIFY_PEER
|
78
|
-
end
|
79
|
-
|
80
|
-
it "can disable peer verification" do
|
81
|
-
Puppet::Network::HTTP::Connection.new(host, port, :verify_peer => false).send(:connection).verify_mode.should == OpenSSL::SSL::VERIFY_NONE
|
82
|
-
end
|
36
|
+
Puppet::Network::HTTP::Connection.new(host, port, :use_ssl => false, :verify => Puppet::SSL::Validator.no_validator).send(:connection).should_not be_use_ssl
|
37
|
+
Puppet::Network::HTTP::Connection.new(host, port, :use_ssl => true, :verify => Puppet::SSL::Validator.no_validator).send(:connection).should be_use_ssl
|
83
38
|
end
|
84
39
|
|
85
40
|
context "proxy and timeout settings should propagate" do
|
86
|
-
subject { Puppet::Network::HTTP::Connection.new(host, port).send(:connection) }
|
41
|
+
subject { Puppet::Network::HTTP::Connection.new(host, port, :verify => Puppet::SSL::Validator.no_validator).send(:connection) }
|
87
42
|
before :each do
|
88
43
|
Puppet[:http_proxy_host] = "myhost"
|
89
44
|
Puppet[:http_proxy_port] = 432
|
@@ -104,94 +59,13 @@ describe Puppet::Network::HTTP::Connection do
|
|
104
59
|
it "should raise Puppet::Error when invalid options are specified" do
|
105
60
|
expect { Puppet::Network::HTTP::Connection.new(host, port, :invalid_option => nil) }.to raise_error(Puppet::Error, 'Unrecognized option(s): :invalid_option')
|
106
61
|
end
|
107
|
-
|
108
|
-
end
|
109
|
-
|
110
|
-
describe "when doing SSL setup for http instances" do
|
111
|
-
let :store do stub('store') end
|
112
|
-
|
113
|
-
let :ca_auth_file do
|
114
|
-
'/path/to/ssl/certs/ssl_server_ca_auth.pem'
|
115
|
-
end
|
116
|
-
|
117
|
-
let :ssl_configuration do
|
118
|
-
stub('ssl_configuration', :ca_auth_file => ca_auth_file)
|
119
|
-
end
|
120
|
-
|
121
|
-
before :each do
|
122
|
-
Puppet[:hostcert] = '/host/cert'
|
123
|
-
Puppet::Network::HTTP::Connection.any_instance.stubs(:ssl_configuration).returns(ssl_configuration)
|
124
|
-
|
125
|
-
cert = stub 'cert', :content => 'real_cert'
|
126
|
-
key = stub 'key', :content => 'real_key'
|
127
|
-
host = stub 'host', :certificate => cert, :key => key, :ssl_store => store
|
128
|
-
Puppet::Network::HTTP::Connection.any_instance.stubs(:ssl_host).returns(host)
|
129
|
-
end
|
130
|
-
|
131
|
-
shared_examples "HTTPS setup without all certificates" do
|
132
|
-
subject { Puppet::Network::HTTP::Connection.new(host, port, :use_ssl => true).send(:connection) }
|
133
|
-
|
134
|
-
it { should be_use_ssl }
|
135
|
-
its(:cert) { should be_nil }
|
136
|
-
its(:ca_file) { should be_nil }
|
137
|
-
its(:key) { should be_nil }
|
138
|
-
its(:verify_mode) { should == OpenSSL::SSL::VERIFY_NONE }
|
139
|
-
end
|
140
|
-
|
141
|
-
context "with neither a host cert or a local CA cert" do
|
142
|
-
before :each do
|
143
|
-
FileTest.stubs(:exist?).with(Puppet[:hostcert]).returns(false)
|
144
|
-
FileTest.stubs(:exist?).with(ca_auth_file).returns(false)
|
145
|
-
end
|
146
|
-
|
147
|
-
include_examples "HTTPS setup without all certificates"
|
148
|
-
end
|
149
|
-
|
150
|
-
context "with there is no host certificate" do
|
151
|
-
before :each do
|
152
|
-
FileTest.stubs(:exist?).with(Puppet[:hostcert]).returns(false)
|
153
|
-
FileTest.stubs(:exist?).with(ca_auth_file).returns(true)
|
154
|
-
end
|
155
|
-
|
156
|
-
include_examples "HTTPS setup without all certificates"
|
157
|
-
end
|
158
|
-
|
159
|
-
context "with there is no local CA certificate" do
|
160
|
-
before :each do
|
161
|
-
FileTest.stubs(:exist?).with(Puppet[:hostcert]).returns(true)
|
162
|
-
FileTest.stubs(:exist?).with(ca_auth_file).returns(false)
|
163
|
-
end
|
164
|
-
|
165
|
-
include_examples "HTTPS setup without all certificates"
|
166
|
-
end
|
167
|
-
|
168
|
-
context "with both the host and CA cert" do
|
169
|
-
subject { Puppet::Network::HTTP::Connection.new(host, port, :use_ssl => true).send(:connection) }
|
170
|
-
|
171
|
-
before :each do
|
172
|
-
FileTest.expects(:exist?).with(Puppet[:hostcert]).returns(true)
|
173
|
-
FileTest.expects(:exist?).with(ca_auth_file).returns(true)
|
174
|
-
end
|
175
|
-
|
176
|
-
it { should be_use_ssl }
|
177
|
-
its(:cert_store) { should equal store }
|
178
|
-
its(:cert) { should == "real_cert" }
|
179
|
-
its(:key) { should == "real_key" }
|
180
|
-
its(:verify_mode) { should == OpenSSL::SSL::VERIFY_PEER }
|
181
|
-
its(:ca_file) { should == ca_auth_file }
|
182
|
-
end
|
183
|
-
|
184
|
-
it "should set up certificate information when creating http instances" do
|
185
|
-
subject.expects(:cert_setup)
|
186
|
-
subject.send(:connection)
|
187
|
-
end
|
188
62
|
end
|
189
63
|
end
|
190
64
|
|
191
65
|
context "when methods that accept a block are called with a block" do
|
192
66
|
let (:host) { "my_server" }
|
193
67
|
let (:port) { 8140 }
|
194
|
-
let (:subject) { Puppet::Network::HTTP::Connection.new(host, port, :use_ssl => false) }
|
68
|
+
let (:subject) { Puppet::Network::HTTP::Connection.new(host, port, :use_ssl => false, :verify => Puppet::SSL::Validator.no_validator) }
|
195
69
|
let (:httpok) { Net::HTTPOK.new('1.1', 200, '') }
|
196
70
|
|
197
71
|
before :each do
|
@@ -228,95 +102,99 @@ describe Puppet::Network::HTTP::Connection do
|
|
228
102
|
let (:host) { "my_server" }
|
229
103
|
let (:port) { 8140 }
|
230
104
|
let (:httpok) { Net::HTTPOK.new('1.1', 200, '') }
|
231
|
-
let (:subject) { Puppet::Network::HTTP::Connection.new(host, port) }
|
232
|
-
|
233
|
-
def a_connection_that_verifies(args)
|
234
|
-
connection = Net::HTTP.new(host, port)
|
235
|
-
connection.stubs(:warn_if_near_expiration)
|
236
|
-
connection.stubs(:get).with do
|
237
|
-
connection.verify_callback.call(args[:has_passed_pre_checks], args[:in_context])
|
238
|
-
true
|
239
|
-
end.raises(OpenSSL::SSL::SSLError.new(args[:fails_with]))
|
240
|
-
connection
|
241
|
-
end
|
242
|
-
|
243
|
-
def a_store_context(args)
|
244
|
-
Puppet[:confdir] = tmpdir('conf')
|
245
|
-
ssl_context = mock('OpenSSL::X509::StoreContext')
|
246
|
-
if args[:verify_raises]
|
247
|
-
ssl_context.stubs(:current_cert).raises("oh noes")
|
248
|
-
else
|
249
|
-
cert = Puppet::SSL::CertificateAuthority.new.generate(args[:for_server], :dns_alt_names => args[:for_aliases]).content
|
250
|
-
ssl_context.stubs(:current_cert).returns(cert)
|
251
|
-
end
|
252
|
-
ssl_context.stubs(:chain).returns([])
|
253
|
-
ssl_context.stubs(:error_string).returns(args[:with_error_string])
|
254
|
-
ssl_context
|
255
|
-
end
|
256
105
|
|
257
106
|
it "should provide a useful error message when one is available and certificate validation fails", :unless => Puppet.features.microsoft_windows? do
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
:fails_with => 'certificate verify failed'))
|
263
|
-
expect do
|
264
|
-
subject.request(:get, stub('request'))
|
265
|
-
end.to raise_error(Puppet::Error, "certificate verify failed: [shady looking signature for /CN=not_my_server]")
|
266
|
-
end
|
107
|
+
connection = Puppet::Network::HTTP::Connection.new(
|
108
|
+
host, port,
|
109
|
+
:verify => ConstantErrorValidator.new(:fails_with => 'certificate verify failed',
|
110
|
+
:error_string => 'shady looking signature'))
|
267
111
|
|
268
|
-
it "should provide a useful error message when verify_callback raises", :unless => Puppet.features.microsoft_windows? do
|
269
|
-
subject.stubs(:create_connection).
|
270
|
-
returns(a_connection_that_verifies(:has_passed_pre_checks => false,
|
271
|
-
:in_context => a_store_context(:verify_raises => true),
|
272
|
-
:fails_with => 'certificate verify failed'))
|
273
112
|
expect do
|
274
|
-
|
275
|
-
end.to raise_error(Puppet::Error, "certificate verify failed: [
|
113
|
+
connection.get('request')
|
114
|
+
end.to raise_error(Puppet::Error, "certificate verify failed: [shady looking signature]")
|
276
115
|
end
|
277
116
|
|
278
117
|
it "should provide a helpful error message when hostname was not match with server certificate", :unless => Puppet.features.microsoft_windows? do
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
118
|
+
Puppet[:confdir] = tmpdir('conf')
|
119
|
+
|
120
|
+
connection = Puppet::Network::HTTP::Connection.new(
|
121
|
+
host, port,
|
122
|
+
:verify => ConstantErrorValidator.new(
|
123
|
+
:fails_with => 'hostname was not match with server certificate',
|
124
|
+
:peer_certs => [Puppet::SSL::CertificateAuthority.new.generate(
|
125
|
+
'not_my_server', :dns_alt_names => 'foo,bar,baz')]))
|
126
|
+
|
127
|
+
expect do
|
128
|
+
connection.get('request')
|
129
|
+
end.to raise_error(Puppet::Error) do |error|
|
287
130
|
error.message =~ /Server hostname 'my_server' did not match server certificate; expected one of (.+)/
|
288
131
|
$1.split(', ').should =~ %w[DNS:foo DNS:bar DNS:baz DNS:not_my_server not_my_server]
|
289
132
|
end
|
290
133
|
end
|
291
134
|
|
292
135
|
it "should pass along the error message otherwise" do
|
293
|
-
connection =
|
294
|
-
|
295
|
-
|
296
|
-
connection.stubs(:get).raises(OpenSSL::SSL::SSLError.new('some other message'))
|
136
|
+
connection = Puppet::Network::HTTP::Connection.new(
|
137
|
+
host, port,
|
138
|
+
:verify => ConstantErrorValidator.new(:fails_with => 'some other message'))
|
297
139
|
|
298
140
|
expect do
|
299
|
-
|
141
|
+
connection.get('request')
|
300
142
|
end.to raise_error(/some other message/)
|
301
143
|
end
|
302
144
|
|
303
145
|
it "should check all peer certificates for upcoming expiration", :unless => Puppet.features.microsoft_windows? do
|
304
|
-
|
305
|
-
|
146
|
+
Puppet[:confdir] = tmpdir('conf')
|
147
|
+
cert = Puppet::SSL::CertificateAuthority.new.generate(
|
148
|
+
'server', :dns_alt_names => 'foo,bar,baz')
|
149
|
+
|
150
|
+
connection = Puppet::Network::HTTP::Connection.new(
|
151
|
+
host, port,
|
152
|
+
:verify => NoProblemsValidator.new(cert))
|
306
153
|
|
307
|
-
|
308
|
-
Puppet::SSL::Certificate.expects(:from_instance).twice.returns(cert)
|
154
|
+
Net::HTTP.any_instance.stubs(:get).returns(httpok)
|
309
155
|
|
310
|
-
connection.
|
311
|
-
context = a_store_context(:for_server => 'a_server', :with_error_string => false)
|
312
|
-
connection.verify_callback.call(true, context)
|
313
|
-
connection.verify_callback.call(true, context)
|
314
|
-
true
|
315
|
-
end.returns(httpok)
|
156
|
+
connection.expects(:warn_if_near_expiration).with(cert)
|
316
157
|
|
317
|
-
|
158
|
+
connection.get('request')
|
159
|
+
end
|
160
|
+
|
161
|
+
class ConstantErrorValidator
|
162
|
+
def initialize(args)
|
163
|
+
@fails_with = args[:fails_with]
|
164
|
+
@error_string = args[:error_string] || ""
|
165
|
+
@peer_certs = args[:peer_certs] || []
|
166
|
+
end
|
318
167
|
|
319
|
-
|
168
|
+
def setup_connection(connection)
|
169
|
+
connection.stubs(:get).with do
|
170
|
+
true
|
171
|
+
end.raises(OpenSSL::SSL::SSLError.new(@fails_with))
|
172
|
+
end
|
173
|
+
|
174
|
+
def peer_certs
|
175
|
+
@peer_certs
|
176
|
+
end
|
177
|
+
|
178
|
+
def verify_errors
|
179
|
+
[@error_string]
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
class NoProblemsValidator
|
184
|
+
def initialize(cert)
|
185
|
+
@cert = cert
|
186
|
+
end
|
187
|
+
|
188
|
+
def setup_connection(connection)
|
189
|
+
end
|
190
|
+
|
191
|
+
def peer_certs
|
192
|
+
[@cert]
|
193
|
+
end
|
194
|
+
|
195
|
+
def verify_errors
|
196
|
+
[]
|
197
|
+
end
|
320
198
|
end
|
321
199
|
end
|
322
200
|
|
@@ -324,7 +202,7 @@ describe Puppet::Network::HTTP::Connection do
|
|
324
202
|
let (:other_host) { "redirected" }
|
325
203
|
let (:other_port) { 9292 }
|
326
204
|
let (:other_path) { "other-path" }
|
327
|
-
let (:subject) { Puppet::Network::HTTP::Connection.new("my_server", 8140, :use_ssl => false) }
|
205
|
+
let (:subject) { Puppet::Network::HTTP::Connection.new("my_server", 8140, :use_ssl => false, :verify => Puppet::SSL::Validator.no_validator) }
|
328
206
|
let (:httpredirection) { Net::HTTPFound.new('1.1', 302, 'Moved Temporarily') }
|
329
207
|
let (:httpok) { Net::HTTPOK.new('1.1', 200, '') }
|
330
208
|
|
@@ -356,5 +234,4 @@ describe Puppet::Network::HTTP::Connection do
|
|
356
234
|
}.to raise_error(Puppet::Network::HTTP::RedirectionLimitExceededException)
|
357
235
|
end
|
358
236
|
end
|
359
|
-
|
360
237
|
end
|