vagrant-unbundled 1.8.1.2 → 1.8.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -13
- data/.travis.yml +3 -0
- data/CHANGELOG.md +167 -4
- data/LICENSE +1 -1
- data/README.md +7 -9
- data/RELEASE.md +28 -0
- data/bin/vagrant +1 -1
- data/contrib/bash/completion.sh +6 -1
- data/contrib/sudoers/linux-fedora +1 -1
- data/keys/README.md +1 -1
- data/lib/vagrant/action/builtin/box_add.rb +7 -3
- data/lib/vagrant/action/general/package.rb +47 -13
- data/lib/vagrant/box.rb +1 -1
- data/lib/vagrant/box_collection.rb +3 -4
- data/lib/vagrant/bundler.rb +29 -11
- data/lib/vagrant/machine.rb +14 -5
- data/lib/vagrant/ui.rb +1 -1
- data/lib/vagrant/util/is_port_open.rb +1 -1
- data/lib/vagrant/util/platform.rb +67 -42
- data/plugins/commands/box/command/remove.rb +1 -1
- data/plugins/commands/box/command/update.rb +10 -0
- data/plugins/commands/destroy/command.rb +1 -1
- data/plugins/commands/halt/command.rb +1 -1
- data/plugins/commands/init/command.rb +8 -2
- data/plugins/commands/login/client.rb +19 -1
- data/plugins/commands/package/command.rb +1 -1
- data/plugins/commands/plugin/command/mixin_install_opts.rb +1 -1
- data/plugins/commands/plugin/gem_helper.rb +1 -1
- data/plugins/commands/port/command.rb +1 -1
- data/plugins/commands/rdp/command.rb +1 -1
- data/plugins/commands/resume/command.rb +15 -1
- data/plugins/commands/snapshot/command/pop.rb +16 -1
- data/plugins/commands/snapshot/command/push_shared.rb +7 -9
- data/plugins/commands/snapshot/command/restore.rb +14 -1
- data/plugins/commands/ssh/command.rb +2 -1
- data/plugins/commands/ssh_config/command.rb +1 -1
- data/plugins/commands/status/command.rb +1 -1
- data/plugins/commands/suspend/command.rb +1 -1
- data/plugins/commands/up/command.rb +4 -4
- data/plugins/communicators/ssh/communicator.rb +2 -2
- data/plugins/communicators/winrm/communicator.rb +11 -11
- data/plugins/communicators/winrm/config.rb +7 -1
- data/plugins/communicators/winrm/shell.rb +41 -41
- data/plugins/guests/amazon/cap/flavor.rb +14 -0
- data/plugins/guests/amazon/guest.rb +9 -0
- data/plugins/guests/amazon/plugin.rb +20 -0
- data/plugins/guests/arch/cap/change_host_name.rb +15 -6
- data/plugins/guests/arch/cap/configure_networks.rb +33 -14
- data/plugins/guests/arch/plugin.rb +1 -1
- data/plugins/guests/atomic/cap/change_host_name.rb +16 -1
- data/plugins/guests/atomic/plugin.rb +2 -2
- data/plugins/guests/coreos/cap/change_host_name.rb +10 -4
- data/plugins/guests/coreos/cap/configure_networks.rb +49 -37
- data/plugins/guests/coreos/guest.rb +2 -0
- data/plugins/guests/coreos/plugin.rb +1 -1
- data/plugins/guests/darwin/cap/change_host_name.rb +25 -7
- data/plugins/guests/darwin/cap/choose_addressable_ip_addr.rb +7 -7
- data/plugins/guests/darwin/cap/insert_public_key.rb +19 -7
- data/plugins/guests/darwin/guest.rb +1 -1
- data/plugins/guests/darwin/plugin.rb +1 -1
- data/plugins/guests/debian/cap/change_host_name.rb +37 -84
- data/plugins/guests/debian/cap/configure_networks.rb +61 -46
- data/plugins/guests/debian/cap/nfs_client.rb +5 -4
- data/plugins/guests/debian/cap/rsync.rb +6 -3
- data/plugins/guests/debian/cap/smb.rb +6 -7
- data/plugins/guests/debian/guest.rb +2 -0
- data/plugins/guests/debian/plugin.rb +1 -1
- data/plugins/guests/fedora/cap/change_host_name.rb +18 -64
- data/plugins/guests/fedora/cap/configure_networks.rb +10 -9
- data/plugins/guests/fedora/plugin.rb +1 -1
- data/plugins/guests/freebsd/cap/change_host_name.rb +21 -3
- data/plugins/guests/freebsd/cap/configure_networks.rb +45 -30
- data/plugins/guests/freebsd/cap/halt.rb +1 -1
- data/plugins/guests/freebsd/cap/insert_public_key.rb +21 -8
- data/plugins/guests/freebsd/cap/mount_nfs_folder.rb +10 -7
- data/plugins/guests/freebsd/cap/rsync.rb +1 -11
- data/plugins/guests/freebsd/plugin.rb +1 -1
- data/plugins/guests/funtoo/cap/configure_networks.rb +10 -6
- data/plugins/guests/gentoo/cap/configure_networks.rb +9 -8
- data/plugins/guests/linux/cap/choose_addressable_ip_addr.rb +6 -6
- data/plugins/guests/linux/cap/insert_public_key.rb +18 -8
- data/plugins/guests/linux/cap/mount_nfs.rb +16 -12
- data/plugins/guests/linux/cap/mount_smb_shared_folder.rb +2 -2
- data/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb +1 -1
- data/plugins/guests/linux/guest.rb +0 -2
- data/plugins/guests/linux/plugin.rb +1 -1
- data/plugins/guests/mint/guest.rb +0 -2
- data/plugins/guests/mint/plugin.rb +1 -1
- data/plugins/guests/netbsd/cap/configure_networks.rb +8 -8
- data/plugins/guests/nixos/cap/change_host_name.rb +11 -8
- data/plugins/guests/nixos/cap/configure_networks.rb +12 -9
- data/plugins/guests/omnios/cap/change_host_name.rb +17 -5
- data/plugins/guests/omnios/cap/mount_nfs_folder.rb +10 -4
- data/plugins/guests/omnios/cap/rsync.rb +11 -0
- data/plugins/guests/omnios/guest.rb +0 -2
- data/plugins/guests/omnios/plugin.rb +6 -1
- data/plugins/guests/openbsd/cap/configure_networks.rb +8 -6
- data/plugins/guests/photon/cap/change_host_name.rb +17 -4
- data/plugins/guests/photon/cap/configure_networks.rb +14 -26
- data/plugins/guests/photon/guest.rb +1 -1
- data/plugins/guests/photon/plugin.rb +12 -12
- data/plugins/guests/pld/cap/change_host_name.rb +21 -9
- data/plugins/guests/pld/guest.rb +0 -2
- data/plugins/guests/pld/plugin.rb +1 -1
- data/plugins/guests/redhat/cap/change_host_name.rb +30 -96
- data/plugins/guests/redhat/cap/configure_networks.rb +44 -50
- data/plugins/guests/redhat/cap/flavor.rb +3 -4
- data/plugins/guests/redhat/cap/nfs_client.rb +13 -25
- data/plugins/guests/redhat/cap/rsync.rb +6 -6
- data/plugins/guests/redhat/guest.rb +0 -2
- data/plugins/guests/redhat/plugin.rb +1 -10
- data/plugins/guests/slackware/cap/change_host_name.rb +19 -8
- data/plugins/guests/slackware/cap/configure_networks.rb +30 -14
- data/plugins/guests/slackware/guest.rb +0 -2
- data/plugins/guests/slackware/plugin.rb +1 -1
- data/plugins/guests/smartos/config.rb +3 -15
- data/plugins/guests/suse/cap/change_host_name.rb +15 -7
- data/plugins/guests/suse/cap/configure_networks.rb +31 -37
- data/plugins/guests/suse/cap/nfs_client.rb +5 -6
- data/plugins/guests/suse/cap/rsync.rb +1 -3
- data/plugins/guests/suse/guest.rb +0 -2
- data/plugins/guests/suse/plugin.rb +1 -1
- data/plugins/guests/tinycore/cap/mount_nfs.rb +46 -0
- data/plugins/guests/tinycore/plugin.rb +5 -0
- data/plugins/guests/trisquel/guest.rb +9 -0
- data/plugins/guests/trisquel/plugin.rb +15 -0
- data/plugins/guests/ubuntu/cap/change_host_name.rb +42 -41
- data/plugins/guests/ubuntu/guest.rb +0 -2
- data/plugins/guests/ubuntu/plugin.rb +1 -3
- data/plugins/guests/windows/guest_network.rb +1 -1
- data/plugins/hosts/arch/cap/nfs.rb +3 -19
- data/plugins/hosts/darwin/cap/provider_install_virtualbox.rb +4 -5
- data/plugins/hosts/darwin/cap/rdp.rb +34 -6
- data/plugins/hosts/gentoo/cap/nfs.rb +1 -1
- data/plugins/hosts/windows/cap/provider_install_virtualbox.rb +4 -5
- data/plugins/hosts/windows/cap/ps.rb +2 -2
- data/plugins/hosts/windows/cap/rdp.rb +8 -17
- data/plugins/kernel_v2/config/ssh_connect.rb +6 -0
- data/plugins/kernel_v2/config/vm.rb +3 -1
- data/plugins/providers/docker/action.rb +3 -3
- data/plugins/providers/docker/action/create.rb +1 -1
- data/plugins/providers/docker/command/exec.rb +104 -0
- data/plugins/providers/docker/config.rb +9 -1
- data/plugins/providers/docker/errors.rb +4 -0
- data/plugins/providers/docker/plugin.rb +6 -0
- data/plugins/providers/docker/provider.rb +1 -2
- data/plugins/providers/hyperv/action.rb +56 -1
- data/plugins/providers/hyperv/action/import.rb +13 -5
- data/plugins/providers/hyperv/action/snapshot_delete.rb +27 -0
- data/plugins/providers/hyperv/action/snapshot_restore.rb +23 -0
- data/plugins/providers/hyperv/action/snapshot_save.rb +27 -0
- data/plugins/providers/hyperv/cap/snapshot_list.rb +11 -0
- data/plugins/providers/hyperv/config.rb +5 -2
- data/plugins/providers/hyperv/driver.rb +18 -1
- data/plugins/providers/hyperv/plugin.rb +5 -0
- data/plugins/providers/hyperv/scripts/clone_vhd.ps1 +9 -0
- data/plugins/providers/hyperv/scripts/create_snapshot.ps1 +8 -0
- data/plugins/providers/hyperv/scripts/delete_snapshot.ps1 +8 -0
- data/plugins/providers/hyperv/scripts/get_vm_status.ps1 +8 -2
- data/plugins/providers/hyperv/scripts/import_vm.ps1 +5 -1
- data/plugins/providers/hyperv/scripts/list_snapshots.ps1 +12 -0
- data/plugins/providers/hyperv/scripts/restore_snapshot.ps1 +8 -0
- data/plugins/providers/virtualbox/action.rb +9 -4
- data/plugins/providers/virtualbox/action/import_master.rb +81 -75
- data/plugins/providers/virtualbox/action/package.rb +1 -29
- data/plugins/providers/virtualbox/action/package_setup_files.rb +51 -0
- data/plugins/providers/virtualbox/action/package_setup_folders.rb +38 -0
- data/plugins/providers/virtualbox/action/prepare_nfs_settings.rb +23 -1
- data/plugins/providers/virtualbox/action/setup_package_files.rb +9 -43
- data/plugins/providers/virtualbox/driver/version_4_1.rb +104 -6
- data/plugins/providers/virtualbox/driver/version_4_2.rb +6 -5
- data/plugins/providers/virtualbox/driver/version_4_3.rb +6 -5
- data/plugins/providers/virtualbox/driver/version_5_0.rb +6 -5
- data/plugins/provisioners/ansible/cap/guest/arch/ansible_install.rb +8 -3
- data/plugins/provisioners/ansible/cap/guest/debian/ansible_install.rb +26 -4
- data/plugins/provisioners/ansible/cap/guest/facts.rb +24 -0
- data/plugins/provisioners/ansible/cap/guest/fedora/ansible_install.rb +16 -6
- data/plugins/provisioners/ansible/cap/guest/freebsd/ansible_install.rb +7 -2
- data/plugins/provisioners/ansible/cap/guest/pip/pip.rb +28 -0
- data/plugins/provisioners/ansible/cap/guest/posix/ansible_installed.rb +1 -1
- data/plugins/provisioners/ansible/cap/guest/redhat/ansible_install.rb +24 -7
- data/plugins/provisioners/ansible/cap/guest/suse/ansible_install.rb +6 -2
- data/plugins/provisioners/ansible/cap/guest/ubuntu/ansible_install.rb +17 -6
- data/plugins/provisioners/ansible/config/base.rb +15 -23
- data/plugins/provisioners/ansible/config/guest.rb +9 -22
- data/plugins/provisioners/ansible/config/host.rb +9 -19
- data/plugins/provisioners/ansible/errors.rb +4 -0
- data/plugins/provisioners/ansible/helpers.rb +4 -24
- data/plugins/provisioners/ansible/provisioner/base.rb +58 -10
- data/plugins/provisioners/ansible/provisioner/guest.rb +55 -22
- data/plugins/provisioners/ansible/provisioner/host.rb +50 -9
- data/plugins/provisioners/chef/cap/linux/chef_installed.rb +2 -2
- data/plugins/provisioners/chef/cap/omnios/chef_installed.rb +3 -3
- data/plugins/provisioners/chef/cap/redhat/chef_install.rb +7 -11
- data/plugins/provisioners/chef/cap/suse/chef_install.rb +27 -0
- data/plugins/provisioners/chef/cap/windows/chef_installed.rb +1 -1
- data/plugins/provisioners/chef/command_builder.rb +1 -0
- data/plugins/provisioners/chef/config/base.rb +5 -6
- data/plugins/provisioners/chef/config/chef_solo.rb +6 -0
- data/plugins/provisioners/chef/installer.rb +2 -2
- data/plugins/provisioners/chef/omnibus.rb +1 -1
- data/plugins/provisioners/chef/plugin.rb +5 -0
- data/plugins/provisioners/chef/provisioner/base.rb +52 -56
- data/plugins/provisioners/chef/provisioner/chef_apply.rb +9 -10
- data/plugins/provisioners/chef/provisioner/chef_client.rb +1 -1
- data/plugins/provisioners/chef/provisioner/chef_solo.rb +1 -0
- data/plugins/provisioners/docker/client.rb +22 -4
- data/plugins/provisioners/puppet/provisioner/puppet.rb +3 -3
- data/plugins/provisioners/salt/provisioner.rb +19 -24
- data/plugins/pushes/ftp/adapter.rb +18 -1
- data/plugins/pushes/heroku/locales/en.yml +1 -1
- data/plugins/synced_folders/rsync/helper.rb +1 -1
- data/templates/commands/init/Vagrantfile.erb +6 -3
- data/templates/commands/init/Vagrantfile.min.erb +1 -1
- data/templates/commands/ssh_config/config.erb +5 -1
- data/templates/guests/debian/network_dhcp.erb +2 -2
- data/templates/guests/debian/network_static.erb +2 -2
- data/templates/guests/debian/network_static6.erb +2 -2
- data/templates/guests/fedora/network_static6.erb +9 -0
- data/templates/guests/freebsd/network_dhcp.erb +2 -1
- data/templates/guests/freebsd/network_static.erb +1 -1
- data/templates/guests/slackware/network_dhcp.erb +8 -20
- data/templates/guests/slackware/network_static.erb +10 -22
- data/templates/guests/suse/network_dhcp.erb +1 -1
- data/templates/guests/suse/network_static.erb +3 -3
- data/templates/locales/en.yml +35 -18
- data/templates/locales/providers_docker.yml +8 -0
- data/templates/provisioners/chef_solo/solo.erb +7 -7
- data/test/support/isolated_environment.rb +1 -1
- data/test/unit/base.rb +9 -1
- data/test/unit/plugins/commands/box/command/update_test.rb +7 -1
- data/test/unit/plugins/commands/init/command_test.rb +86 -0
- data/test/unit/plugins/commands/login/client_test.rb +7 -0
- data/test/unit/plugins/commands/ssh_config/command_test.rb +2 -14
- data/test/unit/plugins/communicators/winrm/shell_test.rb +40 -16
- data/test/unit/plugins/guests/amazon/cap/flavor_test.rb +19 -0
- data/test/unit/plugins/guests/arch/cap/change_host_name_test.rb +38 -0
- data/test/unit/plugins/guests/arch/cap/configure_networks_test.rb +55 -0
- data/test/unit/plugins/guests/atomic/cap/change_host_name_test.rb +38 -0
- data/test/unit/plugins/guests/atomic/cap/docker_test.rb +28 -0
- data/test/unit/plugins/guests/coreos/cap/change_host_name_test.rb +37 -0
- data/test/unit/plugins/guests/coreos/cap/configure_networks_test.rb +59 -0
- data/test/unit/plugins/guests/coreos/cap/docker_test.rb +28 -0
- data/test/unit/plugins/guests/darwin/cap/change_host_name_test.rb +40 -0
- data/test/unit/plugins/guests/darwin/cap/choose_addressable_ip_addr_test.rb +36 -0
- data/test/unit/plugins/guests/debian/cap/change_host_name_test.rb +23 -16
- data/test/unit/plugins/guests/debian/cap/configure_networks_test.rb +54 -0
- data/test/unit/plugins/guests/debian/cap/nfs_client_test.rb +30 -0
- data/test/unit/plugins/guests/debian/cap/rsync_test.rb +38 -0
- data/test/unit/plugins/guests/debian/cap/smb_test.rb +38 -0
- data/test/unit/plugins/guests/freebsd/cap/change_host_name_test.rb +40 -0
- data/test/unit/plugins/guests/freebsd/cap/configure_networks_test.rb +51 -0
- data/test/unit/plugins/guests/freebsd/cap/halt_test.rb +35 -0
- data/test/unit/plugins/guests/freebsd/cap/insert_public_key_test.rb +31 -0
- data/test/unit/plugins/guests/freebsd/cap/mount_nfs_folder_test.rb +53 -0
- data/test/unit/plugins/guests/freebsd/cap/rsync_test.rb +46 -0
- data/test/unit/plugins/guests/linux/cap/choose_addressable_ip_addr_test.rb +38 -0
- data/test/unit/plugins/guests/linux/cap/halt_test.rb +36 -0
- data/test/unit/plugins/guests/linux/cap/insert_public_key_test.rb +32 -0
- data/test/unit/plugins/guests/linux/cap/mount_nfs_test.rb +78 -0
- data/test/unit/plugins/guests/linux/cap/mount_shared_folder_test.rb +1 -1
- data/test/unit/plugins/guests/linux/cap/nfs_client_test.rb +29 -0
- data/test/unit/plugins/guests/linux/cap/port_test.rb +30 -0
- data/test/unit/plugins/guests/omnios/cap/change_host_name_test.rb +41 -0
- data/test/unit/plugins/guests/omnios/cap/mount_nfs_folder_test.rb +47 -0
- data/test/unit/plugins/guests/omnios/cap/rsync_test.rb +29 -0
- data/test/unit/plugins/guests/photon/cap/change_host_name_test.rb +26 -18
- data/test/unit/plugins/guests/photon/cap/configure_networks_test.rb +37 -26
- data/test/unit/plugins/guests/photon/cap/docker_test.rb +17 -12
- data/test/unit/plugins/guests/pld/cap/change_host_name_test.rb +39 -0
- data/test/unit/plugins/guests/pld/cap/flavor_test.rb +21 -0
- data/test/unit/plugins/guests/pld/cap/network_scripts_dir_test.rb +21 -0
- data/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb +23 -51
- data/test/unit/plugins/guests/redhat/cap/configure_networks_test.rb +80 -0
- data/test/unit/plugins/guests/redhat/cap/flavor_test.rb +40 -0
- data/test/unit/plugins/guests/redhat/cap/network_scripts_dir_test.rb +21 -0
- data/test/unit/plugins/guests/redhat/cap/nfs_client_test.rb +30 -0
- data/test/unit/plugins/guests/redhat/cap/rsync_test.rb +29 -0
- data/test/unit/plugins/guests/slackware/cap/change_host_name_test.rb +40 -0
- data/test/unit/plugins/guests/slackware/cap/configure_networks_test.rb +48 -0
- data/test/unit/plugins/guests/smartos/cap/change_host_name_test.rb +2 -2
- data/test/unit/plugins/guests/smartos/cap/configure_networks_test.rb +1 -1
- data/test/unit/plugins/guests/smartos/cap/halt_test.rb +1 -1
- data/test/unit/plugins/guests/smartos/cap/mount_nfs_test.rb +1 -1
- data/test/unit/plugins/guests/smartos/cap/rsync_test.rb +1 -1
- data/test/unit/plugins/guests/suse/cap/change_host_name_test.rb +40 -0
- data/test/unit/plugins/guests/suse/cap/configure_networks_test.rb +60 -0
- data/test/unit/plugins/guests/suse/cap/halt_test.rb +36 -0
- data/test/unit/plugins/guests/suse/cap/network_scripts_dir_test.rb +19 -0
- data/test/unit/plugins/guests/suse/cap/nfs_client_test.rb +31 -0
- data/test/unit/plugins/guests/suse/cap/rsync_test.rb +38 -0
- data/test/unit/plugins/guests/tinycore/cap/change_host_name_test.rb +1 -1
- data/test/unit/plugins/guests/ubuntu/cap/change_host_name_test.rb +24 -16
- data/test/unit/plugins/guests/windows/cap/change_host_name_test.rb +1 -1
- data/test/unit/plugins/guests/windows/cap/halt_test.rb +1 -1
- data/test/unit/plugins/guests/windows/cap/mount_shared_folder_test.rb +1 -1
- data/test/unit/plugins/guests/windows/cap/reboot_test.rb +1 -1
- data/test/unit/plugins/guests/windows/cap/rsync_test.rb +1 -1
- data/test/unit/plugins/hosts/darwin/cap/rdp_test.rb +36 -0
- data/test/unit/plugins/kernel_v2/config/vm_test.rb +27 -1
- data/test/unit/plugins/providers/docker/action/create_test.rb +55 -0
- data/test/unit/plugins/providers/docker/command/exec_test.rb +44 -0
- data/test/unit/plugins/providers/docker/config_test.rb +7 -2
- data/test/unit/plugins/providers/virtualbox/action/prepare_nfs_settings_test.rb +18 -0
- data/test/unit/plugins/provisioners/ansible/config/guest_test.rb +83 -0
- data/test/unit/plugins/provisioners/ansible/config/host_test.rb +98 -0
- data/test/unit/plugins/provisioners/ansible/config/shared.rb +107 -0
- data/test/unit/plugins/provisioners/ansible/provisioner_test.rb +82 -10
- data/test/unit/plugins/provisioners/chef/config/base_test.rb +2 -2
- data/test/unit/plugins/provisioners/chef/provisioner/base_test.rb +29 -0
- data/test/unit/plugins/pushes/atlas/push_test.rb +12 -8
- data/test/unit/plugins/pushes/ftp/adapter_test.rb +1 -1
- data/test/unit/plugins/pushes/ftp/push_test.rb +5 -4
- data/test/unit/support/isolated_environment.rb +4 -4
- data/test/unit/support/shared/base_context.rb +11 -3
- data/test/unit/templates/guests/arch/network_dhcp_test.rb +2 -2
- data/test/unit/templates/guests/arch/network_static_test.rb +4 -4
- data/test/unit/templates/guests/debian/network_dhcp_test.rb +6 -6
- data/test/unit/templates/guests/debian/network_static_test.rb +6 -6
- data/test/unit/templates/guests/fedora/network_static6_test.rb +25 -0
- data/test/unit/templates/guests/freebsd/network_dhcp_test.rb +5 -2
- data/test/unit/templates/guests/freebsd/network_static_test.rb +13 -17
- data/test/unit/templates/guests/suse/network_dhcp_test.rb +2 -2
- data/test/unit/templates/guests/suse/network_static_test.rb +4 -4
- data/test/unit/vagrant/action/builtin/box_add_test.rb +33 -31
- data/test/unit/vagrant/action/builtin/lock_test.rb +5 -2
- data/test/unit/vagrant/action/builtin/mixin_synced_folders_test.rb +6 -2
- data/test/unit/vagrant/action/builtin/synced_folder_cleanup_test.rb +5 -1
- data/test/unit/vagrant/action/builtin/synced_folders_test.rb +5 -1
- data/test/unit/vagrant/box_collection_test.rb +19 -7
- data/test/unit/vagrant/box_test.rb +13 -2
- data/test/unit/vagrant/config_test.rb +1 -1
- data/test/unit/vagrant/environment_test.rb +16 -12
- data/test/unit/vagrant/machine_index_test.rb +5 -1
- data/test/unit/vagrant/machine_test.rb +5 -1
- data/test/unit/vagrant/plugin/manager_test.rb +1 -5
- data/test/unit/vagrant/plugin/state_file_test.rb +1 -5
- data/test/unit/vagrant/util/platform_test.rb +5 -0
- data/test/unit/vagrant/util/safe_chdir_test.rb +11 -5
- data/test/unit/vagrant/vagrantfile_test.rb +5 -1
- data/vagrant.gemspec +8 -3
- data/version.txt +1 -1
- metadata +3657 -12
- data/CONTRIBUTING.md +0 -41
- data/test/unit/plugins/guests/support/shared/debian_like_host_name_examples.rb +0 -106
- data/test/unit/plugins/guests/support/shared/redhat_like_host_name_examples.rb +0 -252
- data/test/unit/plugins/provisioners/ansible/config_test.rb +0 -224
@@ -0,0 +1,60 @@
|
|
1
|
+
require_relative "../../../../base"
|
2
|
+
|
3
|
+
describe "VagrantPlugins::GuestSUSE::Cap::ConfigureNetworks" do
|
4
|
+
let(:caps) do
|
5
|
+
VagrantPlugins::GuestSUSE::Plugin
|
6
|
+
.components
|
7
|
+
.guest_capabilities[:suse]
|
8
|
+
end
|
9
|
+
|
10
|
+
let(:machine) { double("machine") }
|
11
|
+
let(:comm) { VagrantTests::DummyCommunicator::Communicator.new(machine) }
|
12
|
+
|
13
|
+
before do
|
14
|
+
allow(machine).to receive(:communicate).and_return(comm)
|
15
|
+
comm.stub_command("ip -o -0 addr | grep -v LOOPBACK | awk '{print $2}' | sed 's/://'",
|
16
|
+
stdout: "eth1\neth2")
|
17
|
+
end
|
18
|
+
|
19
|
+
after do
|
20
|
+
comm.verify_expectations!
|
21
|
+
end
|
22
|
+
|
23
|
+
describe ".configure_networks" do
|
24
|
+
let(:cap) { caps.get(:configure_networks) }
|
25
|
+
|
26
|
+
let(:network_1) do
|
27
|
+
{
|
28
|
+
interface: 0,
|
29
|
+
type: "dhcp",
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
let(:network_2) do
|
34
|
+
{
|
35
|
+
interface: 1,
|
36
|
+
type: "static",
|
37
|
+
ip: "33.33.33.10",
|
38
|
+
netmask: "255.255.0.0",
|
39
|
+
gateway: "33.33.0.1",
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
let(:guest) { double("guest") }
|
44
|
+
|
45
|
+
before do
|
46
|
+
allow(machine).to receive(:guest).and_return(guest)
|
47
|
+
allow(guest).to receive(:capability)
|
48
|
+
.with(:network_scripts_dir)
|
49
|
+
.and_return("/scripts")
|
50
|
+
end
|
51
|
+
|
52
|
+
it "creates and starts the networks" do
|
53
|
+
cap.configure_networks(machine, [network_1, network_2])
|
54
|
+
expect(comm.received_commands[1]).to match(/\/sbin\/ifdown 'eth1'/)
|
55
|
+
expect(comm.received_commands[1]).to match(/\/sbin\/ifup 'eth1'/)
|
56
|
+
expect(comm.received_commands[1]).to match(/\/sbin\/ifdown 'eth2'/)
|
57
|
+
expect(comm.received_commands[1]).to match(/\/sbin\/ifup 'eth2'/)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require_relative "../../../../base"
|
2
|
+
|
3
|
+
describe "VagrantPlugins::GuestSUSE::Cap::Halt" do
|
4
|
+
let(:caps) do
|
5
|
+
VagrantPlugins::GuestSUSE::Plugin
|
6
|
+
.components
|
7
|
+
.guest_capabilities[:suse]
|
8
|
+
end
|
9
|
+
|
10
|
+
let(:machine) { double("machine") }
|
11
|
+
let(:comm) { VagrantTests::DummyCommunicator::Communicator.new(machine) }
|
12
|
+
|
13
|
+
before do
|
14
|
+
allow(machine).to receive(:communicate).and_return(comm)
|
15
|
+
end
|
16
|
+
|
17
|
+
after do
|
18
|
+
comm.verify_expectations!
|
19
|
+
end
|
20
|
+
|
21
|
+
describe ".halt" do
|
22
|
+
let(:cap) { caps.get(:halt) }
|
23
|
+
|
24
|
+
it "runs the shutdown command" do
|
25
|
+
comm.expect_command("/sbin/shutdown -h now")
|
26
|
+
cap.halt(machine)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "does not raise an IOError" do
|
30
|
+
comm.stub_command("shutdown -h now", raise: IOError)
|
31
|
+
expect {
|
32
|
+
cap.halt(machine)
|
33
|
+
}.to_not raise_error
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require_relative "../../../../base"
|
2
|
+
|
3
|
+
describe "VagrantPlugins::GuestSUSE::Cap::NetworkScriptsDir" do
|
4
|
+
let(:caps) do
|
5
|
+
VagrantPlugins::GuestSUSE::Plugin
|
6
|
+
.components
|
7
|
+
.guest_capabilities[:suse]
|
8
|
+
end
|
9
|
+
|
10
|
+
let(:machine) { double("machine") }
|
11
|
+
|
12
|
+
describe ".network_scripts_dir" do
|
13
|
+
let(:cap) { caps.get(:network_scripts_dir) }
|
14
|
+
|
15
|
+
it "runs /etc/sysconfig/network" do
|
16
|
+
expect(cap.network_scripts_dir(machine)).to eq("/etc/sysconfig/network")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require_relative "../../../../base"
|
2
|
+
|
3
|
+
describe "VagrantPlugins::GuestSUSE::Cap::NFSClient" do
|
4
|
+
let(:caps) do
|
5
|
+
VagrantPlugins::GuestSUSE::Plugin
|
6
|
+
.components
|
7
|
+
.guest_capabilities[:suse]
|
8
|
+
end
|
9
|
+
|
10
|
+
let(:machine) { double("machine") }
|
11
|
+
let(:comm) { VagrantTests::DummyCommunicator::Communicator.new(machine) }
|
12
|
+
|
13
|
+
before do
|
14
|
+
allow(machine).to receive(:communicate).and_return(comm)
|
15
|
+
end
|
16
|
+
|
17
|
+
after do
|
18
|
+
comm.verify_expectations!
|
19
|
+
end
|
20
|
+
|
21
|
+
describe ".nfs_client_install" do
|
22
|
+
let(:cap) { caps.get(:nfs_client_install) }
|
23
|
+
|
24
|
+
it "installs nfs client utilities" do
|
25
|
+
cap.nfs_client_install(machine)
|
26
|
+
expect(comm.received_commands[0]).to match(/zypper -n install nfs-client/)
|
27
|
+
expect(comm.received_commands[0]).to match(/service rpcbind restart/)
|
28
|
+
expect(comm.received_commands[0]).to match(/service nfs restart/)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require_relative "../../../../base"
|
2
|
+
|
3
|
+
describe "VagrantPlugins::GuestSUSE::Cap::RSync" do
|
4
|
+
let(:caps) do
|
5
|
+
VagrantPlugins::GuestSUSE::Plugin
|
6
|
+
.components
|
7
|
+
.guest_capabilities[:suse]
|
8
|
+
end
|
9
|
+
|
10
|
+
let(:machine) { double("machine") }
|
11
|
+
let(:comm) { VagrantTests::DummyCommunicator::Communicator.new(machine) }
|
12
|
+
|
13
|
+
before do
|
14
|
+
allow(machine).to receive(:communicate).and_return(comm)
|
15
|
+
end
|
16
|
+
|
17
|
+
after do
|
18
|
+
comm.verify_expectations!
|
19
|
+
end
|
20
|
+
|
21
|
+
describe ".rsync_install" do
|
22
|
+
let(:cap) { caps.get(:rsync_install) }
|
23
|
+
|
24
|
+
it "installs rsync" do
|
25
|
+
comm.expect_command("zypper -n install rsync")
|
26
|
+
cap.rsync_install(machine)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe ".rsync_installed" do
|
31
|
+
let(:cap) { caps.get(:rsync_installed) }
|
32
|
+
|
33
|
+
it "checks if rsync is installed" do
|
34
|
+
comm.expect_command("test -f /usr/bin/rsync")
|
35
|
+
cap.rsync_installed(machine)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -1,34 +1,42 @@
|
|
1
|
-
|
2
|
-
require File.expand_path("../../../support/shared/debian_like_host_name_examples", __FILE__)
|
1
|
+
require_relative "../../../../base"
|
3
2
|
|
4
3
|
describe "VagrantPlugins::GuestUbuntu::Cap::ChangeHostName" do
|
5
|
-
let(:
|
6
|
-
VagrantPlugins::GuestUbuntu::Plugin
|
4
|
+
let(:caps) do
|
5
|
+
VagrantPlugins::GuestUbuntu::Plugin
|
6
|
+
.components
|
7
|
+
.guest_capabilities[:ubuntu]
|
7
8
|
end
|
9
|
+
|
8
10
|
let(:machine) { double("machine") }
|
9
|
-
let(:
|
10
|
-
let(:old_hostname) {'oldhostname.olddomain.tld' }
|
11
|
+
let(:comm) { VagrantTests::DummyCommunicator::Communicator.new(machine) }
|
11
12
|
|
12
13
|
before do
|
13
|
-
allow(machine).to receive(:communicate).and_return(
|
14
|
-
communicator.stub_command('hostname -f', stdout: old_hostname)
|
14
|
+
allow(machine).to receive(:communicate).and_return(comm)
|
15
15
|
end
|
16
16
|
|
17
17
|
after do
|
18
|
-
|
18
|
+
comm.verify_expectations!
|
19
19
|
end
|
20
20
|
|
21
21
|
describe ".change_host_name" do
|
22
|
-
|
22
|
+
let(:cap) { caps.get(:change_host_name) }
|
23
|
+
|
24
|
+
let(:name) { 'banana-rama.example.com' }
|
23
25
|
|
24
|
-
it "
|
25
|
-
|
26
|
-
|
26
|
+
it "sets the hostname if not set" do
|
27
|
+
comm.stub_command("hostname -f | grep -w '#{name}'", exit_code: 1)
|
28
|
+
cap.change_host_name(machine, name)
|
29
|
+
expect(comm.received_commands[1]).to match(/hostname -F \/etc\/hostname/)
|
30
|
+
expect(comm.received_commands[1]).to match(/\/etc\/init.d\/hostname.sh start/)
|
31
|
+
expect(comm.received_commands[1]).to match(/\/etc\/init.d\/hostname start/)
|
32
|
+
expect(comm.received_commands[1]).to match(/\/etc\/init.d\/networking force-reload/)
|
33
|
+
expect(comm.received_commands[1]).to match(/\/etc\/init.d\/network-manager force-reload/)
|
27
34
|
end
|
28
35
|
|
29
|
-
it "
|
30
|
-
|
31
|
-
|
36
|
+
it "does not set the hostname if unset" do
|
37
|
+
comm.stub_command("hostname -f | grep -w '#{name}'", exit_code: 0)
|
38
|
+
cap.change_host_name(machine, name)
|
39
|
+
expect(comm.received_commands.size).to eq(1)
|
32
40
|
end
|
33
41
|
end
|
34
42
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require_relative "../../../../base"
|
2
|
+
|
3
|
+
require_relative "../../../../../../plugins/hosts/darwin/cap/rdp"
|
4
|
+
|
5
|
+
describe VagrantPlugins::HostDarwin::Cap::RDP do
|
6
|
+
let(:rdp_info) do
|
7
|
+
{
|
8
|
+
host: "host",
|
9
|
+
port: "port",
|
10
|
+
username: "username",
|
11
|
+
}
|
12
|
+
end
|
13
|
+
|
14
|
+
it "includes the default options" do
|
15
|
+
path = described_class.generate_config_file(rdp_info)
|
16
|
+
result = File.read(path)
|
17
|
+
expect(result).to match("drivestoredirect:s:*")
|
18
|
+
expect(result).to match("full address:s:host:port")
|
19
|
+
expect(result).to match("prompt for credentials:i:1")
|
20
|
+
expect(result).to match("username:s:username")
|
21
|
+
end
|
22
|
+
|
23
|
+
it "includes extra RDP arguments" do
|
24
|
+
rdp_info.merge!(extra_args: ["screen mode id:i:0"])
|
25
|
+
path = described_class.generate_config_file(rdp_info)
|
26
|
+
result = File.read(path)
|
27
|
+
expect(result).to match("screen mode id:i:0")
|
28
|
+
end
|
29
|
+
|
30
|
+
it "opens the RDP file" do
|
31
|
+
env = double(:env)
|
32
|
+
allow(described_class).to receive(:generate_config_file).and_return("/path")
|
33
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with("open", "/path")
|
34
|
+
described_class.rdp_client(env, rdp_info)
|
35
|
+
end
|
36
|
+
end
|
@@ -173,7 +173,7 @@ describe VagrantPlugins::Kernel_V2::VMConfig do
|
|
173
173
|
subject.communicator = "winrm"
|
174
174
|
subject.finalize!
|
175
175
|
n = subject.networks
|
176
|
-
expect(n.length).to eq(
|
176
|
+
expect(n.length).to eq(3)
|
177
177
|
|
178
178
|
expect(n[0][0]).to eq(:forwarded_port)
|
179
179
|
expect(n[0][1][:guest]).to eq(5985)
|
@@ -188,6 +188,32 @@ describe VagrantPlugins::Kernel_V2::VMConfig do
|
|
188
188
|
expect(n[1][1][:id]).to eq("winrm-ssl")
|
189
189
|
end
|
190
190
|
|
191
|
+
it "forwards ssh even if the communicator is winrm" do
|
192
|
+
subject.communicator = "winrm"
|
193
|
+
subject.finalize!
|
194
|
+
n = subject.networks
|
195
|
+
expect(n.length).to eq(3)
|
196
|
+
|
197
|
+
expect(n[0][0]).to eq(:forwarded_port)
|
198
|
+
expect(n[0][1][:guest]).to eq(5985)
|
199
|
+
expect(n[0][1][:host]).to eq(55985)
|
200
|
+
expect(n[0][1][:host_ip]).to eq("127.0.0.1")
|
201
|
+
expect(n[0][1][:id]).to eq("winrm")
|
202
|
+
|
203
|
+
expect(n[1][0]).to eq(:forwarded_port)
|
204
|
+
expect(n[1][1][:guest]).to eq(5986)
|
205
|
+
expect(n[1][1][:host]).to eq(55986)
|
206
|
+
expect(n[1][1][:host_ip]).to eq("127.0.0.1")
|
207
|
+
expect(n[1][1][:id]).to eq("winrm-ssl")
|
208
|
+
|
209
|
+
expect(n[2][0]).to eq(:forwarded_port)
|
210
|
+
expect(n[2][1][:guest]).to eq(22)
|
211
|
+
expect(n[2][1][:host]).to eq(2222)
|
212
|
+
expect(n[2][1][:host_ip]).to eq("127.0.0.1")
|
213
|
+
expect(n[2][1][:id]).to eq("ssh")
|
214
|
+
|
215
|
+
end
|
216
|
+
|
191
217
|
it "allows overriding SSH" do
|
192
218
|
subject.network "forwarded_port",
|
193
219
|
guest: 22, host: 14100, id: "ssh"
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require_relative "../../../../base"
|
2
|
+
require_relative "../../../../../../plugins/providers/docker/action/create"
|
3
|
+
|
4
|
+
describe VagrantPlugins::DockerProvider::Action::Create do
|
5
|
+
include_context "unit"
|
6
|
+
include_context "virtualbox"
|
7
|
+
|
8
|
+
let(:sandbox) { isolated_environment }
|
9
|
+
|
10
|
+
let(:iso_env) do
|
11
|
+
# We have to create a Vagrantfile so there is a root path
|
12
|
+
sandbox.vagrantfile("")
|
13
|
+
sandbox.create_vagrant_env
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:machine) do
|
17
|
+
iso_env.machine(iso_env.machine_names[0], :virtualbox).tap do |m|
|
18
|
+
m.provider.stub(driver: driver)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
let(:env) {{ machine: machine, ui: machine.ui, root_path: Pathname.new(".") }}
|
23
|
+
let(:app) { lambda { |*args| }}
|
24
|
+
let(:driver) { double("driver", create: "abcd1234") }
|
25
|
+
|
26
|
+
subject { described_class.new(app, env) }
|
27
|
+
|
28
|
+
after do
|
29
|
+
sandbox.close
|
30
|
+
end
|
31
|
+
|
32
|
+
describe "#call" do
|
33
|
+
it "calls the next action in the chain" do
|
34
|
+
called = false
|
35
|
+
app = ->(*args) { called = true }
|
36
|
+
|
37
|
+
action = described_class.new(app, env)
|
38
|
+
action.call(env)
|
39
|
+
|
40
|
+
expect(called).to eq(true)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
describe "#forwarded_ports" do
|
45
|
+
it "does not clobber ports with different protocols" do
|
46
|
+
subject.instance_variable_set(:@machine, machine)
|
47
|
+
machine.config.vm.network "forwarded_port", guest: 8125, host: 8125, protocol: "tcp"
|
48
|
+
machine.config.vm.network "forwarded_port", guest: 8125, host: 8125, protocol: "udp"
|
49
|
+
|
50
|
+
result = subject.forwarded_ports(false)
|
51
|
+
|
52
|
+
expect(result).to eq(["8125:8125", "8125:8125/udp"])
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require_relative "../../../../base"
|
2
|
+
require_relative "../../../../../../plugins/providers/docker/command/exec"
|
3
|
+
|
4
|
+
describe VagrantPlugins::DockerProvider::Command::Exec do
|
5
|
+
include_context "unit"
|
6
|
+
include_context "command plugin helpers"
|
7
|
+
|
8
|
+
let(:sandbox) do
|
9
|
+
isolated_environment
|
10
|
+
end
|
11
|
+
|
12
|
+
let(:argv) { [] }
|
13
|
+
let(:env) { sandbox.create_vagrant_env }
|
14
|
+
|
15
|
+
let(:vagrantfile_path) { File.join(env.cwd, "Vagrantfile") }
|
16
|
+
|
17
|
+
subject { described_class.new(argv, env) }
|
18
|
+
|
19
|
+
before(:all) do
|
20
|
+
I18n.load_path << Vagrant.source_root.join("templates/locales/providers_docker.yml")
|
21
|
+
I18n.reload!
|
22
|
+
end
|
23
|
+
|
24
|
+
before do
|
25
|
+
Vagrant.plugin("2").manager.stub(commands: {})
|
26
|
+
allow(subject).to receive(:exec_command)
|
27
|
+
end
|
28
|
+
|
29
|
+
after do
|
30
|
+
sandbox.close
|
31
|
+
end
|
32
|
+
|
33
|
+
describe "#execute" do
|
34
|
+
describe "without a command" do
|
35
|
+
let(:argv) { [] }
|
36
|
+
|
37
|
+
it "raises an error" do
|
38
|
+
expect {
|
39
|
+
subject.execute
|
40
|
+
}.to raise_error(VagrantPlugins::DockerProvider::Errors::ExecCommandRequired)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|