vagrant-fixed-ssh 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +46 -0
- data/.yardopts +1 -0
- data/CHANGELOG.md +723 -0
- data/Gemfile +3 -0
- data/LICENSE +22 -0
- data/README.md +121 -0
- data/Rakefile +18 -0
- data/bin/vagrant +60 -0
- data/config/default.rb +30 -0
- data/contrib/README.md +12 -0
- data/contrib/emacs/vagrant.el +8 -0
- data/contrib/vim/vagrantfile.vim +9 -0
- data/keys/README.md +17 -0
- data/keys/vagrant +27 -0
- data/keys/vagrant.pub +1 -0
- data/lib/vagrant.rb +197 -0
- data/lib/vagrant/action.rb +63 -0
- data/lib/vagrant/action/box/destroy.rb +25 -0
- data/lib/vagrant/action/box/download.rb +84 -0
- data/lib/vagrant/action/box/package.rb +19 -0
- data/lib/vagrant/action/box/unpackage.rb +61 -0
- data/lib/vagrant/action/box/verify.rb +23 -0
- data/lib/vagrant/action/builder.rb +128 -0
- data/lib/vagrant/action/builtin.rb +171 -0
- data/lib/vagrant/action/env/set.rb +21 -0
- data/lib/vagrant/action/environment.rb +12 -0
- data/lib/vagrant/action/general/check_virtualbox.rb +28 -0
- data/lib/vagrant/action/general/package.rb +101 -0
- data/lib/vagrant/action/general/validate.rb +18 -0
- data/lib/vagrant/action/runner.rb +53 -0
- data/lib/vagrant/action/vm/boot.rb +53 -0
- data/lib/vagrant/action/vm/check_accessible.rb +23 -0
- data/lib/vagrant/action/vm/check_box.rb +33 -0
- data/lib/vagrant/action/vm/check_guest_additions.rb +38 -0
- data/lib/vagrant/action/vm/check_port_collisions.rb +89 -0
- data/lib/vagrant/action/vm/clean_machine_folder.rb +43 -0
- data/lib/vagrant/action/vm/clear_forwarded_ports.rb +18 -0
- data/lib/vagrant/action/vm/clear_network_interfaces.rb +31 -0
- data/lib/vagrant/action/vm/clear_shared_folders.rb +18 -0
- data/lib/vagrant/action/vm/customize.rb +36 -0
- data/lib/vagrant/action/vm/default_name.rb +22 -0
- data/lib/vagrant/action/vm/destroy.rb +19 -0
- data/lib/vagrant/action/vm/destroy_unused_network_interfaces.rb +20 -0
- data/lib/vagrant/action/vm/discard_state.rb +22 -0
- data/lib/vagrant/action/vm/export.rb +57 -0
- data/lib/vagrant/action/vm/forward_ports.rb +92 -0
- data/lib/vagrant/action/vm/halt.rb +32 -0
- data/lib/vagrant/action/vm/host_name.rb +21 -0
- data/lib/vagrant/action/vm/import.rb +48 -0
- data/lib/vagrant/action/vm/match_mac_address.rb +21 -0
- data/lib/vagrant/action/vm/network.rb +403 -0
- data/lib/vagrant/action/vm/nfs.rb +196 -0
- data/lib/vagrant/action/vm/package.rb +23 -0
- data/lib/vagrant/action/vm/package_vagrantfile.rb +36 -0
- data/lib/vagrant/action/vm/provision.rb +61 -0
- data/lib/vagrant/action/vm/provisioner_cleanup.rb +26 -0
- data/lib/vagrant/action/vm/prune_nfs_exports.rb +20 -0
- data/lib/vagrant/action/vm/resume.rb +20 -0
- data/lib/vagrant/action/vm/sane_defaults.rb +78 -0
- data/lib/vagrant/action/vm/setup_package_files.rb +54 -0
- data/lib/vagrant/action/vm/share_folders.rb +114 -0
- data/lib/vagrant/action/vm/suspend.rb +20 -0
- data/lib/vagrant/action/warden.rb +92 -0
- data/lib/vagrant/box.rb +44 -0
- data/lib/vagrant/box_collection.rb +58 -0
- data/lib/vagrant/cli.rb +76 -0
- data/lib/vagrant/command.rb +24 -0
- data/lib/vagrant/command/base.rb +167 -0
- data/lib/vagrant/command/box.rb +58 -0
- data/lib/vagrant/command/box_add.rb +37 -0
- data/lib/vagrant/command/box_list.rb +28 -0
- data/lib/vagrant/command/box_remove.rb +27 -0
- data/lib/vagrant/command/box_repackage.rb +27 -0
- data/lib/vagrant/command/destroy.rb +64 -0
- data/lib/vagrant/command/gem.rb +39 -0
- data/lib/vagrant/command/halt.rb +39 -0
- data/lib/vagrant/command/init.rb +40 -0
- data/lib/vagrant/command/package.rb +75 -0
- data/lib/vagrant/command/provision.rb +40 -0
- data/lib/vagrant/command/reload.rb +39 -0
- data/lib/vagrant/command/resume.rb +33 -0
- data/lib/vagrant/command/ssh.rb +90 -0
- data/lib/vagrant/command/ssh_config.rb +51 -0
- data/lib/vagrant/command/start_mixins.rb +26 -0
- data/lib/vagrant/command/status.rb +36 -0
- data/lib/vagrant/command/suspend.rb +33 -0
- data/lib/vagrant/command/up.rb +40 -0
- data/lib/vagrant/communication.rb +7 -0
- data/lib/vagrant/communication/base.rb +56 -0
- data/lib/vagrant/communication/ssh.rb +230 -0
- data/lib/vagrant/config.rb +49 -0
- data/lib/vagrant/config/base.rb +82 -0
- data/lib/vagrant/config/container.rb +37 -0
- data/lib/vagrant/config/error_recorder.rb +19 -0
- data/lib/vagrant/config/loader.rb +127 -0
- data/lib/vagrant/config/nfs.rb +8 -0
- data/lib/vagrant/config/package.rb +7 -0
- data/lib/vagrant/config/ssh.rb +27 -0
- data/lib/vagrant/config/top.rb +72 -0
- data/lib/vagrant/config/vagrant.rb +14 -0
- data/lib/vagrant/config/vm.rb +168 -0
- data/lib/vagrant/config/vm/provisioner.rb +52 -0
- data/lib/vagrant/config/vm/sub_vm.rb +17 -0
- data/lib/vagrant/data_store.rb +92 -0
- data/lib/vagrant/downloaders.rb +7 -0
- data/lib/vagrant/downloaders/base.rb +25 -0
- data/lib/vagrant/downloaders/file.rb +22 -0
- data/lib/vagrant/downloaders/http.rb +97 -0
- data/lib/vagrant/driver.rb +8 -0
- data/lib/vagrant/driver/virtualbox.rb +134 -0
- data/lib/vagrant/driver/virtualbox_4_0.rb +459 -0
- data/lib/vagrant/driver/virtualbox_4_1.rb +459 -0
- data/lib/vagrant/driver/virtualbox_4_2.rb +606 -0
- data/lib/vagrant/driver/virtualbox_base.rb +326 -0
- data/lib/vagrant/environment.rb +522 -0
- data/lib/vagrant/errors.rb +445 -0
- data/lib/vagrant/guest.rb +18 -0
- data/lib/vagrant/guest/arch.rb +56 -0
- data/lib/vagrant/guest/base.rb +99 -0
- data/lib/vagrant/guest/debian.rb +64 -0
- data/lib/vagrant/guest/fedora.rb +66 -0
- data/lib/vagrant/guest/freebsd.rb +86 -0
- data/lib/vagrant/guest/gentoo.rb +46 -0
- data/lib/vagrant/guest/linux.rb +118 -0
- data/lib/vagrant/guest/linux/config.rb +19 -0
- data/lib/vagrant/guest/linux/error.rb +9 -0
- data/lib/vagrant/guest/openbsd.rb +20 -0
- data/lib/vagrant/guest/redhat.rb +67 -0
- data/lib/vagrant/guest/solaris.rb +118 -0
- data/lib/vagrant/guest/suse.rb +17 -0
- data/lib/vagrant/guest/ubuntu.rb +23 -0
- data/lib/vagrant/hosts.rb +37 -0
- data/lib/vagrant/hosts/arch.rb +55 -0
- data/lib/vagrant/hosts/base.rb +66 -0
- data/lib/vagrant/hosts/bsd.rb +97 -0
- data/lib/vagrant/hosts/fedora.rb +47 -0
- data/lib/vagrant/hosts/freebsd.rb +41 -0
- data/lib/vagrant/hosts/gentoo.rb +20 -0
- data/lib/vagrant/hosts/linux.rb +94 -0
- data/lib/vagrant/hosts/opensuse.rb +30 -0
- data/lib/vagrant/hosts/windows.rb +16 -0
- data/lib/vagrant/plugin.rb +81 -0
- data/lib/vagrant/provisioners.rb +12 -0
- data/lib/vagrant/provisioners/base.rb +44 -0
- data/lib/vagrant/provisioners/chef.rb +168 -0
- data/lib/vagrant/provisioners/chef_client.rb +132 -0
- data/lib/vagrant/provisioners/chef_solo.rb +234 -0
- data/lib/vagrant/provisioners/puppet.rb +176 -0
- data/lib/vagrant/provisioners/puppet_server.rb +78 -0
- data/lib/vagrant/provisioners/shell.rb +103 -0
- data/lib/vagrant/registry.rb +52 -0
- data/lib/vagrant/ssh.rb +126 -0
- data/lib/vagrant/test_helpers.rb +154 -0
- data/lib/vagrant/ui.rb +168 -0
- data/lib/vagrant/util.rb +12 -0
- data/lib/vagrant/util/ansi_escape_code_remover.rb +34 -0
- data/lib/vagrant/util/busy.rb +59 -0
- data/lib/vagrant/util/counter.rb +24 -0
- data/lib/vagrant/util/file_checksum.rb +38 -0
- data/lib/vagrant/util/file_mode.rb +12 -0
- data/lib/vagrant/util/hash_with_indifferent_access.rb +63 -0
- data/lib/vagrant/util/is_port_open.rb +38 -0
- data/lib/vagrant/util/line_ending_helpers.rb +14 -0
- data/lib/vagrant/util/network_ip.rb +28 -0
- data/lib/vagrant/util/platform.rb +68 -0
- data/lib/vagrant/util/retryable.rb +25 -0
- data/lib/vagrant/util/safe_exec.rb +36 -0
- data/lib/vagrant/util/safe_puts.rb +31 -0
- data/lib/vagrant/util/stacked_proc_runner.rb +35 -0
- data/lib/vagrant/util/subprocess.rb +247 -0
- data/lib/vagrant/util/template_renderer.rb +83 -0
- data/lib/vagrant/version.rb +6 -0
- data/lib/vagrant/vm.rb +195 -0
- data/tasks/acceptance.rake +113 -0
- data/tasks/bundler.rake +3 -0
- data/tasks/test.rake +20 -0
- data/templates/commands/init/Vagrantfile.erb +99 -0
- data/templates/commands/ssh_config/config.erb +15 -0
- data/templates/config/validation_failed.erb +7 -0
- data/templates/guests/arch/network_dhcp.erb +7 -0
- data/templates/guests/arch/network_static.erb +7 -0
- data/templates/guests/debian/network_dhcp.erb +6 -0
- data/templates/guests/debian/network_static.erb +7 -0
- data/templates/guests/fedora/network_dhcp.erb +6 -0
- data/templates/guests/fedora/network_static.erb +13 -0
- data/templates/guests/freebsd/network_dhcp.erb +3 -0
- data/templates/guests/freebsd/network_static.erb +3 -0
- data/templates/guests/gentoo/network_dhcp.erb +4 -0
- data/templates/guests/gentoo/network_static.erb +4 -0
- data/templates/guests/redhat/network_dhcp.erb +6 -0
- data/templates/guests/redhat/network_static.erb +7 -0
- data/templates/locales/en.yml +759 -0
- data/templates/nfs/exports.erb +5 -0
- data/templates/nfs/exports_freebsd.erb +5 -0
- data/templates/nfs/exports_linux.erb +5 -0
- data/templates/package_Vagrantfile.erb +11 -0
- data/templates/provisioners/chef_client/client.erb +32 -0
- data/templates/provisioners/chef_solo/solo.erb +25 -0
- data/test/acceptance/base.rb +48 -0
- data/test/acceptance/box_test.rb +99 -0
- data/test/acceptance/destroy_test.rb +37 -0
- data/test/acceptance/halt_test.rb +72 -0
- data/test/acceptance/init_test.rb +33 -0
- data/test/acceptance/networking/host_only_test.rb +37 -0
- data/test/acceptance/networking/port_forward_test.rb +125 -0
- data/test/acceptance/package_test.rb +46 -0
- data/test/acceptance/provisioning/basic_test.rb +61 -0
- data/test/acceptance/provisioning/chef_solo_test.rb +37 -0
- data/test/acceptance/provisioning/shell_test.rb +53 -0
- data/test/acceptance/resume_test.rb +17 -0
- data/test/acceptance/shared_folders_test.rb +84 -0
- data/test/acceptance/skeletons/chef_solo_basic/README.md +3 -0
- data/test/acceptance/skeletons/chef_solo_basic/cookbooks/basic/recipes/default.rb +5 -0
- data/test/acceptance/skeletons/chef_solo_json/README.md +3 -0
- data/test/acceptance/skeletons/chef_solo_json/cookbooks/basic/recipes/default.rb +6 -0
- data/test/acceptance/skeletons/provisioner_multi/README.md +3 -0
- data/test/acceptance/skeletons/provisioner_multi/cookbooks/basic/recipes/default.rb +5 -0
- data/test/acceptance/ssh_test.rb +46 -0
- data/test/acceptance/support/config.rb +42 -0
- data/test/acceptance/support/isolated_environment.rb +117 -0
- data/test/acceptance/support/matchers/have_color.rb +9 -0
- data/test/acceptance/support/matchers/match_output.rb +14 -0
- data/test/acceptance/support/matchers/succeed.rb +14 -0
- data/test/acceptance/support/network_tests.rb +29 -0
- data/test/acceptance/support/output.rb +95 -0
- data/test/acceptance/support/shared/base_context.rb +72 -0
- data/test/acceptance/support/shared/command_examples.rb +33 -0
- data/test/acceptance/support/virtualbox.rb +36 -0
- data/test/acceptance/suspend_test.rb +56 -0
- data/test/acceptance/up_basic_test.rb +33 -0
- data/test/acceptance/up_with_box_url.rb +40 -0
- data/test/acceptance/vagrant_test.rb +47 -0
- data/test/acceptance/version_test.rb +15 -0
- data/test/buildbot/README.md +72 -0
- data/test/buildbot/buildbot_config/__init__.py +0 -0
- data/test/buildbot/buildbot_config/config/__init__.py +0 -0
- data/test/buildbot/buildbot_config/config/loader.py +24 -0
- data/test/buildbot/buildbot_config/config/master.py +24 -0
- data/test/buildbot/buildbot_config/config/slave.py +22 -0
- data/test/buildbot/buildbot_config/master/__init__.py +6 -0
- data/test/buildbot/buildbot_config/master/builders.py +78 -0
- data/test/buildbot/buildbot_config/master/buildsteps.py +100 -0
- data/test/buildbot/buildbot_config/master/change_sources.py +8 -0
- data/test/buildbot/buildbot_config/master/schedulers.py +32 -0
- data/test/buildbot/buildbot_config/master/slaves.py +60 -0
- data/test/buildbot/buildbot_config/master/status.py +52 -0
- data/test/buildbot/master/Makefile.sample +28 -0
- data/test/buildbot/master/buildbot.tac +36 -0
- data/test/buildbot/master/master.cfg +67 -0
- data/test/buildbot/master/public_html/bg_gradient.jpg +0 -0
- data/test/buildbot/master/public_html/default.css +545 -0
- data/test/buildbot/master/public_html/favicon.ico +0 -0
- data/test/buildbot/master/public_html/robots.txt +10 -0
- data/test/buildbot/master/public_html/static/css/bootstrap-1.4.0.min.css +356 -0
- data/test/buildbot/master/public_html/static/css/prettify.css +97 -0
- data/test/buildbot/master/public_html/static/css/syntax.css +60 -0
- data/test/buildbot/master/public_html/static/css/vagrant.base.css +205 -0
- data/test/buildbot/master/public_html/static/images/base_box_mac.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/getting-started/success.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/icons/error.png +0 -0
- data/test/buildbot/master/public_html/static/images/vagrant_chilling.png +0 -0
- data/test/buildbot/master/public_html/static/images/vagrant_holding.png +0 -0
- data/test/buildbot/master/public_html/static/images/vagrant_looking.png +0 -0
- data/test/buildbot/master/public_html/static/images/windows/alter_path.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/edit_path.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/environment_variables_button.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/port_and_ppk_path.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/ppk_selection.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/putty_first_screen.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/save_result.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/vbox_manage_default_location.jpg +0 -0
- data/test/buildbot/master/public_html/static/js/bootstrap-tabs.js +80 -0
- data/test/buildbot/master/public_html/static/js/jquery-1.7.min.js +4 -0
- data/test/buildbot/master/templates/authfail.html +9 -0
- data/test/buildbot/master/templates/build.html +205 -0
- data/test/buildbot/master/templates/builder.html +118 -0
- data/test/buildbot/master/templates/builders.html +33 -0
- data/test/buildbot/master/templates/buildslave.html +72 -0
- data/test/buildbot/master/templates/buildslaves.html +70 -0
- data/test/buildbot/master/templates/change.html +15 -0
- data/test/buildbot/master/templates/layouts/base.html +58 -0
- data/test/buildbot/master/templates/macros/box.html +37 -0
- data/test/buildbot/master/templates/macros/build_line.html +50 -0
- data/test/buildbot/master/templates/macros/change.html +81 -0
- data/test/buildbot/master/templates/macros/forms.html +300 -0
- data/test/buildbot/master/templates/root.html +42 -0
- data/test/buildbot/master/templates/waterfall.html +53 -0
- data/test/buildbot/requirements.txt +4 -0
- data/test/buildbot/scripts/deploy.sh +38 -0
- data/test/buildbot/scripts/setup.sh +107 -0
- data/test/buildbot/slave/buildbot.tac +43 -0
- data/test/buildbot/slave/info/admin +1 -0
- data/test/buildbot/slave/info/host +1 -0
- data/test/buildbot/tests/__init__.py +0 -0
- data/test/buildbot/tests/master/__init__.py +0 -0
- data/test/buildbot/tests/master/test_slaves.py +41 -0
- data/test/buildbot/vendor/choices-0.4.0.tar.gz +0 -0
- data/test/config/acceptance_boxes.yml +7 -0
- data/test/support/isolated_environment.rb +46 -0
- data/test/support/tempdir.rb +34 -0
- data/test/unit/base.rb +21 -0
- data/test/unit/support/isolated_environment.rb +47 -0
- data/test/unit/support/shared/base_context.rb +30 -0
- data/test/unit/vagrant/action/builder_test.rb +156 -0
- data/test/unit/vagrant/action/environment_test.rb +16 -0
- data/test/unit/vagrant/action/runner_test.rb +65 -0
- data/test/unit/vagrant/action/warden_test.rb +92 -0
- data/test/unit/vagrant/box_collection_test.rb +56 -0
- data/test/unit/vagrant/box_test.rb +34 -0
- data/test/unit/vagrant/command/base_test.rb +150 -0
- data/test/unit/vagrant/config/base_test.rb +48 -0
- data/test/unit/vagrant/config/loader_test.rb +79 -0
- data/test/unit/vagrant/config/ssh_test.rb +17 -0
- data/test/unit/vagrant/config/top_test.rb +69 -0
- data/test/unit/vagrant/config/vm_test.rb +71 -0
- data/test/unit/vagrant/config_test.rb +27 -0
- data/test/unit/vagrant/data_store_test.rb +79 -0
- data/test/unit/vagrant/downloaders/base_test.rb +18 -0
- data/test/unit/vagrant/downloaders/file_test.rb +75 -0
- data/test/unit/vagrant/downloaders/http_test.rb +19 -0
- data/test/unit/vagrant/environment_test.rb +220 -0
- data/test/unit/vagrant/hosts_test.rb +36 -0
- data/test/unit/vagrant/registry_test.rb +74 -0
- data/test/unit/vagrant/util/ansi_escape_code_remover_test.rb +16 -0
- data/test/unit/vagrant/util/file_checksum_test.rb +23 -0
- data/test/unit/vagrant/util/hash_with_indifferent_access_test.rb +38 -0
- data/test/unit/vagrant/util/is_port_open_test.rb +53 -0
- data/test/unit/vagrant/util/line_endings_helper_test.rb +16 -0
- data/test/unit/vagrant/util/network_ip_test.rb +17 -0
- data/test/unit/vagrant/util/retryable_test.rb +106 -0
- data/test/unit/vagrant_test.rb +27 -0
- data/test/unit_legacy/locales/en.yml +8 -0
- data/test/unit_legacy/test_helper.rb +32 -0
- data/test/unit_legacy/vagrant/action/box/destroy_test.rb +18 -0
- data/test/unit_legacy/vagrant/action/box/download_test.rb +125 -0
- data/test/unit_legacy/vagrant/action/box/package_test.rb +25 -0
- data/test/unit_legacy/vagrant/action/box/unpackage_test.rb +84 -0
- data/test/unit_legacy/vagrant/action/box/verify_test.rb +30 -0
- data/test/unit_legacy/vagrant/action/env/set_test.rb +24 -0
- data/test/unit_legacy/vagrant/action/general/package_test.rb +268 -0
- data/test/unit_legacy/vagrant/action/general/validate_test.rb +31 -0
- data/test/unit_legacy/vagrant/action/vm/boot_test.rb +66 -0
- data/test/unit_legacy/vagrant/action/vm/check_accessible_test.rb +61 -0
- data/test/unit_legacy/vagrant/action/vm/check_box_test.rb +61 -0
- data/test/unit_legacy/vagrant/action/vm/check_guest_additions_test.rb +9 -0
- data/test/unit_legacy/vagrant/action/vm/clean_machine_folder_test.rb +84 -0
- data/test/unit_legacy/vagrant/action/vm/clear_forwarded_ports_test.rb +52 -0
- data/test/unit_legacy/vagrant/action/vm/clear_nfs_exports_test.rb +22 -0
- data/test/unit_legacy/vagrant/action/vm/clear_shared_folders_test.rb +40 -0
- data/test/unit_legacy/vagrant/action/vm/customize_test.rb +37 -0
- data/test/unit_legacy/vagrant/action/vm/destroy_test.rb +25 -0
- data/test/unit_legacy/vagrant/action/vm/destroy_unused_network_interfaces_test.rb +49 -0
- data/test/unit_legacy/vagrant/action/vm/discard_state_test.rb +45 -0
- data/test/unit_legacy/vagrant/action/vm/export_test.rb +107 -0
- data/test/unit_legacy/vagrant/action/vm/forward_ports_helpers_test.rb +77 -0
- data/test/unit_legacy/vagrant/action/vm/forward_ports_test.rb +197 -0
- data/test/unit_legacy/vagrant/action/vm/halt_test.rb +79 -0
- data/test/unit_legacy/vagrant/action/vm/host_name_test.rb +36 -0
- data/test/unit_legacy/vagrant/action/vm/import_test.rb +66 -0
- data/test/unit_legacy/vagrant/action/vm/match_mac_address_test.rb +40 -0
- data/test/unit_legacy/vagrant/action/vm/modify_test.rb +38 -0
- data/test/unit_legacy/vagrant/action/vm/network_test.rb +286 -0
- data/test/unit_legacy/vagrant/action/vm/nfs_helpers_test.rb +26 -0
- data/test/unit_legacy/vagrant/action/vm/nfs_test.rb +260 -0
- data/test/unit_legacy/vagrant/action/vm/package_test.rb +25 -0
- data/test/unit_legacy/vagrant/action/vm/package_vagrantfile_test.rb +46 -0
- data/test/unit_legacy/vagrant/action/vm/provision_test.rb +65 -0
- data/test/unit_legacy/vagrant/action/vm/provisioner_cleanup_test.rb +56 -0
- data/test/unit_legacy/vagrant/action/vm/resume_test.rb +35 -0
- data/test/unit_legacy/vagrant/action/vm/share_folders_test.rb +144 -0
- data/test/unit_legacy/vagrant/action/vm/suspend_test.rb +35 -0
- data/test/unit_legacy/vagrant/action_test.rb +89 -0
- data/test/unit_legacy/vagrant/box_collection_test.rb +45 -0
- data/test/unit_legacy/vagrant/box_test.rb +74 -0
- data/test/unit_legacy/vagrant/cli_test.rb +35 -0
- data/test/unit_legacy/vagrant/command/base_test.rb +23 -0
- data/test/unit_legacy/vagrant/command/group_base_test.rb +15 -0
- data/test/unit_legacy/vagrant/command/helpers_test.rb +88 -0
- data/test/unit_legacy/vagrant/command/init_test.rb +10 -0
- data/test/unit_legacy/vagrant/command/package_test.rb +27 -0
- data/test/unit_legacy/vagrant/config/base_test.rb +52 -0
- data/test/unit_legacy/vagrant/config/error_recorder_test.rb +18 -0
- data/test/unit_legacy/vagrant/config/ssh_test.rb +12 -0
- data/test/unit_legacy/vagrant/config/vagrant_test.rb +35 -0
- data/test/unit_legacy/vagrant/config/vm/provisioner_test.rb +92 -0
- data/test/unit_legacy/vagrant/config/vm_test.rb +47 -0
- data/test/unit_legacy/vagrant/config_test.rb +148 -0
- data/test/unit_legacy/vagrant/downloaders/http_test.rb +93 -0
- data/test/unit_legacy/vagrant/environment_test.rb +539 -0
- data/test/unit_legacy/vagrant/errors_test.rb +42 -0
- data/test/unit_legacy/vagrant/hosts/base_test.rb +46 -0
- data/test/unit_legacy/vagrant/hosts/bsd_test.rb +53 -0
- data/test/unit_legacy/vagrant/hosts/linux_test.rb +54 -0
- data/test/unit_legacy/vagrant/plugin_test.rb +9 -0
- data/test/unit_legacy/vagrant/provisioners/base_test.rb +63 -0
- data/test/unit_legacy/vagrant/provisioners/chef_client_test.rb +190 -0
- data/test/unit_legacy/vagrant/provisioners/chef_solo_test.rb +115 -0
- data/test/unit_legacy/vagrant/provisioners/chef_test.rb +209 -0
- data/test/unit_legacy/vagrant/provisioners/puppet_server_test.rb +68 -0
- data/test/unit_legacy/vagrant/provisioners/puppet_test.rb +182 -0
- data/test/unit_legacy/vagrant/provisioners/shell_test.rb +79 -0
- data/test/unit_legacy/vagrant/ssh/session_test.rb +40 -0
- data/test/unit_legacy/vagrant/ssh_test.rb +304 -0
- data/test/unit_legacy/vagrant/systems/base_test.rb +18 -0
- data/test/unit_legacy/vagrant/systems/linux_test.rb +104 -0
- data/test/unit_legacy/vagrant/util/busy_test.rb +106 -0
- data/test/unit_legacy/vagrant/util/counter_test.rb +29 -0
- data/test/unit_legacy/vagrant/util/platform_test.rb +18 -0
- data/test/unit_legacy/vagrant/util/stacked_proc_runner_test.rb +43 -0
- data/test/unit_legacy/vagrant/util/template_renderer_test.rb +145 -0
- data/test/unit_legacy/vagrant/vm_test.rb +300 -0
- data/vagrant-fixed-ssh.gemspec +70 -0
- metadata +712 -0
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'log4r'
|
2
|
+
|
3
|
+
module Vagrant
|
4
|
+
module Config
|
5
|
+
class VMConfig < Base
|
6
|
+
# Represents a single configured provisioner for a VM.
|
7
|
+
class Provisioner
|
8
|
+
attr_reader :shortcut
|
9
|
+
attr_reader :provisioner
|
10
|
+
attr_reader :config
|
11
|
+
|
12
|
+
def initialize(shortcut, options=nil, &block)
|
13
|
+
@logger = Log4r::Logger.new("vagrant::config::vm::provisioner")
|
14
|
+
@logger.debug("Provisioner config: #{shortcut}")
|
15
|
+
@shortcut = shortcut
|
16
|
+
@provisioner = shortcut
|
17
|
+
@provisioner = Vagrant.provisioners.get(shortcut) if shortcut.is_a?(Symbol)
|
18
|
+
@config = nil
|
19
|
+
|
20
|
+
@logger.info("Provisioner class: #{provisioner}")
|
21
|
+
configure(options, &block) if @provisioner
|
22
|
+
end
|
23
|
+
|
24
|
+
# Configures the provisioner if it can (if it is valid).
|
25
|
+
def configure(options=nil, &block)
|
26
|
+
config_class = @provisioner.config_class
|
27
|
+
return if !config_class
|
28
|
+
|
29
|
+
@logger.debug("Configuring provisioner with: #{config_class}")
|
30
|
+
@config = config_class.new
|
31
|
+
@config.set_options(options) if options
|
32
|
+
block.call(@config) if block
|
33
|
+
end
|
34
|
+
|
35
|
+
def validate(env, errors)
|
36
|
+
if !provisioner
|
37
|
+
# If we don't have a provisioner then the whole thing is invalid.
|
38
|
+
errors.add(I18n.t("vagrant.config.vm.provisioner_not_found", :shortcut => shortcut))
|
39
|
+
return
|
40
|
+
end
|
41
|
+
|
42
|
+
if !(provisioner <= Provisioners::Base)
|
43
|
+
errors.add(I18n.t("vagrant.config.vm.provisioner_invalid_class", :shortcut => shortcut))
|
44
|
+
end
|
45
|
+
|
46
|
+
# Pass on validation to the provisioner config
|
47
|
+
config.validate(env, errors) if config
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Vagrant
|
2
|
+
module Config
|
3
|
+
class VMConfig < Base
|
4
|
+
# Represents a single sub-VM in a multi-VM environment.
|
5
|
+
class SubVM
|
6
|
+
include Util::StackedProcRunner
|
7
|
+
|
8
|
+
attr_reader :options
|
9
|
+
|
10
|
+
def initialize
|
11
|
+
@options = {}
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,92 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
|
3
|
+
require 'log4r'
|
4
|
+
|
5
|
+
module Vagrant
|
6
|
+
# The Vagrant data store is a key-value store which is persisted
|
7
|
+
# as JSON in a local file which is specified in the initializer.
|
8
|
+
# The data store itself is accessed via typical hash accessors: `[]`
|
9
|
+
# and `[]=`. If a key is set to `nil`, then it is removed from the
|
10
|
+
# datastore. The data store is only updated on disk when {#commit}
|
11
|
+
# is called on the data store itself.
|
12
|
+
#
|
13
|
+
# The data store is a hash with indifferent access, meaning that
|
14
|
+
# while all keys are persisted as strings in the JSON, you can access
|
15
|
+
# them back as either symbols or strings. Note that this is only true
|
16
|
+
# for the top-level data store. As soon as you set a hash inside the
|
17
|
+
# data store, unless you explicitly use a {Util::HashWithIndifferentAccess},
|
18
|
+
# it will be a regular hash.
|
19
|
+
class DataStore < Util::HashWithIndifferentAccess
|
20
|
+
attr_reader :file_path
|
21
|
+
|
22
|
+
def initialize(file_path)
|
23
|
+
@logger = Log4r::Logger.new("vagrant::datastore")
|
24
|
+
|
25
|
+
if file_path
|
26
|
+
@logger.info("Created: #{file_path}")
|
27
|
+
|
28
|
+
@file_path = Pathname.new(file_path)
|
29
|
+
if @file_path.exist?
|
30
|
+
raise Errors::DotfileIsDirectory if @file_path.directory?
|
31
|
+
|
32
|
+
begin
|
33
|
+
merge!(JSON.parse(@file_path.read))
|
34
|
+
rescue JSON::ParserError
|
35
|
+
# Ignore if the data is invalid in the file.
|
36
|
+
@logger.error("Data store contained invalid JSON. Ignoring.")
|
37
|
+
end
|
38
|
+
end
|
39
|
+
else
|
40
|
+
@logger.info("No file path. In-memory data store.")
|
41
|
+
@file_path = nil
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# Commits any changes to the data to disk. Even if the data
|
46
|
+
# hasn't changed, it will be reserialized and written to disk.
|
47
|
+
def commit
|
48
|
+
if !@file_path
|
49
|
+
raise StandardError, "In-memory data stores can't be committed."
|
50
|
+
end
|
51
|
+
|
52
|
+
clean_nil_and_empties
|
53
|
+
|
54
|
+
if empty?
|
55
|
+
# Delete the file since an empty data store is not useful
|
56
|
+
@logger.info("Deleting data store since we're empty: #{@file_path}")
|
57
|
+
@file_path.delete if @file_path.exist?
|
58
|
+
else
|
59
|
+
@logger.info("Committing data to data store: #{@file_path}")
|
60
|
+
|
61
|
+
@file_path.open("w") do |f|
|
62
|
+
f.write(to_json)
|
63
|
+
f.fsync
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
protected
|
69
|
+
|
70
|
+
# Removes the "nil" and "empty?" values from the hash (children
|
71
|
+
# included) so that the final output JSON is cleaner.
|
72
|
+
def clean_nil_and_empties(hash=self)
|
73
|
+
# Clean depth first
|
74
|
+
hash.each do |k, v|
|
75
|
+
clean_nil_and_empties(v) if v.is_a?(Hash)
|
76
|
+
end
|
77
|
+
|
78
|
+
# Clean ourselves, knowing that any children have already been
|
79
|
+
# cleaned up
|
80
|
+
bad_keys = hash.inject([]) do |acc, data|
|
81
|
+
k,v = data
|
82
|
+
acc.push(k) if v.nil?
|
83
|
+
acc.push(k) if v.respond_to?(:empty?) && v.empty?
|
84
|
+
acc
|
85
|
+
end
|
86
|
+
|
87
|
+
bad_keys.each do |key|
|
88
|
+
hash.delete(key)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Vagrant
|
2
|
+
module Downloaders
|
3
|
+
# Represents a base class for a downloader. A downloader handles
|
4
|
+
# downloading a box file to a temporary file.
|
5
|
+
class Base
|
6
|
+
include Vagrant::Util
|
7
|
+
|
8
|
+
def initialize(ui)
|
9
|
+
@ui = ui
|
10
|
+
end
|
11
|
+
|
12
|
+
# Tests whether a URL matches this download. Subclasses must
|
13
|
+
# override this and return `true` for any URLs they wish to
|
14
|
+
# handle.
|
15
|
+
def self.match?(url); false; end
|
16
|
+
|
17
|
+
# Called prior to execution so any error checks can be done
|
18
|
+
def prepare(source_url); end
|
19
|
+
|
20
|
+
# Downloads the source file to the destination file. It is up to
|
21
|
+
# implementors of this class to handle the logic.
|
22
|
+
def download!(source_url, destination_file); end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
module Vagrant
|
4
|
+
module Downloaders
|
5
|
+
# "Downloads" a file to a temporary file. Basically, this downloader
|
6
|
+
# simply does a file copy.
|
7
|
+
class File < Base
|
8
|
+
def self.match?(uri)
|
9
|
+
::File.file?(::File.expand_path(uri))
|
10
|
+
end
|
11
|
+
|
12
|
+
def prepare(source_url)
|
13
|
+
raise Errors::DownloaderFileDoesntExist if !::File.file?(::File.expand_path(source_url))
|
14
|
+
end
|
15
|
+
|
16
|
+
def download!(source_url, destination_file)
|
17
|
+
@ui.info I18n.t("vagrant.downloaders.file.download")
|
18
|
+
FileUtils.cp(::File.expand_path(source_url), destination_file.path)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require 'net/https'
|
3
|
+
require 'uri'
|
4
|
+
require 'base64'
|
5
|
+
|
6
|
+
module Vagrant
|
7
|
+
module Downloaders
|
8
|
+
# Downloads a file from an HTTP URL to a temporary file. This
|
9
|
+
# downloader reports its progress to stdout while downloading.
|
10
|
+
class HTTP < Base
|
11
|
+
def self.match?(uri)
|
12
|
+
# URI.parse barfs on '<drive letter>:\\files \on\ windows'
|
13
|
+
extracted = URI.extract(uri).first
|
14
|
+
extracted && extracted.include?(uri)
|
15
|
+
end
|
16
|
+
|
17
|
+
def download!(source_url, destination_file)
|
18
|
+
uri = URI.parse(source_url)
|
19
|
+
proxy_uri = resolve_proxy(uri)
|
20
|
+
|
21
|
+
http = Net::HTTP.new(uri.host, uri.port, proxy_uri.host, proxy_uri.port, proxy_uri.user, proxy_uri.password)
|
22
|
+
http.read_timeout = nil # Disable the read timeout, just let it try to download
|
23
|
+
|
24
|
+
if uri.scheme == "https"
|
25
|
+
http.use_ssl = true
|
26
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
27
|
+
end
|
28
|
+
|
29
|
+
http.start do |h|
|
30
|
+
@ui.info I18n.t("vagrant.downloaders.http.download", :url => source_url)
|
31
|
+
|
32
|
+
headers = nil
|
33
|
+
if uri.user && uri.password
|
34
|
+
headers = {'Authorization' => 'Basic ' + Base64.encode64(uri.user + ':' + uri.password)}
|
35
|
+
end
|
36
|
+
|
37
|
+
h.request_get(uri.request_uri, headers) do |response|
|
38
|
+
if response.is_a?(Net::HTTPRedirection)
|
39
|
+
# Follow the HTTP redirect.
|
40
|
+
# TODO: Error on some redirect limit
|
41
|
+
download!(response["Location"], destination_file)
|
42
|
+
return
|
43
|
+
elsif !response.is_a?(Net::HTTPOK)
|
44
|
+
raise Errors::DownloaderHTTPStatusError, :status => response.code
|
45
|
+
end
|
46
|
+
|
47
|
+
total = response.content_length
|
48
|
+
progress = 0
|
49
|
+
segment_count = 0
|
50
|
+
|
51
|
+
response.read_body do |segment|
|
52
|
+
# Report the progress out
|
53
|
+
progress += segment.length
|
54
|
+
segment_count += 1
|
55
|
+
|
56
|
+
# Progress reporting is limited to every 25 segments just so
|
57
|
+
# we're not constantly updating
|
58
|
+
if segment_count % 25 == 0
|
59
|
+
@ui.clear_line
|
60
|
+
@ui.report_progress(progress, total)
|
61
|
+
segment_count = 0
|
62
|
+
end
|
63
|
+
|
64
|
+
# Store the segment
|
65
|
+
destination_file.write(segment)
|
66
|
+
end
|
67
|
+
|
68
|
+
# Clear the line one last time so that the progress meter disappears
|
69
|
+
@ui.clear_line
|
70
|
+
end
|
71
|
+
end
|
72
|
+
rescue SocketError
|
73
|
+
raise Errors::DownloaderHTTPSocketError
|
74
|
+
end
|
75
|
+
|
76
|
+
private
|
77
|
+
|
78
|
+
# This method respects the "http_proxy" and "no_proxy" environmental
|
79
|
+
# variables so that HTTP proxies can properly be used with Vagrant.
|
80
|
+
def resolve_proxy(source_uri)
|
81
|
+
proxy_string = ENV["http_proxy"] || ""
|
82
|
+
if !proxy_string.empty? && ENV.has_key?("no_proxy")
|
83
|
+
# Respect the "no_proxy" environmental variable which contains a list
|
84
|
+
# of hosts that a proxy should not be used for.
|
85
|
+
ENV["no_proxy"].split(",").each do |host|
|
86
|
+
if source_uri.host =~ /#{Regexp.quote(host.strip)}$/
|
87
|
+
proxy_string = ""
|
88
|
+
break
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
URI.parse(proxy_string)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
module Vagrant
|
2
|
+
module Driver
|
3
|
+
autoload :VirtualBox, 'vagrant/driver/virtualbox'
|
4
|
+
autoload :VirtualBox_4_0, 'vagrant/driver/virtualbox_4_0'
|
5
|
+
autoload :VirtualBox_4_1, 'vagrant/driver/virtualbox_4_1'
|
6
|
+
autoload :VirtualBox_4_2, 'vagrant/driver/virtualbox_4_2'
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,134 @@
|
|
1
|
+
require 'forwardable'
|
2
|
+
|
3
|
+
require 'log4r'
|
4
|
+
|
5
|
+
require 'vagrant/driver/virtualbox_base'
|
6
|
+
|
7
|
+
module Vagrant
|
8
|
+
module Driver
|
9
|
+
# This class contains the logic to drive VirtualBox.
|
10
|
+
#
|
11
|
+
# Read the VirtualBoxBase source for documentation on each method.
|
12
|
+
class VirtualBox < VirtualBoxBase
|
13
|
+
# This is raised if the VM is not found when initializing a driver
|
14
|
+
# with a UUID.
|
15
|
+
class VMNotFound < StandardError; end
|
16
|
+
|
17
|
+
# We use forwardable to do all our driver forwarding
|
18
|
+
extend Forwardable
|
19
|
+
|
20
|
+
# The UUID of the virtual machine we represent
|
21
|
+
attr_reader :uuid
|
22
|
+
|
23
|
+
# The version of virtualbox that is running.
|
24
|
+
attr_reader :version
|
25
|
+
|
26
|
+
def initialize(uuid=nil)
|
27
|
+
# Setup the base
|
28
|
+
super()
|
29
|
+
|
30
|
+
@logger = Log4r::Logger.new("vagrant::driver::virtualbox")
|
31
|
+
@uuid = uuid
|
32
|
+
|
33
|
+
# Read and assign the version of VirtualBox we know which
|
34
|
+
# specific driver to instantiate.
|
35
|
+
begin
|
36
|
+
@version = read_version || ""
|
37
|
+
rescue Subprocess::LaunchError
|
38
|
+
# This means that VirtualBox was not found, so we raise this
|
39
|
+
# error here.
|
40
|
+
raise Errors::VirtualBoxNotDetected
|
41
|
+
end
|
42
|
+
|
43
|
+
# Instantiate the proper version driver for VirtualBox
|
44
|
+
@logger.debug("Finding driver for VirtualBox version: #{@version}")
|
45
|
+
driver_map = {
|
46
|
+
"4.0" => VirtualBox_4_0,
|
47
|
+
"4.1" => VirtualBox_4_1,
|
48
|
+
"4.2" => VirtualBox_4_2
|
49
|
+
}
|
50
|
+
|
51
|
+
driver_klass = nil
|
52
|
+
driver_map.each do |key, klass|
|
53
|
+
if @version.start_with?(key)
|
54
|
+
driver_klass = klass
|
55
|
+
break
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
if !driver_klass
|
60
|
+
supported_versions = driver_map.keys.sort.join(", ")
|
61
|
+
raise Errors::VirtualBoxInvalidVersion, :supported_versions => supported_versions
|
62
|
+
end
|
63
|
+
|
64
|
+
@logger.info("Using VirtualBox driver: #{driver_klass}")
|
65
|
+
@driver = driver_klass.new(@uuid)
|
66
|
+
|
67
|
+
if @uuid
|
68
|
+
# Verify the VM exists, and if it doesn't, then don't worry
|
69
|
+
# about it (mark the UUID as nil)
|
70
|
+
raise VMNotFound if !@driver.vm_exists?(@uuid)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def_delegators :@driver, :clear_forwarded_ports,
|
75
|
+
:clear_shared_folders,
|
76
|
+
:create_dhcp_server,
|
77
|
+
:create_host_only_network,
|
78
|
+
:delete,
|
79
|
+
:delete_unused_host_only_networks,
|
80
|
+
:discard_saved_state,
|
81
|
+
:enable_adapters,
|
82
|
+
:execute_command,
|
83
|
+
:export,
|
84
|
+
:forward_ports,
|
85
|
+
:halt,
|
86
|
+
:import,
|
87
|
+
:read_forwarded_ports,
|
88
|
+
:read_bridged_interfaces,
|
89
|
+
:read_guest_additions_version,
|
90
|
+
:read_host_only_interfaces,
|
91
|
+
:read_mac_address,
|
92
|
+
:read_machine_folder,
|
93
|
+
:read_network_interfaces,
|
94
|
+
:read_state,
|
95
|
+
:read_used_ports,
|
96
|
+
:read_vms,
|
97
|
+
:set_mac_address,
|
98
|
+
:set_name,
|
99
|
+
:share_folders,
|
100
|
+
:ssh_port,
|
101
|
+
:start,
|
102
|
+
:suspend,
|
103
|
+
:verify!,
|
104
|
+
:verify_image,
|
105
|
+
:vm_exists?
|
106
|
+
|
107
|
+
protected
|
108
|
+
|
109
|
+
# This returns the version of VirtualBox that is running.
|
110
|
+
#
|
111
|
+
# @return [String]
|
112
|
+
def read_version
|
113
|
+
# The version string is usually in one of the following formats:
|
114
|
+
#
|
115
|
+
# * 4.1.8r1234
|
116
|
+
# * 4.1.8r1234_OSE
|
117
|
+
# * 4.1.8_MacPortsr1234
|
118
|
+
#
|
119
|
+
# Below accounts for all of these.
|
120
|
+
|
121
|
+
# Note: We split this into multiple lines because apparently "".split("_")
|
122
|
+
# is [], so we have to check for an empty array in between.
|
123
|
+
output = execute("--version")
|
124
|
+
if output =~ /vboxdrv kernel module is not loaded/
|
125
|
+
raise Errors::VirtualBoxKernelModuleNotLoaded
|
126
|
+
end
|
127
|
+
|
128
|
+
parts = output.split("_")
|
129
|
+
return nil if parts.empty?
|
130
|
+
parts[0].split("r")[0]
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|