poolparty 0.2.18 → 0.2.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Manifest.txt +142 -47
- data/PostInstall.txt +5 -5
- data/README.txt +25 -4
- data/Rakefile +46 -2
- data/bin/cloud +12 -21
- data/bin/cloud-add-keypair +18 -13
- data/bin/cloud-configure +11 -18
- data/bin/cloud-contract +7 -17
- data/bin/cloud-ensure-provisioning +39 -0
- data/bin/cloud-expand +9 -17
- data/bin/cloud-handle-load +27 -0
- data/bin/cloud-list +3 -9
- data/bin/cloud-maintain +12 -18
- data/bin/cloud-osxcopy +3 -9
- data/bin/cloud-provision +20 -21
- data/bin/cloud-refresh +4 -13
- data/bin/cloud-run +3 -4
- data/bin/cloud-ssh +3 -2
- data/bin/cloud-start +18 -21
- data/bin/cloud-stats +17 -0
- data/bin/cloud-terminate +4 -7
- data/bin/messenger-get-current-nodes +14 -0
- data/bin/pool +12 -12
- data/bin/pool-describe +0 -1
- data/bin/{pool-spec → pool-generate} +1 -0
- data/bin/pool-init +28 -0
- data/bin/pool-list +14 -12
- data/bin/pool-start +11 -17
- data/bin/server-build-messenger +13 -6
- data/bin/server-fire-cmd +1 -1
- data/bin/server-get-load +5 -16
- data/bin/server-list-active +3 -10
- data/bin/server-rerun +4 -4
- data/bin/server-send-command +18 -0
- data/bin/server-show-stats +17 -0
- data/bin/server-start-client +29 -0
- data/bin/server-start-master +13 -14
- data/bin/server-start-node +14 -15
- data/bin/server-stop-client +3 -0
- data/bin/server-stop-master +3 -0
- data/bin/server-stop-node +3 -0
- data/bin/server-update-hosts +48 -0
- data/config/hoe.rb +4 -3
- data/examples/plugin_without_plugin_directory.rb +1 -2
- data/generators/poolspec/USAGE +2 -2
- data/generators/poolspec/poolspec_generator.rb +2 -1
- data/generators/poolspec/templates/pool_spec_template.erb +3 -2
- data/lib/erlang/messenger/Rakefile +12 -0
- data/lib/erlang/messenger/ebin/client.app +19 -0
- data/lib/erlang/messenger/ebin/master.app +1 -1
- data/lib/erlang/messenger/ebin/node.app +1 -1
- data/lib/erlang/messenger/ebin/pm_client_rel-0.1.rel +1 -0
- data/lib/erlang/messenger/ebin/pm_master_rel-0.1.rel +1 -1
- data/lib/erlang/messenger/ebin/pm_node_rel-0.1.rel +1 -1
- data/lib/erlang/messenger/include/defines.hrl +27 -0
- data/lib/erlang/messenger/lib/eunit/.svn/all-wcprops +53 -0
- data/lib/erlang/messenger/lib/eunit/.svn/entries +140 -0
- data/lib/erlang/messenger/lib/eunit/.svn/format +1 -0
- data/lib/erlang/messenger/lib/eunit/.svn/prop-base/NOTES.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/.svn/text-base/AUTHORS.svn-base +2 -0
- data/lib/erlang/messenger/lib/eunit/.svn/text-base/CHANGELOG.svn-base +14 -0
- data/lib/erlang/messenger/lib/eunit/.svn/text-base/COPYING.svn-base +504 -0
- data/lib/erlang/messenger/lib/eunit/.svn/text-base/NOTES.svn-base +276 -0
- data/lib/erlang/messenger/lib/eunit/.svn/text-base/README.svn-base +3 -0
- data/lib/erlang/messenger/lib/eunit/.svn/text-base/sys.config.svn-base +9 -0
- data/lib/erlang/messenger/lib/eunit/.svn/text-base/vsn.mk.svn-base +1 -0
- data/lib/erlang/messenger/lib/eunit/doc/.svn/all-wcprops +59 -0
- data/lib/erlang/messenger/lib/eunit/doc/.svn/entries +142 -0
- data/lib/erlang/messenger/lib/eunit/doc/.svn/format +1 -0
- data/lib/erlang/messenger/lib/eunit/doc/.svn/prop-base/erlang.png.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/doc/.svn/prop-base/eunit.html.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/doc/.svn/prop-base/index.html.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/doc/.svn/prop-base/modules-frame.html.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/doc/.svn/prop-base/overview-summary.html.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/doc/.svn/prop-base/packages-frame.html.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/doc/.svn/text-base/edoc-info.svn-base +3 -0
- data/lib/erlang/messenger/lib/eunit/doc/.svn/text-base/erlang.png.svn-base +0 -0
- data/lib/erlang/messenger/lib/eunit/doc/.svn/text-base/eunit.html.svn-base +172 -0
- data/lib/erlang/messenger/lib/eunit/doc/.svn/text-base/index.html.svn-base +17 -0
- data/lib/erlang/messenger/lib/eunit/doc/.svn/text-base/modules-frame.html.svn-base +12 -0
- data/lib/erlang/messenger/lib/eunit/doc/.svn/text-base/overview-summary.html.svn-base +984 -0
- data/lib/erlang/messenger/lib/eunit/doc/.svn/text-base/overview.edoc.svn-base +980 -0
- data/lib/erlang/messenger/lib/eunit/doc/.svn/text-base/packages-frame.html.svn-base +11 -0
- data/lib/erlang/messenger/lib/eunit/doc/.svn/text-base/stylesheet.css.svn-base +55 -0
- data/lib/erlang/messenger/lib/eunit/ebin/.svn/all-wcprops +5 -0
- data/lib/erlang/messenger/lib/eunit/ebin/.svn/dir-prop-base +8 -0
- data/lib/erlang/messenger/lib/eunit/ebin/.svn/entries +28 -0
- data/lib/erlang/messenger/lib/eunit/ebin/.svn/format +1 -0
- data/lib/erlang/messenger/lib/eunit/examples/.svn/all-wcprops +23 -0
- data/lib/erlang/messenger/lib/eunit/examples/.svn/entries +66 -0
- data/lib/erlang/messenger/lib/eunit/examples/.svn/format +1 -0
- data/lib/erlang/messenger/lib/eunit/examples/.svn/prop-base/eunit_examples.erl.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/examples/.svn/prop-base/fib.erl.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/examples/.svn/text-base/eunit_examples.erl.svn-base +339 -0
- data/lib/erlang/messenger/lib/eunit/examples/.svn/text-base/fib.erl.svn-base +19 -0
- data/lib/erlang/messenger/lib/eunit/examples/.svn/text-base/tests.txt.svn-base +1 -0
- data/lib/erlang/messenger/lib/eunit/include/.svn/all-wcprops +11 -0
- data/lib/erlang/messenger/lib/eunit/include/.svn/entries +41 -0
- data/lib/erlang/messenger/lib/eunit/include/.svn/format +1 -0
- data/lib/erlang/messenger/lib/eunit/include/.svn/prop-base/eunit.hrl.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/include/.svn/text-base/eunit.hrl.svn-base +313 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/all-wcprops +113 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/entries +259 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/format +1 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/autoload.erl.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/code_monitor.erl.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit.erl.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_autoexport.erl.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_data.erl.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_internal.hrl.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_lib.erl.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_proc.erl.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_serial.erl.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_server.erl.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_striptests.erl.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_test.erl.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_tests.erl.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/eunit_tty.erl.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/prop-base/file_monitor.erl.svn-base +5 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/autoload.erl.svn-base +388 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/code_monitor.erl.svn-base +243 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit.app.src.svn-base +21 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit.appup.src.svn-base +1 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit.erl.svn-base +196 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_autoexport.erl.svn-base +102 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_data.erl.svn-base +798 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_internal.hrl.svn-base +48 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_lib.erl.svn-base +682 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_proc.erl.svn-base +552 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_serial.erl.svn-base +157 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_server.erl.svn-base +340 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_striptests.erl.svn-base +64 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_test.erl.svn-base +334 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_tests.erl.svn-base +45 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/eunit_tty.erl.svn-base +272 -0
- data/lib/erlang/messenger/lib/eunit/src/.svn/text-base/file_monitor.erl.svn-base +409 -0
- data/lib/erlang/messenger/pm_client_rel-0.1.boot +0 -0
- data/lib/erlang/messenger/pm_client_rel-0.1.script +238 -0
- data/lib/erlang/messenger/pm_master_rel-0.1.boot +0 -0
- data/lib/erlang/messenger/pm_master_rel-0.1.script +82 -85
- data/lib/erlang/messenger/pm_node_rel-0.1.boot +0 -0
- data/lib/erlang/messenger/pm_node_rel-0.1.script +80 -85
- data/lib/erlang/messenger/src/client_app.erl +39 -0
- data/lib/erlang/messenger/src/client_server.erl +60 -0
- data/lib/erlang/messenger/src/pm_client.erl +48 -18
- data/lib/erlang/messenger/src/pm_client_old.erl +52 -0
- data/lib/erlang/messenger/src/pm_client_supervisor.erl +38 -0
- data/lib/erlang/messenger/src/pm_cluster.erl +20 -16
- data/lib/erlang/messenger/src/pm_event_manager.erl +27 -0
- data/lib/erlang/messenger/src/pm_master.erl +126 -34
- data/lib/erlang/messenger/src/pm_master_event_handler.erl +72 -0
- data/lib/erlang/messenger/src/pm_master_supervisor.erl +9 -10
- data/lib/erlang/messenger/src/pm_node.erl +107 -30
- data/lib/erlang/messenger/src/pm_node_supervisor.erl +13 -15
- data/lib/erlang/messenger/src/pm_packager.erl +5 -2
- data/lib/erlang/messenger/src/pm_strings.erl +11 -0
- data/lib/erlang/messenger/src/utils.erl +43 -8
- data/lib/erlang/messenger/useful_snippets +17 -0
- data/lib/poolparty/aska/aska.rb +150 -0
- data/lib/poolparty/base_packages/haproxy.rb +19 -26
- data/lib/poolparty/base_packages/heartbeat.rb +48 -47
- data/lib/poolparty/base_packages/poolparty.rb +88 -36
- data/lib/poolparty/base_packages/runit.rb +21 -0
- data/lib/poolparty/config/postlaunchmessage.txt +5 -0
- data/lib/poolparty/core/array.rb +4 -1
- data/lib/poolparty/core/class.rb +2 -0
- data/lib/poolparty/core/exception.rb +2 -1
- data/lib/poolparty/core/hash.rb +2 -2
- data/lib/poolparty/core/kernel.rb +3 -3
- data/lib/poolparty/core/metaid.rb +15 -0
- data/lib/poolparty/core/object.rb +42 -2
- data/lib/poolparty/core/string.rb +21 -6
- data/lib/poolparty/core/symbol.rb +9 -0
- data/lib/poolparty/dependency_resolutions/puppet.rb +20 -7
- data/lib/poolparty/exceptions/CloudNotFoundException.rb +7 -0
- data/lib/poolparty/exceptions/LoadRulesException.rb +7 -0
- data/lib/poolparty/exceptions/MasterException.rb +10 -0
- data/lib/poolparty/helpers/binary.rb +37 -4
- data/lib/poolparty/helpers/console.rb +25 -8
- data/lib/poolparty/helpers/nice_printer.rb +36 -0
- data/lib/poolparty/helpers/optioner.rb +51 -16
- data/lib/poolparty/helpers/provisioner_base.rb +117 -28
- data/lib/poolparty/helpers/provisioners/master.rb +102 -35
- data/lib/poolparty/helpers/provisioners/slave.rb +25 -9
- data/lib/poolparty/modules/cloud_dsl.rb +13 -0
- data/lib/poolparty/modules/cloud_resourcer.rb +51 -8
- data/lib/poolparty/modules/configurable.rb +1 -1
- data/lib/poolparty/modules/definable_resource.rb +2 -2
- data/lib/poolparty/modules/file_writer.rb +37 -6
- data/lib/poolparty/modules/method_missing_sugar.rb +8 -3
- data/lib/poolparty/modules/pretty_printer.rb +1 -0
- data/lib/poolparty/modules/resourcing_dsl.rb +4 -2
- data/lib/poolparty/modules/thread_pool.rb +106 -0
- data/lib/poolparty/monitors/base_monitor.rb +65 -6
- data/lib/poolparty/monitors/monitors/cpu_monitor.rb +1 -1
- data/lib/poolparty/monitors/monitors/memory_monitor.rb +28 -1
- data/lib/poolparty/monitors/monitors/web_monitor.rb +18 -0
- data/lib/poolparty/net/messenger.rb +72 -0
- data/lib/poolparty/net/remote.rb +5 -2
- data/lib/poolparty/net/remote_bases/ec2/ec2_response_object.rb +66 -0
- data/lib/poolparty/net/remote_bases/ec2.rb +133 -131
- data/lib/poolparty/net/remote_instance.rb +28 -6
- data/lib/poolparty/net/remoter.rb +117 -64
- data/lib/poolparty/net/remoter_base.rb +49 -11
- data/lib/poolparty/plugins/deploydirectory.rb +66 -0
- data/lib/poolparty/plugins/line.rb +5 -4
- data/lib/poolparty/plugins/rsyncmirror.rb +26 -0
- data/lib/poolparty/plugins/runit.rb +96 -0
- data/lib/poolparty/plugins/svn.rb +1 -1
- data/lib/poolparty/pool/base.rb +47 -18
- data/lib/poolparty/pool/cloud.rb +121 -65
- data/lib/poolparty/pool/custom_resource.rb +4 -20
- data/lib/poolparty/pool/loggable.rb +3 -8
- data/lib/poolparty/pool/plugin.rb +14 -19
- data/lib/poolparty/pool/plugin_model.rb +8 -8
- data/lib/poolparty/pool/pool.rb +28 -11
- data/lib/poolparty/pool/resource.rb +109 -40
- data/lib/poolparty/pool/resources/class_package.rb +74 -33
- data/lib/poolparty/pool/resources/conditional.rb +32 -10
- data/lib/poolparty/pool/resources/custom_service.rb +30 -0
- data/lib/poolparty/pool/resources/exec.rb +6 -5
- data/lib/poolparty/pool/resources/gem_package.rb +52 -0
- data/lib/poolparty/pool/resources/mount.rb +22 -0
- data/lib/poolparty/pool/resources/package.rb +13 -3
- data/lib/poolparty/pool/resources/sshkey.rb +1 -1
- data/lib/poolparty/pool/resources/variable.rb +4 -0
- data/lib/poolparty/pool/script.rb +8 -6
- data/lib/poolparty/templates/haproxy.conf +1 -1
- data/lib/poolparty/templates/messenger/client/log-run.erb +2 -0
- data/lib/poolparty/templates/messenger/client/run.erb +4 -0
- data/lib/poolparty/templates/messenger/master/log-run.erb +2 -0
- data/lib/poolparty/templates/messenger/master/run.erb +4 -0
- data/lib/poolparty/templates/messenger/node/log-run.erb +2 -0
- data/lib/poolparty/templates/messenger/node/run.erb +4 -0
- data/lib/poolparty/templates/poolparty.monitor +1 -1
- data/lib/poolparty/templates/puppet.conf +0 -0
- data/lib/poolparty/templates/puppetcleaner +6 -0
- data/lib/poolparty/templates/puppetrerun +9 -0
- data/lib/poolparty/templates/puppetrunner +8 -0
- data/lib/poolparty/templates/yaws.conf +19 -0
- data/lib/poolparty/version.rb +1 -1
- data/lib/poolparty.rb +35 -6
- data/lib/poolpartycl.rb +4 -0
- data/log/pool.logs +0 -0
- data/poolparty.gemspec +574 -61
- data/spec/poolparty/aska/aska_spec.rb +122 -0
- data/spec/poolparty/bin/console_spec.rb +18 -0
- data/spec/poolparty/core/hash_spec.rb +4 -4
- data/spec/poolparty/core/object_spec.rb +29 -0
- data/spec/poolparty/core/string_spec.rb +6 -0
- data/spec/poolparty/core/time_spec.rb +0 -3
- data/spec/poolparty/helpers/binary_spec.rb +2 -2
- data/spec/poolparty/helpers/optioner_spec.rb +1 -4
- data/spec/poolparty/helpers/provisioner_base_spec.rb +14 -1
- data/spec/poolparty/helpers/provisioners/master_spec.rb +3 -3
- data/spec/poolparty/modules/cloud_resourcer_spec.rb +3 -3
- data/spec/poolparty/modules/configurable_spec.rb +4 -1
- data/spec/poolparty/monitors/base_monitor_spec.rb +94 -2
- data/spec/poolparty/monitors/monitors/cpu_monitor_spec.rb +0 -1
- data/spec/poolparty/monitors/monitors/memory_monitor_spec.rb +47 -0
- data/spec/poolparty/{helpers → net}/messenger_spec.rb +3 -1
- data/spec/poolparty/net/remote_bases/ec2_spec.rb +46 -5
- data/spec/poolparty/net/remote_instance_spec.rb +2 -1
- data/spec/poolparty/net/remote_spec.rb +30 -8
- data/spec/poolparty/net/remoter_base_spec.rb +4 -1
- data/spec/poolparty/net/remoter_spec.rb +11 -108
- data/spec/poolparty/plugins/deploydirectory_spec.rb +51 -0
- data/spec/poolparty/pool/base_spec.rb +43 -33
- data/spec/poolparty/pool/cloud_spec.rb +299 -248
- data/spec/poolparty/pool/custom_resource_spec.rb +10 -5
- data/spec/poolparty/pool/example_spec.rb +0 -84
- data/spec/poolparty/pool/plugin_model_spec.rb +3 -2
- data/spec/poolparty/pool/plugin_spec.rb +89 -62
- data/spec/poolparty/pool/pool_spec.rb +17 -2
- data/spec/poolparty/pool/resource_spec.rb +341 -236
- data/spec/poolparty/pool/resources/class_package_spec.rb +102 -66
- data/spec/poolparty/pool/resources/conditional_spec.rb +65 -26
- data/spec/poolparty/pool/resources/cron_spec.rb +3 -2
- data/spec/poolparty/pool/resources/exec_spec.rb +1 -1
- data/spec/poolparty/pool/resources/gem_spec.rb +18 -14
- data/spec/poolparty/pool/resources/remote_file_spec.rb +1 -1
- data/spec/poolparty/pool/resources/variable_spec.rb +1 -1
- data/spec/poolparty/pool/script_spec.rb +58 -37
- data/spec/poolparty/pool/test_plugins/webserver.rb +1 -0
- data/spec/poolparty/spec_helper.rb +16 -5
- data/tasks/deployment.rake +19 -3
- data/tasks/development.rake +11 -2
- data/tasks/ec2.rake +9 -1
- data/website/index.html +2 -2
- metadata +167 -70
- data/bin/pool-provision +0 -34
- data/erl_crash.dump +0 -8409
- data/examples/with_apache_plugin.rb +0 -22
- data/lib/erlang/messenger/Makefile +0 -15
- data/lib/erlang/messenger/ebin/master_app.beam +0 -0
- data/lib/erlang/messenger/ebin/node_app.beam +0 -0
- data/lib/erlang/messenger/ebin/pm_client.beam +0 -0
- data/lib/erlang/messenger/ebin/pm_cluster.beam +0 -0
- data/lib/erlang/messenger/ebin/pm_event_handler.beam +0 -0
- data/lib/erlang/messenger/ebin/pm_master.beam +0 -0
- data/lib/erlang/messenger/ebin/pm_master_supervisor.beam +0 -0
- data/lib/erlang/messenger/ebin/pm_node.beam +0 -0
- data/lib/erlang/messenger/ebin/pm_node_supervisor.beam +0 -0
- data/lib/erlang/messenger/ebin/pm_packager.beam +0 -0
- data/lib/erlang/messenger/ebin/utils.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/Makefile +0 -28
- data/lib/erlang/messenger/lib/eunit/ebin/autoload.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/code_monitor.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit_autoexport.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit_data.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit_lib.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit_proc.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit_serial.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit_server.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit_striptests.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit_test.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit_tests.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/eunit_tty.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/ebin/file_monitor.beam +0 -0
- data/lib/erlang/messenger/lib/eunit/src/Makefile +0 -46
- data/lib/erlang/messenger/src/pm_event_handler.erl +0 -21
- data/lib/poolparty/config/allowed_commands.yml +0 -1
- data/lib/poolparty/helpers/messenger.rb +0 -29
- data/lib/poolparty/plugins/git.rb +0 -39
- data/lib/poolparty/pool/resources/gem.rb +0 -28
- data/lib/poolparty/pool/tmp/.ppkeys +0 -3
- data/lib/poolparty/pool/tmp/happydayz +0 -1
- data/lib/poolparty/pool/tmp/install_master.sh +0 -33
- data/lib/poolparty/pool/tmp/pool.spec +0 -11
- data/lib/poolparty/pool/tmp/poolparty.pp +0 -600
- data/lib/poolparty/pool/tmp/tc-instances.list +0 -1
- data/lib/poolparty/templates/fileserver.conf +0 -4
- data/spec/poolparty/plugins/git_spec.rb +0 -33
- data/test_manifest.pp +0 -658
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
require File.dirname(__FILE__) + '/../spec_helper'
|
|
2
2
|
|
|
3
3
|
include PoolParty::Cloud
|
|
4
|
+
include PoolParty::Resources
|
|
5
|
+
|
|
4
6
|
class TestServiceClass
|
|
5
7
|
plugin :test_service do
|
|
6
8
|
def enable
|
|
@@ -11,317 +13,366 @@ end
|
|
|
11
13
|
|
|
12
14
|
describe "Cloud" do
|
|
13
15
|
before(:each) do
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
end
|
|
17
|
-
it "should respond to the pool method outside the block" do
|
|
18
|
-
@obj.respond_to?(:cloud).should == true
|
|
16
|
+
setup
|
|
17
|
+
reset_resources!
|
|
19
18
|
end
|
|
20
|
-
describe "
|
|
19
|
+
describe "wrapped" do
|
|
21
20
|
before(:each) do
|
|
22
|
-
@
|
|
23
|
-
|
|
24
|
-
it "should store the cloud in the global list of clouds" do
|
|
25
|
-
@obj.clouds.has_key?(:pop).should == true
|
|
26
|
-
end
|
|
27
|
-
it "should store the cloud" do
|
|
28
|
-
@obj.cloud(:pop).should == @cloud1
|
|
21
|
+
@obj = Object.new
|
|
22
|
+
@pool = pool :just_pool do; end
|
|
29
23
|
end
|
|
30
|
-
it "should
|
|
31
|
-
@
|
|
24
|
+
it "should respond to the pool method outside the block" do
|
|
25
|
+
@obj.respond_to?(:cloud).should == true
|
|
32
26
|
end
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
end
|
|
37
|
-
it "should return the cloud if the cloud key is already in the clouds list" do
|
|
38
|
-
@cld = cloud :pop do;end
|
|
39
|
-
@pool.cloud(:pop).should == @cld
|
|
40
|
-
end
|
|
41
|
-
describe "options" do
|
|
42
|
-
before(:each) do
|
|
43
|
-
reset!
|
|
44
|
-
@p = pool :options do
|
|
45
|
-
minimum_instances 100
|
|
46
|
-
access_key "access_key"
|
|
47
|
-
cloud :apple do
|
|
48
|
-
access_key "cloud_access_key"
|
|
49
|
-
end
|
|
27
|
+
describe "global" do
|
|
28
|
+
before(:each) do
|
|
29
|
+
@cloud1 = cloud :pop do;end
|
|
50
30
|
end
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
end
|
|
63
|
-
describe "block" do
|
|
64
|
-
before(:each) do
|
|
65
|
-
reset!
|
|
66
|
-
@cloud = Cloud.new(:test, @pool) do
|
|
67
|
-
# Inside cloud block
|
|
68
|
-
keypair "fake_keypair"
|
|
31
|
+
it "should store the cloud in the global list of clouds" do
|
|
32
|
+
@obj.clouds.has_key?(:pop).should == true
|
|
33
|
+
end
|
|
34
|
+
it "should store the cloud" do
|
|
35
|
+
@obj.cloud(:pop).should == @cloud1
|
|
36
|
+
end
|
|
37
|
+
it "should have set the using base on intantiation to ec2" do
|
|
38
|
+
@cloud1.using_remoter?.should_not == nil
|
|
39
|
+
end
|
|
40
|
+
it "should say the remoter_base is ec2 (by default)" do
|
|
41
|
+
@cloud1.remote_base.should == PoolParty::Ec2
|
|
69
42
|
end
|
|
70
43
|
end
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
@cloud.
|
|
74
|
-
end
|
|
75
|
-
it "should have services in an array" do
|
|
76
|
-
@cloud.services.class.should == Array
|
|
77
|
-
end
|
|
78
|
-
it "should have no services in the array when there are no services defined" do
|
|
79
|
-
@cloud.services.size.should == 0
|
|
80
|
-
end
|
|
81
|
-
it "should respond to a configure method" do
|
|
82
|
-
@cloud.respond_to?(:configure).should == true
|
|
44
|
+
it "should return the cloud if the cloud key is already in the clouds list" do
|
|
45
|
+
@cld = cloud :pop do;end
|
|
46
|
+
@pool.cloud(:pop).should == @cld
|
|
83
47
|
end
|
|
84
|
-
describe "
|
|
48
|
+
describe "options" do
|
|
85
49
|
before(:each) do
|
|
86
50
|
reset!
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
51
|
+
setup
|
|
52
|
+
@p = pool :options do
|
|
53
|
+
minimum_instances 100
|
|
54
|
+
access_key "access_key"
|
|
55
|
+
cloud :apple do
|
|
56
|
+
access_key "cloud_access_key"
|
|
57
|
+
end
|
|
90
58
|
end
|
|
59
|
+
@c = @p.cloud(:apple)
|
|
91
60
|
end
|
|
92
|
-
it "should be able to
|
|
93
|
-
@
|
|
61
|
+
it "should be able to grab the cloud from the pool" do
|
|
62
|
+
@c.should == @p.cloud(:apple)
|
|
94
63
|
end
|
|
95
|
-
it "should
|
|
96
|
-
@
|
|
64
|
+
it "should take the options set on the pool" do
|
|
65
|
+
@p.minimum_instances.should == 100
|
|
66
|
+
end
|
|
67
|
+
it "should take the access_key option set from the cloud" do
|
|
68
|
+
@c.access_key.should == "cloud_access_key"
|
|
97
69
|
end
|
|
98
70
|
end
|
|
99
|
-
describe "
|
|
100
|
-
|
|
101
|
-
|
|
71
|
+
describe "block" do
|
|
72
|
+
before(:each) do
|
|
73
|
+
reset!
|
|
74
|
+
@cloud = Cloud.new(:test, @pool) do
|
|
75
|
+
# Inside cloud block
|
|
76
|
+
keypair "fake_keypair"
|
|
77
|
+
end
|
|
78
|
+
@cloud.stub!(:plugin_store).and_return []
|
|
102
79
|
end
|
|
103
|
-
|
|
104
|
-
|
|
80
|
+
|
|
81
|
+
it "should be able to pull the pool from the cloud" do
|
|
82
|
+
@cloud.parent == @pool
|
|
105
83
|
end
|
|
106
|
-
it "should
|
|
107
|
-
@
|
|
108
|
-
|
|
84
|
+
it "should have the outer pool listed as the parent of the inner cloud" do
|
|
85
|
+
@pool = pool :knick_knack do
|
|
86
|
+
cloud :paddy_wack do
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
cloud(:paddy_wack).parent.should == pool(:knick_knack)
|
|
90
|
+
end
|
|
91
|
+
it "should have services in an array" do
|
|
92
|
+
@cloud.services.class.should == Array
|
|
109
93
|
end
|
|
110
|
-
it "should
|
|
111
|
-
@cloud.
|
|
112
|
-
@cloud.keypair.should == "friend"
|
|
94
|
+
it "should have no services in the array when there are no services defined" do
|
|
95
|
+
@cloud.services.size.should == 0
|
|
113
96
|
end
|
|
114
|
-
|
|
97
|
+
it "should respond to a configure method" do
|
|
98
|
+
@cloud.respond_to?(:configure).should == true
|
|
99
|
+
end
|
|
100
|
+
describe "configuration" do
|
|
115
101
|
before(:each) do
|
|
116
102
|
reset!
|
|
117
|
-
@
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
end
|
|
103
|
+
@cloud2 = Cloud.new(:test, @pool) do
|
|
104
|
+
minimum_instances 1
|
|
105
|
+
maximum_instances 2
|
|
121
106
|
end
|
|
122
|
-
@cloud = @pool.cloud(:app)
|
|
123
107
|
end
|
|
124
|
-
it "should
|
|
125
|
-
@
|
|
108
|
+
it "should be able to se the minimum_instances without the var" do
|
|
109
|
+
@cloud2.minimum_instances.should == 1
|
|
126
110
|
end
|
|
127
|
-
it "should
|
|
128
|
-
@
|
|
111
|
+
it "should be able to se the maximum_instances with the =" do
|
|
112
|
+
@cloud2.maximum_instances.should == 2
|
|
129
113
|
end
|
|
130
114
|
end
|
|
131
|
-
describe "
|
|
132
|
-
|
|
133
|
-
|
|
115
|
+
describe "options" do
|
|
116
|
+
it "should set the minimum_instances to 2" do
|
|
117
|
+
@cloud.minimum_instances.should == 2
|
|
134
118
|
end
|
|
135
|
-
it "should
|
|
136
|
-
@
|
|
137
|
-
keypair "hotdog"
|
|
138
|
-
end
|
|
139
|
-
@c.keypair.should == "hotdog"
|
|
119
|
+
it "should set the maximum_instances to 5" do
|
|
120
|
+
@cloud.maximum_instances.should == 5
|
|
140
121
|
end
|
|
141
|
-
it "should
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
122
|
+
it "should be able to set the minimum instances" do
|
|
123
|
+
@cloud.minimum_instances 3
|
|
124
|
+
@cloud.minimum_instances.should == 3
|
|
125
|
+
end
|
|
126
|
+
it "should be able to take a hash from configure and convert it to the options" do
|
|
127
|
+
@cloud.configure( {:minimum_instances => 1, :maximum_instances => 10, :keypair => "friend"} )
|
|
128
|
+
@cloud.keypair.should == "friend"
|
|
129
|
+
end
|
|
130
|
+
describe "minimum_instances/maximum_instances as a range" do
|
|
131
|
+
before(:each) do
|
|
132
|
+
reset!
|
|
133
|
+
@pool = pool :just_pool do
|
|
134
|
+
cloud :app do
|
|
135
|
+
instances 8..15
|
|
136
|
+
end
|
|
147
137
|
end
|
|
138
|
+
@cloud = @pool.cloud(:app)
|
|
139
|
+
end
|
|
140
|
+
it "should set the minimum based on the range" do
|
|
141
|
+
@cloud.minimum_instances.should == 8
|
|
142
|
+
end
|
|
143
|
+
it "should set the maximum based on the range set by instances" do
|
|
144
|
+
@cloud.maximum_instances.should == 15
|
|
148
145
|
end
|
|
149
|
-
pool(:pool).cloud(:app).keypair.should == "ney"
|
|
150
|
-
pool(:pool).cloud(:group).keypair.should == "ney"
|
|
151
146
|
end
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
147
|
+
describe "keypair" do
|
|
148
|
+
before(:each) do
|
|
149
|
+
reset!
|
|
150
|
+
end
|
|
151
|
+
it "should be able to define a keypair in the cloud" do
|
|
152
|
+
@c = cloud :app do
|
|
153
|
+
keypair "hotdog"
|
|
155
154
|
end
|
|
156
|
-
|
|
155
|
+
@c.keypair.should == "hotdog"
|
|
156
|
+
end
|
|
157
|
+
it "should take the pool parent's keypair if it's defined on the pool" do
|
|
158
|
+
pool :pool do
|
|
159
|
+
keypair "ney"
|
|
160
|
+
cloud :app do
|
|
161
|
+
end
|
|
162
|
+
cloud :group do
|
|
163
|
+
end
|
|
157
164
|
end
|
|
165
|
+
pool(:pool).cloud(:app).keypair.should == "ney"
|
|
166
|
+
pool(:pool).cloud(:group).keypair.should == "ney"
|
|
158
167
|
end
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
reset!
|
|
166
|
-
stub_list_from_remote_for(@cloud)
|
|
167
|
-
@cloud.instance_eval do
|
|
168
|
-
has_file(:name => "/etc/httpd/http.conf") do
|
|
169
|
-
content <<-EOE
|
|
170
|
-
hello my lady
|
|
171
|
-
EOE
|
|
168
|
+
it "should generate a keypair based on the cloud name if none is defined" do
|
|
169
|
+
pool :pool do
|
|
170
|
+
cloud :app do
|
|
171
|
+
end
|
|
172
|
+
cloud :nickes do
|
|
173
|
+
end
|
|
172
174
|
end
|
|
173
|
-
|
|
174
|
-
|
|
175
|
+
pool(:pool).cloud(:app).keypair.should == "pool_app"
|
|
176
|
+
pool(:pool).cloud(:nickes).keypair.should == "pool_nickes"
|
|
175
177
|
end
|
|
176
178
|
end
|
|
177
|
-
|
|
178
|
-
@cloud.respond_to?(:build_manifest).should == true
|
|
179
|
-
end
|
|
180
|
-
it "should have 3 resources" do
|
|
181
|
-
@cloud.add_poolparty_base_requirements
|
|
182
|
-
@cloud.number_of_resources.should > 3
|
|
183
|
-
end
|
|
184
|
-
it "should receive add_poolparty_base_requirements before building the manifest" do
|
|
185
|
-
@cloud.should_receive(:add_poolparty_base_requirements).once
|
|
186
|
-
@cloud.build_manifest
|
|
187
|
-
end
|
|
188
|
-
describe "add_poolparty_base_requirements" do
|
|
179
|
+
describe "Manifest" do
|
|
189
180
|
before(:each) do
|
|
190
|
-
reset!
|
|
181
|
+
reset!
|
|
182
|
+
stub_list_from_remote_for(@cloud)
|
|
191
183
|
@cloud.instance_eval do
|
|
192
|
-
|
|
184
|
+
has_file(:name => "/etc/httpd/http.conf") do
|
|
185
|
+
content <<-EOE
|
|
186
|
+
hello my lady
|
|
187
|
+
EOE
|
|
188
|
+
end
|
|
189
|
+
has_gempackage(:name => "poolparty")
|
|
190
|
+
has_package(:name => "dummy")
|
|
193
191
|
end
|
|
194
|
-
@hb = "heartbeat".class_constant.new(@cloud)
|
|
195
192
|
end
|
|
196
|
-
it "should
|
|
197
|
-
@
|
|
198
|
-
@cloud.add_poolparty_base_requirements
|
|
193
|
+
it "should it should have the method build_manifest" do
|
|
194
|
+
@cloud.respond_to?(:build_manifest).should == true
|
|
199
195
|
end
|
|
200
|
-
it "should
|
|
201
|
-
@cloud.
|
|
196
|
+
it "should make a new 'haproxy' class" do
|
|
197
|
+
@cloud.stub!(:realize_plugins!).and_return true
|
|
198
|
+
PoolPartyHaproxyClass.should_receive(:new).once
|
|
202
199
|
@cloud.add_poolparty_base_requirements
|
|
203
200
|
end
|
|
204
|
-
it "should
|
|
205
|
-
"heartbeat".class_constant.should_receive(:new).and_return @hb
|
|
206
|
-
@cloud.add_poolparty_base_requirements
|
|
207
|
-
end
|
|
208
|
-
it "should call enable on the plugin call" do
|
|
209
|
-
@hb = "heartbeat".class_constant
|
|
210
|
-
"heartbeat".class_constant.stub!(:new).and_return @hb
|
|
211
|
-
|
|
201
|
+
it "should have 3 resources" do
|
|
212
202
|
@cloud.add_poolparty_base_requirements
|
|
213
|
-
@cloud.
|
|
203
|
+
@cloud.number_of_resources.should > 2
|
|
204
|
+
end
|
|
205
|
+
it "should receive add_poolparty_base_requirements before building the manifest" do
|
|
206
|
+
@cloud.should_receive(:add_poolparty_base_requirements).once
|
|
207
|
+
@cloud.build_manifest
|
|
214
208
|
end
|
|
215
|
-
describe "
|
|
209
|
+
describe "add_poolparty_base_requirements" do
|
|
216
210
|
before(:each) do
|
|
217
|
-
|
|
218
|
-
@cloud.
|
|
211
|
+
reset!
|
|
212
|
+
@cloud.instance_eval do
|
|
213
|
+
@heartbeat = nil
|
|
214
|
+
end
|
|
215
|
+
@hb = "heartbeat".class_constant.new(@cloud)
|
|
216
|
+
@cloud.stub!(:realize_plugins!).and_return []
|
|
219
217
|
end
|
|
220
|
-
it "should
|
|
221
|
-
@cloud.
|
|
218
|
+
it "should call initialize on heartbeat (in add_poolparty_base_requirements)" do
|
|
219
|
+
@cloud.stub!(:realize_plugins!).and_return []
|
|
220
|
+
@hb.class.should_receive(:new).and_return true
|
|
221
|
+
@cloud.add_poolparty_base_requirements
|
|
222
222
|
end
|
|
223
|
-
it "should
|
|
224
|
-
@cloud.
|
|
223
|
+
it "should call heartbeat on the cloud" do
|
|
224
|
+
@cloud.should_receive(:heartbeat).and_return true
|
|
225
|
+
@cloud.add_poolparty_base_requirements
|
|
225
226
|
end
|
|
226
|
-
it "should
|
|
227
|
-
|
|
227
|
+
it "should call Hearbeat.new" do
|
|
228
|
+
"heartbeat".class_constant.should_receive(:new).and_return @hb
|
|
229
|
+
@cloud.add_poolparty_base_requirements
|
|
228
230
|
end
|
|
229
|
-
|
|
231
|
+
it "should call enable on the plugin call" do
|
|
232
|
+
@hb = "heartbeat".class_constant
|
|
233
|
+
"heartbeat".class_constant.stub!(:new).and_return @hb
|
|
234
|
+
|
|
235
|
+
@cloud.add_poolparty_base_requirements
|
|
236
|
+
@cloud.heartbeat.should == @hb
|
|
237
|
+
end
|
|
238
|
+
describe "after adding" do
|
|
230
239
|
before(:each) do
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
end
|
|
234
|
-
@service = @cloud8.services.first
|
|
235
|
-
@files = @service.resource(:file)
|
|
240
|
+
stub_list_from_remote_for(@cloud)
|
|
241
|
+
@cloud.add_poolparty_base_requirements
|
|
236
242
|
end
|
|
237
|
-
it "should
|
|
238
|
-
@
|
|
243
|
+
it "should add resources onto the heartbeat class inside the cloud" do
|
|
244
|
+
@cloud.services.size.should > 0
|
|
239
245
|
end
|
|
240
|
-
it "should
|
|
241
|
-
@
|
|
246
|
+
it "should store the class heartbeat" do
|
|
247
|
+
@cloud.services.map {|a| a.class}.include?("heartbeat".class_constant).should == true
|
|
242
248
|
end
|
|
243
|
-
it "should
|
|
244
|
-
@
|
|
249
|
+
it "should have an array of resources on the heartbeat" do
|
|
250
|
+
@cloud.services.first.resources.class.should == Hash
|
|
251
|
+
end
|
|
252
|
+
describe "resources" do
|
|
253
|
+
before(:each) do
|
|
254
|
+
@cloud8 = Cloud.new(:tester, @pool) do
|
|
255
|
+
test_service
|
|
256
|
+
end
|
|
257
|
+
@service = @cloud8.services.first
|
|
258
|
+
@files = @service.resource(:file)
|
|
259
|
+
end
|
|
260
|
+
it "should have a file resource" do
|
|
261
|
+
@files.first.nil?.should == false
|
|
262
|
+
end
|
|
263
|
+
it "should have an array of lines" do
|
|
264
|
+
@files.class.should == Array
|
|
265
|
+
end
|
|
266
|
+
it "should not be empty" do
|
|
267
|
+
@files.should_not be_empty
|
|
268
|
+
end
|
|
245
269
|
end
|
|
246
270
|
end
|
|
247
271
|
end
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
end
|
|
278
|
-
it "should include the hosts for all the listed local instances" do
|
|
279
|
-
@manifest.should =~ /host \{\n\t\t"master":/
|
|
280
|
-
end
|
|
281
|
-
end
|
|
282
|
-
describe "building with an existing manifest" do
|
|
283
|
-
before(:each) do
|
|
284
|
-
@file = "/etc/puppet/manifests/nodes/nodes.pp"
|
|
285
|
-
@file.stub!(:read).and_return "nodes"
|
|
286
|
-
::FileTest.stub!(:file?).with("/etc/puppet/manifests/classes/poolparty.pp").and_return true
|
|
287
|
-
@cloud.stub!(:open).with("/etc/puppet/manifests/classes/poolparty.pp").and_return @file
|
|
272
|
+
describe "building" do
|
|
273
|
+
before(:each) do
|
|
274
|
+
str = "master 192.168.0.1
|
|
275
|
+
node1 192.168.0.2"
|
|
276
|
+
@sample_instances_list = [{:ip => "192.168.0.1", :name => "master"}, {:ip => "192.168.0.2", :name => "node1"}]
|
|
277
|
+
@ris = @sample_instances_list.map {|h| PoolParty::Remote::RemoteInstance.new(h, @cloud) }
|
|
278
|
+
|
|
279
|
+
stub_remoter_for(@cloud)
|
|
280
|
+
|
|
281
|
+
@manifest = @cloud.build_manifest
|
|
282
|
+
end
|
|
283
|
+
it "should return a string when calling build_manifest" do
|
|
284
|
+
@manifest.class.should == String
|
|
285
|
+
end
|
|
286
|
+
it "should have a comment of # file in the manifest as described by the has_file" do
|
|
287
|
+
@manifest.should =~ /file \{/
|
|
288
|
+
end
|
|
289
|
+
it "should have the comment of a package in the manifest" do
|
|
290
|
+
@manifest.should =~ /package \{/
|
|
291
|
+
end
|
|
292
|
+
it "should have the comment for haproxy in the manifest" do
|
|
293
|
+
@manifest.should =~ /haproxy/
|
|
294
|
+
end
|
|
295
|
+
it "should include the poolparty gem" do
|
|
296
|
+
@manifest.should =~ /package \{/
|
|
297
|
+
end
|
|
298
|
+
it "should include custom functions" do
|
|
299
|
+
@manifest.should =~ /define line\(\$file/
|
|
300
|
+
end
|
|
288
301
|
end
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
302
|
+
describe "prepare_for_configuration" do
|
|
303
|
+
before(:each) do
|
|
304
|
+
@cloud.stub!(:copy_ssh_key).and_return true
|
|
305
|
+
end
|
|
306
|
+
it "should make_base_directory" do
|
|
307
|
+
@cloud.should_receive(:make_base_directory).at_least(1)
|
|
308
|
+
end
|
|
309
|
+
it "should copy_misc_templates" do
|
|
310
|
+
@cloud.should_receive(:copy_misc_templates).once
|
|
311
|
+
end
|
|
312
|
+
it "should copy_custom_monitors" do
|
|
313
|
+
@cloud.should_receive(:copy_custom_monitors).once
|
|
314
|
+
end
|
|
315
|
+
describe "copy_custom_monitors" do
|
|
316
|
+
before(:each) do
|
|
317
|
+
Base.stub!(:custom_monitor_directories).and_return ["/tmp/monitors/custom_monitor.rb"]
|
|
318
|
+
Dir.stub!(:[]).with("#{Base.custom_monitor_directories}/*.rb").and_return ["/tmp/monitors/custom_monitor.rb"]
|
|
319
|
+
@cloud.stub!(:copy_misc_templates).and_return true
|
|
320
|
+
@cloud.stub!(:copy_file_to_storage_directory).and_return true
|
|
321
|
+
end
|
|
322
|
+
it "should call make_directory_in_storage_directory with monitors" do
|
|
323
|
+
@cloud.should_receive(:make_directory_in_storage_directory).with("monitors").once
|
|
324
|
+
@cloud.stub!(:make_directory_in_storage_directory)
|
|
325
|
+
end
|
|
326
|
+
it "should copy the monitors into the monitor directory" do
|
|
327
|
+
@cloud.should_receive(:copy_file_to_storage_directory).with("/tmp/monitors/custom_monitor.rb", "monitors").at_least(1)
|
|
328
|
+
@cloud.stub!(:copy_file_to_storage_directory).and_return true
|
|
329
|
+
end
|
|
330
|
+
after(:each) do
|
|
331
|
+
@cloud.copy_custom_monitors
|
|
332
|
+
end
|
|
333
|
+
end
|
|
334
|
+
it "should store_keys_in_file" do
|
|
335
|
+
@cloud.should_receive(:store_keys_in_file).once
|
|
336
|
+
end
|
|
337
|
+
it "should call save! on Script" do
|
|
338
|
+
Script.should_receive(:save!).with(@cloud).once
|
|
339
|
+
end
|
|
340
|
+
it "should copy_ssh_key" do
|
|
341
|
+
@cloud.should_receive(:copy_ssh_key).once
|
|
342
|
+
end
|
|
343
|
+
after(:each) do
|
|
344
|
+
@cloud.prepare_for_configuration
|
|
345
|
+
end
|
|
292
346
|
end
|
|
293
|
-
|
|
294
|
-
|
|
347
|
+
describe "building with an existing manifest" do
|
|
348
|
+
before(:each) do
|
|
349
|
+
@file = "/etc/puppet/manifests/nodes/nodes.pp"
|
|
350
|
+
@file.stub!(:read).and_return "nodes generate"
|
|
351
|
+
::FileTest.stub!(:file?).with("/etc/puppet/manifests/classes/poolparty.pp").and_return true
|
|
352
|
+
@cloud.stub!(:open).with("/etc/puppet/manifests/classes/poolparty.pp").and_return @file
|
|
353
|
+
end
|
|
354
|
+
it "should not call resources_string_from_resources if the file /etc/puppet/manifests/nodes/nodes.pp exists" do
|
|
355
|
+
@cloud.should_not_receive(:add_poolparty_base_requirements)
|
|
356
|
+
@cloud.build_manifest
|
|
357
|
+
end
|
|
358
|
+
it "should build from the existing file" do
|
|
359
|
+
@cloud.build_manifest.should == "nodes generate"
|
|
360
|
+
end
|
|
295
361
|
end
|
|
296
362
|
end
|
|
297
363
|
end
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
end
|
|
311
|
-
end
|
|
312
|
-
|
|
313
|
-
describe "provisioning" do
|
|
314
|
-
it "should be able to tell that it is provisioning when setting the provisioning flag" do
|
|
315
|
-
@cloud.provisioning?.should == false
|
|
316
|
-
end
|
|
317
|
-
it "should be able to set it as provisioning" do
|
|
318
|
-
@cloud.provisioning_in_progress
|
|
319
|
-
@cloud.provisioning?.should == true
|
|
320
|
-
end
|
|
321
|
-
it "should be able to unset itself as provisioning" do
|
|
322
|
-
@cloud.provisioning_in_progress
|
|
323
|
-
@cloud.provisioning_complete
|
|
324
|
-
@cloud.provisioning?.should == false
|
|
364
|
+
|
|
365
|
+
describe "instances" do
|
|
366
|
+
before(:each) do
|
|
367
|
+
@cloud3 = cloud :pop do;keypair "fake_keypair";end
|
|
368
|
+
stub_list_from_remote_for(@cloud3)
|
|
369
|
+
end
|
|
370
|
+
it "should respond to the method master" do
|
|
371
|
+
@cloud3.respond_to?(:master).should == true
|
|
372
|
+
end
|
|
373
|
+
it "should return a master that is not nil" do
|
|
374
|
+
@cloud3.master.should_not be_nil
|
|
375
|
+
end
|
|
325
376
|
end
|
|
326
377
|
end
|
|
327
378
|
end
|