puppet 3.5.1-x86-mingw32 → 3.6.0.rc1-x86-mingw32
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 +5 -0
- data/Gemfile +17 -9
- data/README.md +1 -0
- data/conf/fileserver.conf +4 -3
- data/ext/README.environment +8 -0
- data/ext/build_defaults.yaml +1 -1
- data/ext/debian/control +2 -2
- data/ext/debian/puppet-common.dirs +4 -0
- data/ext/debian/rules +4 -0
- data/ext/emacs/puppet-mode-init.el +1 -1
- data/ext/emacs/puppet-mode.el +36 -17
- data/ext/redhat/client.init +3 -3
- data/ext/redhat/puppet.spec.erb +9 -0
- data/ext/systemd/puppet.service +3 -4
- data/ext/systemd/puppetmaster.service +1 -3
- data/install.rb +1 -1
- data/lib/puppet.rb +2 -1
- data/lib/puppet/agent.rb +1 -1
- data/lib/puppet/application.rb +17 -17
- data/lib/puppet/application/doc.rb +1 -1
- data/lib/puppet/configurer.rb +4 -1
- data/lib/puppet/configurer/downloader.rb +13 -12
- data/lib/puppet/configurer/plugin_handler.rb +3 -3
- data/lib/puppet/context.rb +6 -1
- data/lib/puppet/defaults.rb +82 -12
- data/lib/puppet/environments.rb +169 -13
- data/lib/puppet/external/nagios/grammar.ry +2 -0
- data/lib/puppet/external/nagios/parser.rb +28 -19
- data/lib/puppet/face/config.rb +19 -6
- data/lib/puppet/face/module/generate.rb +209 -7
- data/lib/puppet/face/module/install.rb +17 -16
- data/lib/puppet/face/module/list.rb +83 -82
- data/lib/puppet/face/module/search.rb +1 -1
- data/lib/puppet/face/module/upgrade.rb +10 -9
- data/lib/puppet/face/parser.rb +3 -2
- data/lib/puppet/face/plugin.rb +8 -4
- data/lib/puppet/file_bucket/dipper.rb +6 -3
- data/lib/puppet/file_bucket/file.rb +4 -2
- data/lib/puppet/file_serving/metadata.rb +1 -1
- data/lib/puppet/file_system/memory_file.rb +27 -1
- data/lib/puppet/file_system/memory_impl.rb +15 -1
- data/lib/puppet/forge.rb +148 -52
- data/lib/puppet/forge/cache.rb +5 -1
- data/lib/puppet/forge/errors.rb +10 -0
- data/lib/puppet/forge/repository.rb +61 -26
- data/lib/puppet/functions.rb +548 -0
- data/lib/puppet/functions/assert_type.rb +42 -0
- data/lib/puppet/functions/import.rb +7 -0
- data/lib/puppet/indirector/facts/facter.rb +1 -1
- data/lib/puppet/indirector/file_bucket_file/file.rb +3 -2
- data/lib/puppet/indirector/rest.rb +18 -0
- data/lib/puppet/loaders.rb +20 -0
- data/lib/puppet/module.rb +2 -2
- data/lib/puppet/module_tool.rb +40 -14
- data/lib/puppet/module_tool/applications.rb +0 -1
- data/lib/puppet/module_tool/applications/application.rb +35 -26
- data/lib/puppet/module_tool/applications/builder.rb +16 -6
- data/lib/puppet/module_tool/applications/checksummer.rb +25 -19
- data/lib/puppet/module_tool/applications/installer.rb +196 -35
- data/lib/puppet/module_tool/applications/searcher.rb +1 -0
- data/lib/puppet/module_tool/applications/uninstaller.rb +7 -1
- data/lib/puppet/module_tool/applications/unpacker.rb +57 -31
- data/lib/puppet/module_tool/applications/upgrader.rb +221 -65
- data/lib/puppet/module_tool/checksums.rb +5 -8
- data/lib/puppet/module_tool/errors/installer.rb +12 -44
- data/lib/puppet/module_tool/errors/shared.rb +84 -11
- data/lib/puppet/module_tool/errors/upgrader.rb +16 -45
- data/lib/puppet/module_tool/install_directory.rb +7 -6
- data/lib/puppet/module_tool/installed_modules.rb +92 -0
- data/lib/puppet/module_tool/local_tarball.rb +91 -0
- data/lib/puppet/module_tool/metadata.rb +119 -115
- data/lib/puppet/module_tool/modulefile.rb +9 -9
- data/lib/puppet/module_tool/shared_behaviors.rb +19 -7
- data/lib/puppet/module_tool/skeleton/templates/generator/README.md.erb +79 -0
- data/lib/puppet/module_tool/skeleton/templates/generator/Rakefile +18 -0
- data/lib/puppet/module_tool/skeleton/templates/generator/metadata.json.erb +1 -0
- data/lib/puppet/module_tool/skeleton/templates/generator/spec/classes/init_spec.rb.erb +7 -0
- data/lib/puppet/module_tool/tar.rb +3 -7
- data/lib/puppet/module_tool/tar/gnu.rb +21 -9
- data/lib/puppet/module_tool/tar/mini.rb +2 -8
- data/lib/puppet/network/http/api/v1.rb +1 -1
- data/lib/puppet/network/http/api/v2/authorization.rb +4 -2
- data/lib/puppet/network/http/issues.rb +1 -0
- data/lib/puppet/network/http_pool.rb +15 -6
- data/lib/puppet/node/environment.rb +91 -20
- data/lib/puppet/parser/ast/pops_bridge.rb +44 -3
- data/lib/puppet/parser/collector.rb +1 -1
- data/lib/puppet/parser/compiler.rb +50 -7
- data/lib/puppet/parser/functions.rb +6 -0
- data/lib/puppet/parser/functions/generate.rb +1 -1
- data/lib/puppet/parser/resource.rb +1 -1
- data/lib/puppet/pops.rb +22 -1
- data/lib/puppet/pops/adapters.rb +8 -1
- data/lib/puppet/pops/binder/bindings_composer.rb +1 -1
- data/lib/puppet/pops/binder/bindings_factory.rb +1 -1
- data/lib/puppet/pops/binder/config/binder_config_checker.rb +1 -1
- data/lib/puppet/pops/binder/producers.rb +2 -2
- data/lib/puppet/pops/evaluator/access_operator.rb +65 -25
- data/lib/puppet/pops/evaluator/callable_signature.rb +101 -0
- data/lib/puppet/pops/evaluator/closure.rb +57 -2
- data/lib/puppet/pops/evaluator/compare_operator.rb +1 -1
- data/lib/puppet/pops/evaluator/evaluator_impl.rb +9 -11
- data/lib/puppet/pops/evaluator/runtime3_support.rb +72 -21
- data/lib/puppet/pops/functions/dispatch.rb +71 -0
- data/lib/puppet/pops/functions/dispatcher.rb +237 -0
- data/lib/puppet/pops/functions/function.rb +77 -0
- data/lib/puppet/pops/issues.rb +12 -0
- data/lib/puppet/pops/loader/base_loader.rb +102 -0
- data/lib/puppet/pops/loader/dependency_loader.rb +60 -0
- data/lib/puppet/pops/loader/gem_support.rb +49 -0
- data/lib/puppet/pops/loader/loader.rb +180 -0
- data/lib/puppet/pops/loader/loader_paths.rb +137 -0
- data/lib/puppet/pops/loader/module_loaders.rb +242 -0
- data/lib/puppet/pops/loader/null_loader.rb +44 -0
- data/lib/puppet/pops/loader/ruby_function_instantiator.rb +34 -0
- data/lib/puppet/pops/loader/ruby_legacy_function_instantiator.rb +109 -0
- data/lib/puppet/pops/loader/simple_environment_loader.rb +20 -0
- data/lib/puppet/pops/loader/static_loader.rb +69 -0
- data/lib/puppet/pops/loader/uri_helper.rb +22 -0
- data/lib/puppet/pops/loaders.rb +240 -0
- data/lib/puppet/pops/model/factory.rb +13 -5
- data/lib/puppet/pops/model/model_tree_dumper.rb +12 -4
- data/lib/puppet/pops/parser/egrammar.ra +31 -18
- data/lib/puppet/pops/parser/eparser.rb +1137 -1106
- data/lib/puppet/pops/parser/lexer2.rb +17 -16
- data/lib/puppet/pops/semantic_error.rb +17 -0
- data/lib/puppet/pops/types/type_calculator.rb +150 -15
- data/lib/puppet/pops/types/type_factory.rb +69 -0
- data/lib/puppet/pops/types/type_parser.rb +9 -0
- data/lib/puppet/pops/types/types.rb +65 -4
- data/lib/puppet/pops/validation/checker4_0.rb +1 -1
- data/lib/puppet/pops/validation/validator_factory_4_0.rb +1 -1
- data/lib/puppet/property/list.rb +1 -1
- data/lib/puppet/provider/augeas/augeas.rb +2 -2
- data/lib/puppet/provider/cron/crontab.rb +13 -2
- data/lib/puppet/provider/package.rb +24 -0
- data/lib/puppet/provider/package/apt.rb +6 -1
- data/lib/puppet/provider/package/gem.rb +8 -2
- data/lib/puppet/provider/package/msi.rb +0 -15
- data/lib/puppet/provider/package/openbsd.rb +0 -24
- data/lib/puppet/provider/package/rpm.rb +3 -29
- data/lib/puppet/provider/package/windows.rb +0 -15
- data/lib/puppet/provider/package/yum.rb +101 -24
- data/lib/puppet/provider/package/yumhelper.py +31 -1
- data/lib/puppet/provider/package/zypper.rb +10 -28
- data/lib/puppet/provider/service/debian.rb +1 -1
- data/lib/puppet/provider/service/init.rb +3 -0
- data/lib/puppet/provider/service/openbsd.rb +318 -0
- data/lib/puppet/provider/service/redhat.rb +6 -3
- data/lib/puppet/provider/service/systemd.rb +2 -2
- data/lib/puppet/provider/yumrepo/inifile.rb +115 -42
- data/lib/puppet/resource.rb +13 -9
- data/lib/puppet/resource/catalog.rb +12 -6
- data/lib/puppet/resource/type_collection.rb +3 -3
- data/lib/puppet/settings.rb +57 -36
- data/lib/puppet/settings/config_file.rb +5 -0
- data/lib/puppet/settings/environment_conf.rb +147 -0
- data/lib/puppet/settings/ttl_setting.rb +48 -0
- data/lib/puppet/ssl/certificate_authority.rb +2 -3
- data/lib/puppet/ssl/certificate_authority/autosign_command.rb +1 -1
- data/lib/puppet/ssl/certificate_request.rb +4 -4
- data/lib/puppet/ssl/validator/default_validator.rb +2 -2
- data/lib/puppet/status.rb +1 -1
- data/lib/puppet/test/test_helper.rb +1 -0
- data/lib/puppet/type/augeas.rb +13 -1
- data/lib/puppet/type/cron.rb +32 -18
- data/lib/puppet/type/file.rb +4 -2
- data/lib/puppet/type/file/checksum.rb +15 -5
- data/lib/puppet/type/file/content.rb +3 -1
- data/lib/puppet/type/file/source.rb +5 -5
- data/lib/puppet/type/package.rb +12 -17
- data/lib/puppet/type/resources.rb +3 -1
- data/lib/puppet/type/scheduled_task.rb +4 -5
- data/lib/puppet/type/service.rb +12 -2
- data/lib/puppet/type/user.rb +106 -0
- data/lib/puppet/type/yumrepo.rb +9 -1
- data/lib/puppet/util/checksums.rb +60 -1
- data/lib/puppet/util/diff.rb +3 -1
- data/lib/puppet/util/execution.rb +20 -16
- data/lib/puppet/util/feature.rb +3 -0
- data/lib/puppet/util/logging.rb +19 -12
- data/lib/puppet/util/rubygems.rb +10 -0
- data/lib/puppet/util/watched_file.rb +1 -1
- data/lib/puppet/util/windows/security.rb +5 -3
- data/lib/puppet/vendor/load_semantic.rb +1 -0
- data/lib/puppet/vendor/require_vendored.rb +2 -0
- data/lib/puppet/vendor/semantic/Gemfile +20 -0
- data/lib/puppet/vendor/semantic/Rakefile +69 -0
- data/lib/puppet/vendor/semantic/lib/semantic.rb +7 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency.rb +181 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/graph.rb +60 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/graph_node.rb +117 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/module_release.rb +46 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/source.rb +25 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/unsatisfiable_graph.rb +31 -0
- data/lib/puppet/vendor/semantic/lib/semantic/version.rb +168 -0
- data/lib/puppet/vendor/semantic/lib/semantic/version_range.rb +424 -0
- data/lib/puppet/vendor/semantic/spec/spec_helper.rb +24 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/graph_node_spec.rb +141 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/graph_spec.rb +162 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/module_release_spec.rb +143 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/source_spec.rb +5 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/unsatisfiable_graph_spec.rb +44 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency_spec.rb +383 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/version_range_spec.rb +307 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/version_spec.rb +608 -0
- data/lib/puppet/version.rb +1 -1
- data/spec/fixtures/java.tgz +0 -0
- data/spec/fixtures/stdlib.tgz +0 -0
- data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/usee/lib/puppet/functions/usee/callee.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/user/lib/puppet/functions/user/caller.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/user/metadata.json +9 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/modulea/rb_func_a.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/rb_func_a.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/manifests/init.pp +3 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/metadata.json +19 -0
- data/spec/fixtures/unit/pops/loaders/loaders/wo_metadata_module/modules/moduleb/lib/puppet/functions/moduleb/rb_func_b.rb +6 -0
- data/spec/fixtures/unit/pops/loaders/loaders/wo_metadata_module/modules/moduleb/manifests/init.pp +3 -0
- data/spec/fixtures/unit/provider/naginator/define_empty_param +6 -0
- data/spec/fixtures/unit/provider/service/systemd/list_unit_files_services +7 -0
- data/spec/fixtures/unit/type/user/authorized_keys +5 -0
- data/spec/integration/application/apply_spec.rb +1 -2
- data/spec/integration/configurer_spec.rb +2 -2
- data/spec/integration/faces/plugin_spec.rb +62 -0
- data/spec/integration/indirector/catalog/compiler_spec.rb +1 -1
- data/spec/integration/indirector/catalog/queue_spec.rb +1 -1
- data/spec/integration/node/environment_spec.rb +2 -2
- data/spec/integration/parser/future_compiler_spec.rb +96 -142
- data/spec/integration/parser/ruby_manifest_spec.rb +0 -5
- data/spec/integration/provider/cron/crontab_spec.rb +35 -0
- data/spec/integration/type/file_spec.rb +74 -72
- data/spec/integration/util/windows/security_spec.rb +17 -0
- data/spec/lib/matchers/resource.rb +45 -13
- data/spec/lib/puppet_spec/files.rb +18 -0
- data/spec/lib/puppet_spec/module_tool/shared_functions.rb +56 -0
- data/spec/lib/puppet_spec/module_tool/stub_source.rb +133 -0
- data/spec/shared_contexts/checksums.rb +55 -0
- data/spec/unit/application/apply_spec.rb +10 -7
- data/spec/unit/application/doc_spec.rb +17 -10
- data/spec/unit/application/indirection_base_spec.rb +18 -10
- data/spec/unit/application/inspect_spec.rb +22 -20
- data/spec/unit/configurer/downloader_spec.rb +7 -6
- data/spec/unit/configurer/plugin_handler_spec.rb +5 -8
- data/spec/unit/configurer_spec.rb +1 -1
- data/spec/unit/context_spec.rb +23 -0
- data/spec/unit/environments_spec.rb +274 -16
- data/spec/unit/face/config_spec.rb +111 -11
- data/spec/unit/face/module/install_spec.rb +14 -85
- data/spec/unit/face/module/list_spec.rb +108 -62
- data/spec/unit/face/module/search_spec.rb +1 -1
- data/spec/unit/face/module/uninstall_spec.rb +21 -42
- data/spec/unit/face/parser_spec.rb +5 -2
- data/spec/unit/file_bucket/dipper_spec.rb +92 -86
- data/spec/unit/file_bucket/file_spec.rb +23 -75
- data/spec/unit/file_serving/metadata_spec.rb +74 -74
- data/spec/unit/forge/module_release_spec.rb +131 -0
- data/spec/unit/forge/repository_spec.rb +21 -20
- data/spec/unit/forge_spec.rb +99 -23
- data/spec/unit/functions/assert_type_spec.rb +59 -0
- data/spec/unit/functions4_spec.rb +671 -0
- data/spec/unit/indirector/catalog/static_compiler_spec.rb +2 -2
- data/spec/unit/indirector/facts/facter_spec.rb +9 -3
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +156 -155
- data/spec/unit/indirector/rest_spec.rb +8 -0
- data/spec/unit/interface/face_collection_spec.rb +35 -23
- data/spec/unit/module_spec.rb +20 -8
- data/spec/unit/module_tool/applications/builder_spec.rb +40 -12
- data/spec/unit/module_tool/applications/checksummer_spec.rb +86 -105
- data/spec/unit/module_tool/applications/installer_spec.rb +293 -261
- data/spec/unit/module_tool/applications/searcher_spec.rb +1 -1
- data/spec/unit/module_tool/applications/uninstaller_spec.rb +90 -154
- data/spec/unit/module_tool/applications/unpacker_spec.rb +12 -12
- data/spec/unit/module_tool/applications/upgrader_spec.rb +286 -18
- data/spec/unit/module_tool/metadata_spec.rb +223 -14
- data/spec/unit/module_tool/tar/gnu_spec.rb +12 -9
- data/spec/unit/module_tool/tar/mini_spec.rb +1 -1
- data/spec/unit/module_tool/tar_spec.rb +4 -18
- data/spec/unit/module_tool_spec.rb +123 -27
- data/spec/unit/network/formats_spec.rb +2 -2
- data/spec/unit/network/http_pool_spec.rb +21 -0
- data/spec/unit/network/rights_spec.rb +10 -8
- data/spec/unit/node/environment_spec.rb +27 -2
- data/spec/unit/parser/collector_spec.rb +1 -1
- data/spec/unit/parser/compiler_spec.rb +1 -1
- data/spec/unit/parser/functions/generate_spec.rb +4 -0
- data/spec/unit/pops/evaluator/access_ops_spec.rb +50 -11
- data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +25 -0
- data/spec/unit/pops/loaders/dependency_loader_spec.rb +44 -0
- data/spec/unit/pops/loaders/loader_paths_spec.rb +66 -0
- data/spec/unit/pops/loaders/loaders_spec.rb +105 -0
- data/spec/unit/pops/loaders/module_loaders_spec.rb +119 -0
- data/spec/unit/pops/loaders/static_loader_spec.rb +46 -0
- data/spec/unit/pops/types/type_calculator_spec.rb +145 -10
- data/spec/unit/pops/types/type_factory_spec.rb +101 -0
- data/spec/unit/pops/types/type_parser_spec.rb +22 -0
- data/spec/unit/property/list_spec.rb +9 -1
- data/spec/unit/provider/augeas/augeas_spec.rb +58 -11
- data/spec/unit/provider/cron/crontab_spec.rb +1 -0
- data/spec/unit/provider/cron/parsed_spec.rb +15 -0
- data/spec/unit/provider/naginator_spec.rb +14 -0
- data/spec/unit/provider/package/apt_spec.rb +78 -64
- data/spec/unit/provider/package/gem_spec.rb +15 -0
- data/spec/unit/provider/package/rpm_spec.rb +6 -6
- data/spec/unit/provider/package/windows_spec.rb +1 -1
- data/spec/unit/provider/package/yum_spec.rb +199 -104
- data/spec/unit/provider/package/zypper_spec.rb +41 -15
- data/spec/unit/provider/service/openbsd_spec.rb +129 -22
- data/spec/unit/provider/service/redhat_spec.rb +18 -4
- data/spec/unit/provider/service/systemd_spec.rb +5 -9
- data/spec/unit/provider/service/upstart_spec.rb +1 -1
- data/spec/unit/provider/user/directoryservice_spec.rb +10 -0
- data/spec/unit/provider/yumrepo/inifile_spec.rb +171 -15
- data/spec/unit/resource/catalog_spec.rb +20 -104
- data/spec/unit/resource/type_collection_spec.rb +10 -9
- data/spec/unit/settings/config_file_spec.rb +29 -6
- data/spec/unit/settings/environment_conf_spec.rb +51 -0
- data/spec/unit/settings_spec.rb +97 -12
- data/spec/unit/ssl/certificate_authority_spec.rb +2 -0
- data/spec/unit/type/augeas_spec.rb +1 -1
- data/spec/unit/type/cron_spec.rb +6 -7
- data/spec/unit/type/file/checksum_spec.rb +6 -0
- data/spec/unit/type/file/content_spec.rb +277 -207
- data/spec/unit/type/file_spec.rb +9 -7
- data/spec/unit/type/user_spec.rb +106 -18
- data/spec/unit/type/yumrepo_spec.rb +8 -0
- data/spec/unit/util/checksums_spec.rb +12 -5
- data/spec/unit/util/diff_spec.rb +8 -0
- data/spec/unit/util/execution_spec.rb +4 -4
- data/spec/unit/util/feature_spec.rb +2 -0
- data/spec/unit/util/logging_spec.rb +14 -4
- data/spec/unit/util/rdoc/parser_spec.rb +5 -4
- data/spec/unit/util/rubygems_spec.rb +14 -0
- data/tasks/parallel.rake +2 -2
- metadata +154 -21
- checksums.yaml +0 -7
- data/lib/puppet/module_tool/applications/generator.rb +0 -142
- data/lib/puppet/module_tool/skeleton.rb +0 -37
- data/lib/puppet/module_tool/skeleton/templates/generator/Modulefile.erb +0 -11
- data/lib/puppet/module_tool/skeleton/templates/generator/README.erb +0 -16
- data/lib/puppet/module_tool/tar/solaris.rb +0 -5
- data/spec/fixtures/unit/provider/service/systemd/list_units_services +0 -17
- data/spec/unit/module_tool/tar/solaris_spec.rb +0 -22
@@ -6,7 +6,7 @@ describe Puppet::ModuleTool::Applications::Searcher do
|
|
6
6
|
include PuppetSpec::Files
|
7
7
|
|
8
8
|
describe "when searching" do
|
9
|
-
let(:forge) { mock 'forge' }
|
9
|
+
let(:forge) { mock 'forge', :host => 'http://nowhe.re' }
|
10
10
|
let(:searcher) do
|
11
11
|
described_class.new('search_term', forge)
|
12
12
|
end
|
@@ -1,205 +1,141 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'puppet/module_tool'
|
3
3
|
require 'tmpdir'
|
4
|
-
require 'puppet_spec/
|
4
|
+
require 'puppet_spec/module_tool/shared_functions'
|
5
|
+
require 'puppet_spec/module_tool/stub_source'
|
5
6
|
|
6
7
|
describe Puppet::ModuleTool::Applications::Uninstaller do
|
8
|
+
include PuppetSpec::ModuleTool::SharedFunctions
|
7
9
|
include PuppetSpec::Files
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
-
FileUtils.mkdir_p(
|
12
|
-
|
13
|
-
if metadata
|
14
|
-
File.open(File.join(modpath, 'metadata.json'), 'w') do |f|
|
15
|
-
f.write(metadata.to_pson)
|
16
|
-
end
|
17
|
-
end
|
11
|
+
before do
|
12
|
+
FileUtils.mkdir_p(primary_dir)
|
13
|
+
FileUtils.mkdir_p(secondary_dir)
|
14
|
+
end
|
18
15
|
|
19
|
-
|
16
|
+
let(:environment) do
|
17
|
+
Puppet.lookup(:current_environment).override_with(
|
18
|
+
:vardir => vardir,
|
19
|
+
:modulepath => [ primary_dir, secondary_dir ]
|
20
|
+
)
|
20
21
|
end
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
let(:env) { Puppet::Node::Environment.create(:env, [modpath1, modpath2]) }
|
27
|
-
let(:options) { { :environment_instance => env } }
|
28
|
-
let(:uninstaller) { Puppet::ModuleTool::Applications::Uninstaller.new("puppetlabs-foo", options) }
|
29
|
-
|
30
|
-
def create_temp_dir(name)
|
31
|
-
path = File.join(working_dir, name)
|
32
|
-
FileUtils.mkdir_p(path)
|
33
|
-
path
|
34
|
-
end
|
23
|
+
let(:vardir) { tmpdir('uninstaller') }
|
24
|
+
let(:primary_dir) { File.join(vardir, "primary") }
|
25
|
+
let(:secondary_dir) { File.join(vardir, "secondary") }
|
26
|
+
let(:remote_source) { PuppetSpec::ModuleTool::StubSource.new }
|
35
27
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
:license => "Apache2",
|
43
|
-
:dependencies => [],
|
44
|
-
}
|
45
|
-
end
|
28
|
+
let(:module) { 'module-not_installed' }
|
29
|
+
let(:application) do
|
30
|
+
opts = options
|
31
|
+
Puppet::ModuleTool.set_option_defaults(opts)
|
32
|
+
Puppet::ModuleTool::Applications::Uninstaller.new(self.module, opts)
|
33
|
+
end
|
46
34
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
:name => "puppetlabs/bar",
|
51
|
-
:version => "1.0.0",
|
52
|
-
:source => "http://dummyurl/bar",
|
53
|
-
:license => "Apache2",
|
54
|
-
:dependencies => [],
|
55
|
-
}
|
56
|
-
end
|
35
|
+
def options
|
36
|
+
{ :environment => environment }
|
37
|
+
end
|
57
38
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
39
|
+
subject { application.run }
|
40
|
+
|
41
|
+
context "when the module is not installed" do
|
42
|
+
it "should fail" do
|
43
|
+
subject.should include :result => :failure
|
62
44
|
end
|
45
|
+
end
|
63
46
|
|
64
|
-
|
47
|
+
context "when the module is installed" do
|
48
|
+
let(:module) { 'pmtacceptance-stdlib' }
|
65
49
|
|
66
|
-
|
67
|
-
|
50
|
+
before { preinstall('pmtacceptance-stdlib', '1.0.0') }
|
51
|
+
before { preinstall('pmtacceptance-apache', '0.0.4') }
|
68
52
|
|
69
|
-
|
53
|
+
it "should uninstall the module" do
|
54
|
+
subject[:affected_modules].first.forge_name.should == "pmtacceptance/stdlib"
|
55
|
+
end
|
70
56
|
|
71
|
-
|
72
|
-
|
57
|
+
it "should only uninstall the requested module" do
|
58
|
+
subject[:affected_modules].length == 1
|
59
|
+
end
|
73
60
|
|
74
|
-
|
75
|
-
|
76
|
-
PuppetSpec::Modules.create('bar', modpath1, :metadata => bar_metadata)
|
61
|
+
context 'in two modulepaths' do
|
62
|
+
before { preinstall('pmtacceptance-stdlib', '2.0.0', :into => secondary_dir) }
|
77
63
|
|
78
|
-
|
79
|
-
|
80
|
-
results[:affected_modules].first.forge_name.should == "puppetlabs/foo"
|
64
|
+
it "should fail if a module exists twice in the modpath" do
|
65
|
+
subject.should include :result => :failure
|
81
66
|
end
|
67
|
+
end
|
82
68
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
uninstaller.run[:result].should == :failure
|
69
|
+
context "when options[:version] is specified" do
|
70
|
+
def options
|
71
|
+
super.merge(:version => '1.0.0')
|
88
72
|
end
|
89
73
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
options[:version] = "1.0.0"
|
74
|
+
it "should uninstall the module if the version matches" do
|
75
|
+
subject[:affected_modules].length.should == 1
|
76
|
+
subject[:affected_modules].first.version.should == "1.0.0"
|
77
|
+
end
|
96
78
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
results[:affected_modules].first.version.should == "1.0.0"
|
79
|
+
context 'but not matched' do
|
80
|
+
def options
|
81
|
+
super.merge(:version => '2.0.0')
|
101
82
|
end
|
102
83
|
|
103
84
|
it "should not uninstall the module if the version does not match" do
|
104
|
-
|
105
|
-
|
106
|
-
options[:version] = "2.0.0"
|
107
|
-
|
108
|
-
uninstaller.run[:result].should == :failure
|
85
|
+
subject.should include :result => :failure
|
109
86
|
end
|
110
87
|
end
|
88
|
+
end
|
111
89
|
|
112
|
-
|
113
|
-
|
114
|
-
it "should not uninstall the module" do
|
115
|
-
PuppetSpec::Modules.create('foo', modpath1)
|
90
|
+
context "when the module metadata is missing" do
|
91
|
+
before { File.unlink(File.join(primary_dir, 'stdlib', 'metadata.json')) }
|
116
92
|
|
117
|
-
|
118
|
-
|
93
|
+
it "should not uninstall the module" do
|
94
|
+
application.run[:result].should == :failure
|
119
95
|
end
|
96
|
+
end
|
120
97
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
mod = PuppetSpec::Modules.create('foo', modpath1, :metadata => foo_metadata)
|
125
|
-
Puppet::ModuleTool::Applications::Checksummer.expects(:run).with(mod.path).returns(['change'])
|
126
|
-
|
127
|
-
uninstaller.run[:result].should == :failure
|
128
|
-
end
|
129
|
-
|
98
|
+
context "when the module has local changes" do
|
99
|
+
before do
|
100
|
+
mark_changed(File.join(primary_dir, 'stdlib'))
|
130
101
|
end
|
131
102
|
|
132
|
-
|
103
|
+
it "should not uninstall the module" do
|
104
|
+
subject.should include :result => :failure
|
105
|
+
end
|
106
|
+
end
|
133
107
|
|
134
|
-
|
135
|
-
|
108
|
+
context "when uninstalling the module will cause broken dependencies" do
|
109
|
+
before { preinstall('pmtacceptance-apache', '0.10.0') }
|
136
110
|
|
137
|
-
|
138
|
-
|
139
|
-
results[:affected_modules].first.forge_name.should == "puppetlabs/foo"
|
140
|
-
end
|
111
|
+
it "should not uninstall the module" do
|
112
|
+
subject.should include :result => :failure
|
141
113
|
end
|
114
|
+
end
|
142
115
|
|
143
|
-
|
144
|
-
it "should not uninstall the module" do
|
145
|
-
Puppet.settings[:modulepath] = modpath1
|
146
|
-
PuppetSpec::Modules.create('foo', modpath1, :metadata => foo_metadata)
|
147
|
-
|
148
|
-
PuppetSpec::Modules.create(
|
149
|
-
'needy',
|
150
|
-
modpath1,
|
151
|
-
:metadata => {
|
152
|
-
:author => 'beggar',
|
153
|
-
:dependencies => [{
|
154
|
-
"version_requirement" => ">= 1.0.0",
|
155
|
-
"name" => "puppetlabs/foo"
|
156
|
-
}]
|
157
|
-
}
|
158
|
-
)
|
159
|
-
|
160
|
-
uninstaller.run[:result].should == :failure
|
161
|
-
end
|
162
|
-
end
|
116
|
+
context "when using the --force flag" do
|
163
117
|
|
164
|
-
|
118
|
+
def options
|
119
|
+
super.merge(:force => true)
|
120
|
+
end
|
165
121
|
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
:version => '0.0.1',
|
170
|
-
:has_local_changes? => true
|
171
|
-
)
|
122
|
+
context "with local changes" do
|
123
|
+
before do
|
124
|
+
mark_changed(File.join(primary_dir, 'stdlib'))
|
172
125
|
end
|
173
126
|
|
174
127
|
it "should ignore local changes" do
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
results = uninstaller.run
|
179
|
-
results[:affected_modules].length.should == 1
|
180
|
-
results[:affected_modules].first.forge_name.should == "puppetlabs/foo"
|
128
|
+
subject[:affected_modules].length.should == 1
|
129
|
+
subject[:affected_modules].first.forge_name.should == "pmtacceptance/stdlib"
|
181
130
|
end
|
131
|
+
end
|
132
|
+
|
133
|
+
context "while depended upon" do
|
134
|
+
before { preinstall('pmtacceptance-apache', '0.10.0') }
|
182
135
|
|
183
136
|
it "should ignore broken dependencies" do
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
PuppetSpec::Modules.create(
|
188
|
-
'needy',
|
189
|
-
modpath1,
|
190
|
-
:metadata => {
|
191
|
-
:author => 'beggar',
|
192
|
-
:dependencies => [{
|
193
|
-
"version_requirement" => ">= 1.0.0",
|
194
|
-
"name" => "puppetlabs/foo"
|
195
|
-
}]
|
196
|
-
}
|
197
|
-
)
|
198
|
-
options[:force] = true
|
199
|
-
|
200
|
-
results = uninstaller.run
|
201
|
-
results[:affected_modules].length.should == 1
|
202
|
-
results[:affected_modules].first.forge_name.should == "puppetlabs/foo"
|
137
|
+
subject[:affected_modules].length.should == 1
|
138
|
+
subject[:affected_modules].first.forge_name.should == "pmtacceptance/stdlib"
|
203
139
|
end
|
204
140
|
end
|
205
141
|
end
|
@@ -1,4 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
require 'json'
|
3
|
+
|
2
4
|
require 'puppet/module_tool/applications'
|
3
5
|
require 'puppet_spec/modules'
|
4
6
|
|
@@ -7,28 +9,26 @@ describe Puppet::ModuleTool::Applications::Unpacker do
|
|
7
9
|
|
8
10
|
let(:target) { tmpdir("unpacker") }
|
9
11
|
let(:module_name) { 'myusername-mytarball' }
|
10
|
-
let(:filename) { tmpdir("module") + "
|
12
|
+
let(:filename) { tmpdir("module") + "/module.tar.gz" }
|
11
13
|
let(:working_dir) { tmpdir("working_dir") }
|
12
|
-
let(:unpacker) do
|
13
|
-
Puppet::ModuleTool::Applications::Unpacker.new(filename, :target_dir => target)
|
14
|
-
end
|
15
14
|
|
16
15
|
before :each do
|
17
16
|
Puppet.settings[:module_working_dir] = working_dir
|
18
17
|
end
|
19
18
|
|
20
|
-
it "should raise ArgumentError when filename is invalid" do
|
21
|
-
expect { Puppet::ModuleTool::Applications::Unpacker.new("invalid.tar.gz", :target_dir => target) }.to raise_error(ArgumentError)
|
22
|
-
end
|
23
|
-
|
24
19
|
it "should attempt to untar file to temporary location" do
|
25
|
-
|
26
|
-
|
27
|
-
untarrer.expects(:unpack).with(filename, regexp_matches(/^#{Regexp.escape(working_dir)}/)) do |src, dest|
|
20
|
+
untar = mock('Tar')
|
21
|
+
untar.expects(:unpack).with(filename, anything()) do |src, dest, _|
|
28
22
|
FileUtils.mkdir(File.join(dest, 'extractedmodule'))
|
23
|
+
File.open(File.join(dest, 'extractedmodule', 'metadata.json'), 'w+') do |file|
|
24
|
+
file.puts JSON.generate('name' => module_name, 'version' => '1.0.0')
|
25
|
+
end
|
26
|
+
true
|
29
27
|
end
|
30
28
|
|
31
|
-
|
29
|
+
Puppet::ModuleTool::Tar.expects(:instance).returns(untar)
|
30
|
+
|
31
|
+
Puppet::ModuleTool::Applications::Unpacker.run(filename, :target_dir => target)
|
32
32
|
File.should be_directory(File.join(target, 'mytarball'))
|
33
33
|
end
|
34
34
|
end
|
@@ -1,34 +1,302 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'puppet/module_tool/applications'
|
3
|
-
require 'puppet_spec/
|
3
|
+
require 'puppet_spec/module_tool/shared_functions'
|
4
|
+
require 'puppet_spec/module_tool/stub_source'
|
4
5
|
require 'semver'
|
5
6
|
|
6
7
|
describe Puppet::ModuleTool::Applications::Upgrader do
|
8
|
+
include PuppetSpec::ModuleTool::SharedFunctions
|
7
9
|
include PuppetSpec::Files
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
before do
|
12
|
+
FileUtils.mkdir_p(primary_dir)
|
13
|
+
FileUtils.mkdir_p(secondary_dir)
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:vardir) { tmpdir('upgrader') }
|
17
|
+
let(:primary_dir) { File.join(vardir, "primary") }
|
18
|
+
let(:secondary_dir) { File.join(vardir, "secondary") }
|
19
|
+
let(:remote_source) { PuppetSpec::ModuleTool::StubSource.new }
|
15
20
|
|
16
|
-
|
17
|
-
|
21
|
+
let(:environment) do
|
22
|
+
Puppet.lookup(:current_environment).override_with(
|
23
|
+
:vardir => vardir,
|
24
|
+
:modulepath => [ primary_dir, secondary_dir ]
|
25
|
+
)
|
18
26
|
end
|
19
27
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
28
|
+
before do
|
29
|
+
Semantic::Dependency.clear_sources
|
30
|
+
installer = Puppet::ModuleTool::Applications::Upgrader.any_instance
|
31
|
+
installer.stubs(:module_repository).returns(remote_source)
|
24
32
|
end
|
25
33
|
|
26
|
-
|
27
|
-
|
34
|
+
def upgrader(name, options = {})
|
35
|
+
Puppet::ModuleTool.set_option_defaults(options)
|
36
|
+
Puppet::ModuleTool::Applications::Upgrader.new(name, options)
|
28
37
|
end
|
29
38
|
|
30
|
-
|
31
|
-
|
32
|
-
|
39
|
+
describe '#run' do
|
40
|
+
let(:module) { 'pmtacceptance-stdlib' }
|
41
|
+
|
42
|
+
def options
|
43
|
+
{ :environment => environment }
|
44
|
+
end
|
45
|
+
|
46
|
+
let(:application) { upgrader(self.module, options) }
|
47
|
+
subject { application.run }
|
48
|
+
|
49
|
+
it 'fails if the module is not already installed' do
|
50
|
+
subject.should include :result => :failure
|
51
|
+
subject[:error].should include :oneline => "Could not upgrade '#{self.module}'; module is not installed"
|
52
|
+
end
|
53
|
+
|
54
|
+
context 'for an installed module' do
|
55
|
+
context 'without dependencies' do
|
56
|
+
before { preinstall('pmtacceptance-stdlib', '1.0.0') }
|
57
|
+
|
58
|
+
context 'without options' do
|
59
|
+
it 'properly upgrades the module to the greatest version' do
|
60
|
+
subject.should include :result => :success
|
61
|
+
graph_should_include 'pmtacceptance-stdlib', v('1.0.0') => v('4.1.0')
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
context 'with version range' do
|
66
|
+
def options
|
67
|
+
super.merge(:version => '3.x')
|
68
|
+
end
|
69
|
+
|
70
|
+
context 'not matching the installed version' do
|
71
|
+
it 'properly upgrades the module to the greatest version within that range' do
|
72
|
+
subject.should include :result => :success
|
73
|
+
graph_should_include 'pmtacceptance-stdlib', v('1.0.0') => v('3.2.0')
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
context 'matching the installed version' do
|
78
|
+
context 'with more recent version' do
|
79
|
+
before { preinstall('pmtacceptance-stdlib', '3.0.0')}
|
80
|
+
|
81
|
+
it 'properly upgrades the module to the greatest version within that range' do
|
82
|
+
subject.should include :result => :success
|
83
|
+
graph_should_include 'pmtacceptance-stdlib', v('3.0.0') => v('3.2.0')
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
context 'without more recent version' do
|
88
|
+
before { preinstall('pmtacceptance-stdlib', '3.2.0')}
|
89
|
+
|
90
|
+
context 'without options' do
|
91
|
+
it 'declines to upgrade' do
|
92
|
+
subject.should include :result => :noop
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
context 'with --force' do
|
97
|
+
def options
|
98
|
+
super.merge(:force => true)
|
99
|
+
end
|
100
|
+
|
101
|
+
it 'overwrites the installed module with the greatest version matching that range' do
|
102
|
+
subject.should include :result => :success
|
103
|
+
graph_should_include 'pmtacceptance-stdlib', v('3.2.0') => v('3.2.0')
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
context 'that is depended upon' do
|
112
|
+
# pmtacceptance-keystone depends on pmtacceptance-mysql >=0.6.1 <1.0.0
|
113
|
+
before { preinstall('pmtacceptance-keystone', '2.1.0') }
|
114
|
+
before { preinstall('pmtacceptance-mysql', '0.9.0') }
|
115
|
+
|
116
|
+
let(:module) { 'pmtacceptance-mysql' }
|
117
|
+
|
118
|
+
context 'and out of date' do
|
119
|
+
before { preinstall('pmtacceptance-mysql', '0.8.0') }
|
120
|
+
|
121
|
+
it 'properly upgrades to the greatest version matching the dependency' do
|
122
|
+
subject.should include :result => :success
|
123
|
+
graph_should_include 'pmtacceptance-mysql', v('0.8.0') => v('0.9.0')
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
context 'and up to date' do
|
128
|
+
it 'declines to upgrade' do
|
129
|
+
subject.should include :result => :failure
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
context 'when specifying a violating version range' do
|
134
|
+
def options
|
135
|
+
super.merge(:version => '2.1.0')
|
136
|
+
end
|
137
|
+
|
138
|
+
it 'fails to upgrade the module' do
|
139
|
+
# TODO: More helpful error message?
|
140
|
+
subject.should include :result => :failure
|
141
|
+
subject[:error].should include :oneline => "Could not upgrade '#{self.module}' (v0.9.0 -> v2.1.0); no version satisfies all dependencies"
|
142
|
+
end
|
143
|
+
|
144
|
+
context 'using --force' do
|
145
|
+
def options
|
146
|
+
super.merge(:force => true)
|
147
|
+
end
|
148
|
+
|
149
|
+
it 'overwrites the installed module with the specified version' do
|
150
|
+
subject.should include :result => :success
|
151
|
+
graph_should_include 'pmtacceptance-mysql', v('0.9.0') => v('2.1.0')
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
context 'with local changes' do
|
158
|
+
before { preinstall('pmtacceptance-stdlib', '1.0.0') }
|
159
|
+
before do
|
160
|
+
release = application.send(:installed_modules)['pmtacceptance-stdlib']
|
161
|
+
mark_changed(release.mod.path)
|
162
|
+
end
|
163
|
+
|
164
|
+
it 'fails to upgrade' do
|
165
|
+
subject.should include :result => :failure
|
166
|
+
subject[:error].should include :oneline => "Could not upgrade '#{self.module}'; module has had changes made locally"
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
context 'with dependencies' do
|
171
|
+
context 'that are unsatisfied' do
|
172
|
+
def options
|
173
|
+
super.merge(:version => '0.1.1')
|
174
|
+
end
|
175
|
+
|
176
|
+
before { preinstall('pmtacceptance-apache', '0.0.3') }
|
177
|
+
let(:module) { 'pmtacceptance-apache' }
|
178
|
+
|
179
|
+
it 'upgrades the module and installs the missing dependencies' do
|
180
|
+
subject.should include :result => :success
|
181
|
+
graph_should_include 'pmtacceptance-apache', v('0.0.3') => v('0.1.1')
|
182
|
+
graph_should_include 'pmtacceptance-stdlib', nil => v('4.1.0'), :action => :install
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
context 'with older major versions' do
|
187
|
+
# pmtacceptance-apache 0.0.4 has no dependency on pmtacceptance-stdlib
|
188
|
+
# the next available version (0.1.1) and all subsequent versions depend on pmtacceptance-stdlib >= 2.2.1
|
189
|
+
before { preinstall('pmtacceptance-apache', '0.0.3') }
|
190
|
+
before { preinstall('pmtacceptance-stdlib', '1.0.0') }
|
191
|
+
let(:module) { 'pmtacceptance-apache' }
|
192
|
+
|
193
|
+
it 'refuses to upgrade the installed dependency to a new major version, but upgrades the module to the greatest compatible version' do
|
194
|
+
subject.should include :result => :success
|
195
|
+
graph_should_include 'pmtacceptance-apache', v('0.0.3') => v('0.0.4')
|
196
|
+
end
|
197
|
+
|
198
|
+
context 'using --ignore_dependencies' do
|
199
|
+
def options
|
200
|
+
super.merge(:ignore_dependencies => true)
|
201
|
+
end
|
202
|
+
|
203
|
+
it 'upgrades the module to the greatest available version' do
|
204
|
+
subject.should include :result => :success
|
205
|
+
graph_should_include 'pmtacceptance-apache', v('0.0.3') => v('0.10.0')
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
context 'with satisfying major versions' do
|
211
|
+
before { preinstall('pmtacceptance-apache', '0.0.3') }
|
212
|
+
before { preinstall('pmtacceptance-stdlib', '2.0.0') }
|
213
|
+
let(:module) { 'pmtacceptance-apache' }
|
214
|
+
|
215
|
+
it 'upgrades the module and its dependencies to their greatest compatible versions' do
|
216
|
+
subject.should include :result => :success
|
217
|
+
graph_should_include 'pmtacceptance-apache', v('0.0.3') => v('0.10.0')
|
218
|
+
graph_should_include 'pmtacceptance-stdlib', v('2.0.0') => v('2.6.0')
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
context 'with satisfying versions' do
|
223
|
+
before { preinstall('pmtacceptance-apache', '0.0.3') }
|
224
|
+
before { preinstall('pmtacceptance-stdlib', '2.4.0') }
|
225
|
+
let(:module) { 'pmtacceptance-apache' }
|
226
|
+
|
227
|
+
it 'upgrades the module to the greatest available version' do
|
228
|
+
subject.should include :result => :success
|
229
|
+
graph_should_include 'pmtacceptance-apache', v('0.0.3') => v('0.10.0')
|
230
|
+
graph_should_include 'pmtacceptance-stdlib', nil
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
context 'with current versions' do
|
235
|
+
before { preinstall('pmtacceptance-apache', '0.0.3') }
|
236
|
+
before { preinstall('pmtacceptance-stdlib', '2.6.0') }
|
237
|
+
let(:module) { 'pmtacceptance-apache' }
|
238
|
+
|
239
|
+
it 'upgrades the module to the greatest available version' do
|
240
|
+
subject.should include :result => :success
|
241
|
+
graph_should_include 'pmtacceptance-apache', v('0.0.3') => v('0.10.0')
|
242
|
+
graph_should_include 'pmtacceptance-stdlib', nil
|
243
|
+
end
|
244
|
+
end
|
245
|
+
|
246
|
+
context 'with shared dependencies' do
|
247
|
+
# bacula 0.0.3 depends on stdlib >= 2.2.0 and pmtacceptance/mysql >= 1.0.0
|
248
|
+
# bacula 0.0.2 depends on stdlib >= 2.2.0 and pmtacceptance/mysql >= 0.0.1
|
249
|
+
# bacula 0.0.1 depends on stdlib >= 2.2.0
|
250
|
+
|
251
|
+
# keystone 2.1.0 depends on pmtacceptance/stdlib >= 2.5.0 and pmtacceptance/mysql >=0.6.1 <1.0.0
|
252
|
+
|
253
|
+
before { preinstall('pmtacceptance-bacula', '0.0.1') }
|
254
|
+
before { preinstall('pmtacceptance-mysql', '0.9.0') }
|
255
|
+
before { preinstall('pmtacceptance-keystone', '2.1.0') }
|
256
|
+
|
257
|
+
let(:module) { 'pmtacceptance-bacula' }
|
258
|
+
|
259
|
+
it 'upgrades the module to the greatest version compatible with all other installed modules' do
|
260
|
+
subject.should include :result => :success
|
261
|
+
graph_should_include 'pmtacceptance-bacula', v('0.0.1') => v('0.0.2')
|
262
|
+
end
|
263
|
+
|
264
|
+
context 'using --force' do
|
265
|
+
def options
|
266
|
+
super.merge(:force => true)
|
267
|
+
end
|
268
|
+
|
269
|
+
it 'upgrades the module to the greatest version available' do
|
270
|
+
subject.should include :result => :success
|
271
|
+
graph_should_include 'pmtacceptance-bacula', v('0.0.1') => v('0.0.3')
|
272
|
+
end
|
273
|
+
end
|
274
|
+
end
|
275
|
+
|
276
|
+
context 'in other modulepath directories' do
|
277
|
+
before { preinstall('pmtacceptance-apache', '0.0.3') }
|
278
|
+
before { preinstall('pmtacceptance-stdlib', '1.0.0', :into => secondary_dir) }
|
279
|
+
let(:module) { 'pmtacceptance-apache' }
|
280
|
+
|
281
|
+
context 'with older major versions' do
|
282
|
+
it 'upgrades the module to the greatest version compatible with the installed modules' do
|
283
|
+
subject.should include :result => :success
|
284
|
+
graph_should_include 'pmtacceptance-apache', v('0.0.3') => v('0.0.4')
|
285
|
+
graph_should_include 'pmtacceptance-stdlib', nil
|
286
|
+
end
|
287
|
+
end
|
288
|
+
|
289
|
+
context 'with satisfying major versions' do
|
290
|
+
before { preinstall('pmtacceptance-stdlib', '2.0.0', :into => secondary_dir) }
|
291
|
+
|
292
|
+
it 'upgrades the module and its dependencies to their greatest compatible versions, in-place' do
|
293
|
+
subject.should include :result => :success
|
294
|
+
graph_should_include 'pmtacceptance-apache', v('0.0.3') => v('0.10.0')
|
295
|
+
graph_should_include 'pmtacceptance-stdlib', v('2.0.0') => v('2.6.0'), :path => secondary_dir
|
296
|
+
end
|
297
|
+
end
|
298
|
+
end
|
299
|
+
end
|
300
|
+
end
|
33
301
|
end
|
34
302
|
end
|