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
|
@@ -12,16 +12,21 @@ module Hype
|
|
|
12
12
|
end
|
|
13
13
|
class TestClass
|
|
14
14
|
include Remote
|
|
15
|
+
include RemoterBase
|
|
15
16
|
|
|
16
17
|
def keypair
|
|
17
18
|
"fake_keypair"
|
|
18
19
|
end
|
|
20
|
+
def verbose
|
|
21
|
+
false
|
|
22
|
+
end
|
|
19
23
|
end
|
|
20
24
|
|
|
21
25
|
describe "Remote" do
|
|
22
26
|
before(:each) do
|
|
23
27
|
@tc = TestClass.new
|
|
24
|
-
|
|
28
|
+
@tc.stub!(:verbose).and_return false
|
|
29
|
+
setup
|
|
25
30
|
end
|
|
26
31
|
it "should have the method 'using'" do
|
|
27
32
|
@tc.respond_to?(:using).should == true
|
|
@@ -130,7 +135,7 @@ describe "Remote" do
|
|
|
130
135
|
end
|
|
131
136
|
describe "can_start_a_new_instance?" do
|
|
132
137
|
it "should be true because the maximum instances are not running" do
|
|
133
|
-
@tc.can_start_a_new_instance?.should ==
|
|
138
|
+
@tc.can_start_a_new_instance?.should == false
|
|
134
139
|
end
|
|
135
140
|
it "should say that we cannot start a new instance because we are at the maximum instances" do
|
|
136
141
|
add_stub_instance_to(@tc, 7)
|
|
@@ -192,20 +197,30 @@ describe "Remote" do
|
|
|
192
197
|
end
|
|
193
198
|
describe "expansions" do
|
|
194
199
|
before(:each) do
|
|
200
|
+
setup
|
|
195
201
|
@tc.stub!(:copy_ssh_app).and_return true
|
|
196
202
|
@tc.stub!(:prepare_reconfiguration).and_return "full"
|
|
197
|
-
PoolParty::Provisioner.stub!(:
|
|
203
|
+
PoolParty::Provisioner.stub!(:reconfigure_master).and_return true
|
|
198
204
|
@tc.stub!(:wait).and_return true
|
|
205
|
+
@tc.stub!(:nonmaster_nonterminated_instances).and_return response_list_of_instances
|
|
206
|
+
@inst = stub_instance(9, "running")
|
|
207
|
+
@tc.nonmaster_nonterminated_instances.stub!(:last).and_return @inst
|
|
208
|
+
@inst.stub!(:options).and_return({:name => "red"})
|
|
209
|
+
@tc.stub!(:rsync_storage_files_to).and_return true
|
|
210
|
+
@tc.stub!(:run_command_on).and_return true
|
|
211
|
+
@tc.stub!(:full_keypair_path).and_return "true"
|
|
199
212
|
end
|
|
200
213
|
describe "expand_cloud_if_necessary" do
|
|
201
214
|
before(:each) do
|
|
215
|
+
setup
|
|
202
216
|
stub_list_from_remote_for(@tc)
|
|
203
|
-
@tc.stub!(:request_launch_new_instances).and_return
|
|
217
|
+
@tc.stub!(:request_launch_new_instances).and_return PoolParty::Remote::RemoteInstance.new(:ip => "127.0.0.1", :num => 1)
|
|
204
218
|
@tc.stub!(:can_start_a_new_instance).and_return true
|
|
205
219
|
@tc.stub!(:list_of_pending_instances).and_return []
|
|
206
|
-
@tc.stub!(:
|
|
220
|
+
@tc.stub!(:prepare_for_configuration).and_return true
|
|
207
221
|
@tc.stub!(:build_and_store_new_config_file).and_return true
|
|
208
|
-
PoolParty::Provisioner.stub!(:provision_slaves).and_return true
|
|
222
|
+
PoolParty::Provisioner.stub!(:provision_slaves).and_return true
|
|
223
|
+
Kernel.stub!(:system).and_return true
|
|
209
224
|
end
|
|
210
225
|
it "should receive can_start_a_new_instance?" do
|
|
211
226
|
@tc.should_receive(:can_start_a_new_instance?).once
|
|
@@ -215,11 +230,16 @@ describe "Remote" do
|
|
|
215
230
|
end
|
|
216
231
|
it "should call request_launch_new_instances if we should_expand_cloud?" do
|
|
217
232
|
@tc.should_receive(:should_expand_cloud?).once.and_return true
|
|
218
|
-
@tc.should_receive(:
|
|
233
|
+
@tc.should_receive(:request_launch_one_instance_at_a_time).once.and_return [{:ip => "127.0.0.5", :name => "node2"}]
|
|
219
234
|
end
|
|
220
235
|
it "should call a new slave provisioner" do
|
|
221
236
|
@tc.stub!(:should_expand_cloud?).once.and_return true
|
|
222
|
-
PoolParty::Provisioner.should_receive(:
|
|
237
|
+
PoolParty::Provisioner.should_receive(:provision_slave).at_least(1)
|
|
238
|
+
# Kernel.should_receive(:system).with(". /etc/profile && cloud-provision -i 5 2>&1 > /dev/null &").and_return true
|
|
239
|
+
end
|
|
240
|
+
it "should call reconfigure on the master to pick up the new slave" do
|
|
241
|
+
@tc.stub!(:should_expand_cloud?).once.and_return true
|
|
242
|
+
PoolParty::Provisioner.should_receive(:reconfigure_master).once
|
|
223
243
|
end
|
|
224
244
|
after(:each) do
|
|
225
245
|
@tc.expand_cloud_if_necessary
|
|
@@ -230,6 +250,7 @@ describe "Remote" do
|
|
|
230
250
|
@tc.stub!(:request_termination_of_non_master_instance).and_return true
|
|
231
251
|
@tc.stub!(:can_shutdown_an_instance?).and_return true
|
|
232
252
|
@tc.stub!(:wait).and_return true
|
|
253
|
+
@tc.stub!(:valid_rules?).and_return false
|
|
233
254
|
end
|
|
234
255
|
it "should receive can_shutdown_an_instance?" do
|
|
235
256
|
@tc.should_receive(:can_shutdown_an_instance?).once
|
|
@@ -271,6 +292,7 @@ describe "Remote" do
|
|
|
271
292
|
before(:each) do
|
|
272
293
|
@tc.stub!(:keypair).and_return "fake_keypair"
|
|
273
294
|
@tc.stub!(:keypair_path).and_return "~/.ec2/fake_keypair"
|
|
295
|
+
@obj.stub!(:name).and_return "pop"
|
|
274
296
|
end
|
|
275
297
|
it "should call system on the kernel" do
|
|
276
298
|
::File.stub!(:exists?).with("#{File.expand_path(Base.base_keypair_path)}/id_rsa-funky").and_return true
|
|
@@ -7,9 +7,12 @@ class TestRemoter
|
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
describe "RemoterBase" do
|
|
10
|
+
before(:each) do
|
|
11
|
+
setup
|
|
12
|
+
end
|
|
10
13
|
describe "methods" do
|
|
11
14
|
before(:each) do
|
|
12
|
-
@tr = TestRemoter.new
|
|
15
|
+
@tr = TestRemoter.new
|
|
13
16
|
end
|
|
14
17
|
%w(launch_new_instance! terminate_instance describe_instance instances_list).each do |method|
|
|
15
18
|
eval <<-EOE
|
|
@@ -2,6 +2,10 @@ require File.dirname(__FILE__) + '/../spec_helper'
|
|
|
2
2
|
|
|
3
3
|
include PoolParty::Remote
|
|
4
4
|
|
|
5
|
+
def valid_rules?(*args)
|
|
6
|
+
false
|
|
7
|
+
end
|
|
8
|
+
|
|
5
9
|
class TestClass
|
|
6
10
|
include CloudResourcer
|
|
7
11
|
include Remote
|
|
@@ -14,6 +18,7 @@ class TestClass
|
|
|
14
18
|
end
|
|
15
19
|
describe "Remoter" do
|
|
16
20
|
before(:each) do
|
|
21
|
+
setup
|
|
17
22
|
@cloud = cloud :app do;end
|
|
18
23
|
@tc = TestClass.new
|
|
19
24
|
@tc.parent = @cloud
|
|
@@ -45,7 +50,7 @@ describe "Remoter" do
|
|
|
45
50
|
@ri.stub!(:ip).and_return "192.168.0.22"
|
|
46
51
|
end
|
|
47
52
|
it "should have rsync in the rsync_command" do
|
|
48
|
-
@tc.rsync_command.should == "rsync
|
|
53
|
+
@tc.rsync_command.should == "rsync -azP --exclude cache -e '#{@tc.ssh_string}'"
|
|
49
54
|
end
|
|
50
55
|
it "should be able to rsync storage commands" do
|
|
51
56
|
@tc.rsync_storage_files_to_command(@ri).should == "#{@tc.rsync_command} #{Base.storage_directory}/ 192.168.0.22:/var/poolparty"
|
|
@@ -59,7 +64,11 @@ describe "Remoter" do
|
|
|
59
64
|
@tc.stub!(:list_of_pending_instances).and_return []
|
|
60
65
|
@tc.stub!(:list_of_running_instances).and_return []
|
|
61
66
|
@tc.stub!(:master).and_return ris.first
|
|
67
|
+
@tc.stub!(:after_launched).and_return true
|
|
68
|
+
@tc.stub!(:verbose).and_return false
|
|
62
69
|
Provisioner.stub!(:provision_master).and_return true
|
|
70
|
+
Provisioner.stub!(:reconfigure_master).and_return true
|
|
71
|
+
Provisioner.stub!(:clear_master_ssl_certs).and_return true
|
|
63
72
|
end
|
|
64
73
|
it "should have the method launch_master!" do
|
|
65
74
|
@tc.respond_to?(:launch_and_configure_master!).should == true
|
|
@@ -71,7 +80,7 @@ describe "Remoter" do
|
|
|
71
80
|
@tc.should_receive(:is_master_running?).and_return false
|
|
72
81
|
end
|
|
73
82
|
it "should ask to request_launch_new_instances when the master is not running and we can start a new instance" do
|
|
74
|
-
@tc.should_receive(:
|
|
83
|
+
@tc.should_receive(:request_launch_master_instance)
|
|
75
84
|
@tc.stub!(:can_start_a_new_instance?).and_return true
|
|
76
85
|
@tc.stub!(:is_master_running?).and_return false
|
|
77
86
|
end
|
|
@@ -82,111 +91,5 @@ describe "Remoter" do
|
|
|
82
91
|
@tc.launch_and_configure_master!
|
|
83
92
|
end
|
|
84
93
|
end
|
|
85
|
-
describe "listing" do
|
|
86
|
-
before(:each) do
|
|
87
|
-
@loc = Base.storage_directory + "/tc-instances.list"
|
|
88
|
-
@locations = [@loc]
|
|
89
|
-
@tc.stub!(:local_instances_list_file_locations).and_return @locations
|
|
90
|
-
end
|
|
91
|
-
it "should have the method list_from_local available" do
|
|
92
|
-
TestClass.respond_to?(:list_from_local).should == true
|
|
93
|
-
end
|
|
94
|
-
it "should have the method list_from_remote available" do
|
|
95
|
-
TestClass.respond_to?(:list_from_remote).should == true
|
|
96
|
-
end
|
|
97
|
-
describe "remote" do
|
|
98
|
-
before(:each) do
|
|
99
|
-
@tc.stub!(:list_of_instances).and_return @sample_instances_list
|
|
100
|
-
@tc.stub!(:local_instances_list_file_locations).and_return [
|
|
101
|
-
"#{Base.storage_directory}/tc-instances.list"
|
|
102
|
-
]
|
|
103
|
-
end
|
|
104
|
-
it "should call list_of_instances when trying to list from remote" do
|
|
105
|
-
TestClass.should_receive(:list_of_instances).once.and_return @sample_instances_list
|
|
106
|
-
TestClass.list_from_remote
|
|
107
|
-
end
|
|
108
|
-
it "should create a new RemoteInstance for each hashed instance" do
|
|
109
|
-
PoolParty::Remote::RemoteInstance.should_receive(:new).exactly(2).and_return @ri
|
|
110
|
-
@tc.list_from_remote
|
|
111
|
-
end
|
|
112
|
-
it "should return a string" do
|
|
113
|
-
@tc.list_from_remote.class.should == Array
|
|
114
|
-
end
|
|
115
|
-
it "should contain the master in the listing" do
|
|
116
|
-
@tc.list_from_remote.first.name.should == "master"
|
|
117
|
-
@tc.list_from_remote.first.master?.should == true
|
|
118
|
-
end
|
|
119
|
-
it "should write to the first (preferred) local instances list file location for next time" do
|
|
120
|
-
@tc.list_from_remote(:cache => true)
|
|
121
|
-
::File.file?(@tc.local_instances_list_file_locations.first).should == true
|
|
122
|
-
end
|
|
123
|
-
after(:all) do
|
|
124
|
-
# Cleanup after ourselves
|
|
125
|
-
# FileUtils.rm @loc if ::File.file?(@loc)
|
|
126
|
-
end
|
|
127
|
-
end
|
|
128
|
-
describe "local" do
|
|
129
|
-
describe "listing" do
|
|
130
|
-
before(:each) do
|
|
131
|
-
stub_list_from_remote_for(@tc)
|
|
132
|
-
@tc.stub!(:list_of_instances).and_return([@ri])
|
|
133
|
-
end
|
|
134
|
-
it "should call local_instances_list_file_locations" do
|
|
135
|
-
@tc.should_receive(:local_instances_list_file_locations).at_least(1).and_return [@loc]
|
|
136
|
-
end
|
|
137
|
-
it "should call File.file? on the local_instances_list_file_locations locations" do
|
|
138
|
-
File.should_receive(:file?).with(@loc).at_least(1).and_return false
|
|
139
|
-
end
|
|
140
|
-
it "should call get_working_listing_file to get the working local instance file" do
|
|
141
|
-
@tc.should_receive(:get_working_listing_file).at_least(1).and_return nil
|
|
142
|
-
end
|
|
143
|
-
after(:each) do
|
|
144
|
-
@tc.list_from_local
|
|
145
|
-
end
|
|
146
|
-
end
|
|
147
|
-
describe "with listing" do
|
|
148
|
-
before(:each) do
|
|
149
|
-
str = "master 192.168.0.1
|
|
150
|
-
node1 192.168.0.2"
|
|
151
|
-
@loc.stub!(:read).and_return str
|
|
152
|
-
TestClass.stub!(:open).and_return @loc
|
|
153
|
-
TestClass.stub!(:get_working_listing_file).and_return @loc
|
|
154
|
-
@ri = PoolParty::Remote::RemoteInstance.new({:ip => "192.168.0.1", :name => "master"})
|
|
155
|
-
PoolParty::Remote::RemoteInstance.stub!(:new).and_return @ri
|
|
156
|
-
stub_list_from_remote_for(@tc)
|
|
157
|
-
end
|
|
158
|
-
it "should call open on the get_working_listing_file" do
|
|
159
|
-
@tc.should_receive(:open).with(@loc).at_least(1).and_return @loc
|
|
160
|
-
@tc.list_from_local
|
|
161
|
-
end
|
|
162
|
-
it "should create a new RemoteInstance for each line in the file" do
|
|
163
|
-
PoolParty::Remote::RemoteInstance.should_receive(:new).at_least(2)
|
|
164
|
-
@tc.list_from_local
|
|
165
|
-
end
|
|
166
|
-
it "should return a string" do
|
|
167
|
-
@tc.list_from_local.class.should == Array
|
|
168
|
-
end
|
|
169
|
-
it "should have the name of the master and the ip in the list_from_local" do
|
|
170
|
-
@tc.list_from_local[0].name.should == "master"
|
|
171
|
-
end
|
|
172
|
-
it "should have name in the listing" do
|
|
173
|
-
@ri.should_receive(:name).at_least(1).and_return "node0"
|
|
174
|
-
@ri.to_s
|
|
175
|
-
end
|
|
176
|
-
it "should have the ip in the listing" do
|
|
177
|
-
@ri.should_receive(:ip).at_least(1).and_return "127.0.0.1"
|
|
178
|
-
@ri.to_s
|
|
179
|
-
end
|
|
180
|
-
it "should call to_s on the RemoteInstance instances" do
|
|
181
|
-
PoolParty::Remote::RemoteInstance.should_receive(:new).at_least(2).and_return @ri
|
|
182
|
-
@ri.should_receive(:to_s).at_least(1)
|
|
183
|
-
@ri.to_s
|
|
184
|
-
end
|
|
185
|
-
end
|
|
186
|
-
after(:each) do
|
|
187
|
-
@tc.list_from_local
|
|
188
|
-
end
|
|
189
|
-
end
|
|
190
|
-
end
|
|
191
94
|
|
|
192
95
|
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
|
2
|
+
|
|
3
|
+
include PoolParty::Resources
|
|
4
|
+
|
|
5
|
+
class TestClass
|
|
6
|
+
include PoolParty::Resources
|
|
7
|
+
end
|
|
8
|
+
describe "Remote Instance" do
|
|
9
|
+
before(:each) do
|
|
10
|
+
reset_resources!
|
|
11
|
+
end
|
|
12
|
+
describe "wrapped" do
|
|
13
|
+
before(:each) do
|
|
14
|
+
@tc = TestClass.new
|
|
15
|
+
@cloud = MyOpenStruct.new(:keypair => "keys", :remote_keypair_path => "/keypair_path", :name => "cloudcloud")
|
|
16
|
+
@cloud.stub!(:is_a?).with(PoolParty::Cloud::Cloud).and_return true
|
|
17
|
+
@tc.stub!(:parent).and_return @cloud
|
|
18
|
+
|
|
19
|
+
@options = {:name => "deploydirectory", :from => ::File.dirname(__FILE__), :to => "/var/www/deploydirectory", :testing => false}
|
|
20
|
+
end
|
|
21
|
+
it "should be a string" do
|
|
22
|
+
@tc.has_deploydirectory(@options).to_string.should =~ /exec \{/
|
|
23
|
+
end
|
|
24
|
+
it "should included the flushed out options" do
|
|
25
|
+
@tc.has_deploydirectory(@options).to_string.should =~ /command/
|
|
26
|
+
end
|
|
27
|
+
describe "in resource" do
|
|
28
|
+
before(:each) do
|
|
29
|
+
@tc.instance_eval do
|
|
30
|
+
has_deploydirectory do
|
|
31
|
+
name "deploydirectory"
|
|
32
|
+
from ::File.dirname(__FILE__)
|
|
33
|
+
to "/var/www/deploydirectory"
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
it "should have the path set within the resource" do
|
|
38
|
+
@tc.resource(:deploydirectory).first.to_string.should =~ /exec \{/
|
|
39
|
+
end
|
|
40
|
+
it "should not have the from in the to_string" do
|
|
41
|
+
@tc.resource(:deploydirectory).first.to_string.should_not =~ /from /
|
|
42
|
+
end
|
|
43
|
+
it "should not have the to in the to_string" do
|
|
44
|
+
@tc.resource(:deploydirectory).first.to_string.should_not =~ /to /
|
|
45
|
+
end
|
|
46
|
+
it "should have onlyif in the to_string" do
|
|
47
|
+
@tc.resource(:deploydirectory).first.to_string.should =~ /onlyif/
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -2,23 +2,24 @@ require File.dirname(__FILE__) + '/../spec_helper'
|
|
|
2
2
|
|
|
3
3
|
describe "Base" do
|
|
4
4
|
before(:each) do
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
# To clear out the instance variables just in case
|
|
6
|
+
Base.instance_eval do
|
|
7
|
+
@access_key = @secret_access_key = nil
|
|
8
|
+
end
|
|
9
|
+
ENV.stub!(:[]).with("AWS_ACCESS_KEY").and_return "KEY"
|
|
10
|
+
ENV.stub!(:[]).with("AWS_SECRET_ACCESS_KEY").and_return "SECRET"
|
|
10
11
|
end
|
|
11
12
|
it "should set the user to root" do
|
|
12
13
|
Base.user.should == "root"
|
|
13
14
|
end
|
|
14
|
-
it "should set the base keypair path to
|
|
15
|
-
Base.base_keypair_path.should
|
|
15
|
+
it "should set the base keypair path to $HOME/.ec2" do
|
|
16
|
+
Base.base_keypair_path.should =~ /\.ec2/
|
|
16
17
|
end
|
|
17
18
|
it "should set the storage_directory to the tmp directory of the current working directory" do
|
|
18
19
|
Base.storage_directory.should =~ /tmp/
|
|
19
20
|
end
|
|
20
21
|
it "should set the tmp path to tmp" do
|
|
21
|
-
Base.tmp_path.should
|
|
22
|
+
Base.tmp_path.should == "/tmp/poolparty"
|
|
22
23
|
end
|
|
23
24
|
it "should set the remote storage path to /var/poolparty" do
|
|
24
25
|
Base.remote_storage_path.should == "/var/poolparty"
|
|
@@ -41,6 +42,13 @@ describe "Base" do
|
|
|
41
42
|
::File.stub!(:file?).with("ppkeys").and_return true
|
|
42
43
|
Base.get_working_key_file_locations.should == "ppkeys"
|
|
43
44
|
end
|
|
45
|
+
it "should call get_working_key_file_locations" do
|
|
46
|
+
@str = "foo"
|
|
47
|
+
@str.stub!(:read).and_return true
|
|
48
|
+
Base.stub!(:open).and_return @str
|
|
49
|
+
Base.should_receive(:get_working_key_file_locations)
|
|
50
|
+
Base.read_keyfile
|
|
51
|
+
end
|
|
44
52
|
describe "with keyfile" do
|
|
45
53
|
before(:each) do
|
|
46
54
|
@keyfile = "ppkeys"
|
|
@@ -49,7 +57,9 @@ describe "Base" do
|
|
|
49
57
|
:secret_access_key: SECRET"
|
|
50
58
|
@keyfile.stub!(:read).and_return @str
|
|
51
59
|
Base.stub!(:get_working_key_file_locations).and_return @keyfile
|
|
52
|
-
Base.stub!(:
|
|
60
|
+
Base.stub!(:read_keyfile).and_return @str
|
|
61
|
+
Base.stub!(:open).and_return @str
|
|
62
|
+
Base.reset!
|
|
53
63
|
end
|
|
54
64
|
it "should call YAML::load on the working key file" do
|
|
55
65
|
YAML.should_receive(:load).with(@str)
|
|
@@ -67,8 +77,11 @@ describe "Base" do
|
|
|
67
77
|
describe "without keyfile" do
|
|
68
78
|
before(:each) do
|
|
69
79
|
Base.stub!(:get_working_key_file_locations).and_return nil
|
|
70
|
-
|
|
71
|
-
|
|
80
|
+
Base.instance_eval do
|
|
81
|
+
@access_key = @secret_access_key = nil
|
|
82
|
+
end
|
|
83
|
+
ENV.stub!(:[]).with("AWS_ACCESS_KEY").and_return nil
|
|
84
|
+
ENV.stub!(:[]).with("AWS_SECRET_ACCESS_KEY").and_return nil
|
|
72
85
|
Base.reset!
|
|
73
86
|
end
|
|
74
87
|
it "should render the access_key nil" do
|
|
@@ -78,6 +91,22 @@ describe "Base" do
|
|
|
78
91
|
Base.secret_access_key.should == nil
|
|
79
92
|
end
|
|
80
93
|
end
|
|
94
|
+
describe "store_keys_in_file_for" do
|
|
95
|
+
before(:each) do
|
|
96
|
+
@obj = Class.new
|
|
97
|
+
@obj.stub!(:access_key).and_return "MYACCESSKEY"
|
|
98
|
+
@obj.stub!(:secret_access_key).and_return "MYSECRETACCESSKEY"
|
|
99
|
+
Base.stub!(:store_keys_in_file).and_return true
|
|
100
|
+
|
|
101
|
+
Base.store_keys_in_file_for(@obj)
|
|
102
|
+
end
|
|
103
|
+
it "should take the access key from the object" do
|
|
104
|
+
Base.access_key.should == "MYACCESSKEY"
|
|
105
|
+
end
|
|
106
|
+
it "should take the secret_access_key from the object" do
|
|
107
|
+
Base.secret_access_key.should == "MYSECRETACCESSKEY"
|
|
108
|
+
end
|
|
109
|
+
end
|
|
81
110
|
end
|
|
82
111
|
describe "storing keyfile" do
|
|
83
112
|
before(:each) do
|
|
@@ -90,10 +119,9 @@ describe "Base" do
|
|
|
90
119
|
Base.stub!(:write_to_file).and_return true
|
|
91
120
|
Base.stub!(:key_file_locations).and_return ["ppkey"]
|
|
92
121
|
end
|
|
93
|
-
it "should call access_key.nil?" do
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
end
|
|
122
|
+
# it "should call access_key.nil?" do
|
|
123
|
+
# @ak.should_receive(:nil?).once.and_return true
|
|
124
|
+
# end
|
|
97
125
|
it "should call YAML::dump" do
|
|
98
126
|
YAML.should_receive(:dump).and_return @str
|
|
99
127
|
end
|
|
@@ -104,23 +132,5 @@ describe "Base" do
|
|
|
104
132
|
Base.store_keys_in_file
|
|
105
133
|
end
|
|
106
134
|
end
|
|
107
|
-
describe "allowed_commands" do
|
|
108
|
-
before(:each) do
|
|
109
|
-
@str =<<-EOE
|
|
110
|
-
echo 'hello world'
|
|
111
|
-
EOE
|
|
112
|
-
@str.stub!(:read).and_return @str
|
|
113
|
-
Base.stub!(:open).and_return @str
|
|
114
|
-
end
|
|
115
|
-
it "should load the yaml file allowed_commands.yml" do
|
|
116
|
-
Base.allowed_commands.class.should == Array
|
|
117
|
-
end
|
|
118
|
-
it "should have the command echo 'hello world' in the list of allowed_commands" do
|
|
119
|
-
Base.allowed_commands.include?("echo 'hello world'").should == true
|
|
120
|
-
end
|
|
121
|
-
it "should not have the command rm -rf / in the list of allowed commands" do
|
|
122
|
-
Base.allowed_commands.include?("rm -rf /").should == false
|
|
123
|
-
end
|
|
124
|
-
end
|
|
125
135
|
end
|
|
126
136
|
end
|