3070 Commits

Author SHA1 Message Date
Brian Cain
dafb60ad4f
Update experimental feature flag for disk 2020-02-12 15:38:34 -08:00
Brian Cain
c179b2fb22
Include updated unit tests for disk ext update 2020-02-12 13:51:59 -08:00
Brian Cain
efde9595c4
Add error case handling for resizing vmdk disks 2020-02-12 09:32:38 -08:00
Brian Cain
1826d210a0
Recover from cloning and resizin disk failures
This commit adds some recovery if Vagrant fails to reattach or clone a
vmdk disk that needs to be resized. It first moves the original disk
(after cloning) to a backup file. If something fails, it will reattach
the original disk to the guest and continue to raise the exception.
2020-02-11 16:02:24 -08:00
Brian Cain
3662344d2e
Update rspec tests for driver methods 2020-02-10 15:31:10 -08:00
Brian Cain
b11aa53294
Remove unused experimental flag for disk enablement 2020-02-10 13:03:58 -08:00
Brian Cain
b594715ded
Add tests for resizing disks 2020-02-10 12:58:11 -08:00
Brian Cain
0ea26b9506
Add test for comparing disk size 2020-02-10 12:58:11 -08:00
Brian Cain
d1d27a3b56
Add tests for handle_configure_disk 2020-02-10 12:58:11 -08:00
Brian Cain
6872625609
Add more tests for configure_disks virtualbox cap 2020-02-10 12:58:11 -08:00
Brian Cain
337f7dd616
Add cleanup_disks tests 2020-02-10 12:58:11 -08:00
Brian Cain
9150d3db7b
Always cleanup disks even if no disks in Vagrantfile 2020-02-10 12:58:11 -08:00
Brian Cain
eff3d47f82
Add cleanup_disks test 2020-02-10 12:58:11 -08:00
Brian Cain
9ca535dbfa
Add test for writing disk_meta file 2020-02-10 12:58:11 -08:00
Brian Cain
718332b35e
Fixup disk tests 2020-02-10 12:58:11 -08:00
Brian Cain
55cb8d1f0a
Add configure_disk blank unit test file and some method docs 2020-02-10 12:58:11 -08:00
Brian Cain
00b47a285e
Ensure decimal points are respected for numeric conversions 2020-02-10 12:58:11 -08:00
Brian Cain
65864f86da
Boost guest memory
With 2GB of ram, certain tests were timing out and not able to complete.
This commit bumps up that base setting to 5GB to be safe.
2020-02-07 16:15:28 -08:00
Brian Cain
0f1f559c5d
Update vagrant-spec readme 2020-02-07 15:36:15 -08:00
Brian Cain
8dc45976d6
Document VAGRANT_SPEC_ARGS option for running tests 2020-02-07 13:29:36 -08:00
Brian Cain
ef2075c9b2
Ensure nfs kernel server is on ubuntu hosts 2020-02-06 14:46:11 -08:00
Brian Cain
9aaea362c6
Introduce platform mapping for other kinds of vagrant boxes 2020-02-05 16:55:13 -08:00
Brian Cain
4cfaa9809b
Update readme with more info on how to run spec tests 2020-02-05 16:54:59 -08:00
Brian Cain
ee8b38d47a
Set provisioner names to symbol
Because Vagrant is handling provisioner names to be symbols more
uniformly now, update the mocked tests to reflect this change. Otherwise
these provisioners will be ignored and not run.
2020-01-06 13:25:31 -08:00
Brian Cain
b4c302a74c
Set shell provisioner name in provision_test 2020-01-06 12:48:33 -08:00
Brian Cain
711270b90a
Fixes #11287: Set top level provisioner name if set in provisioner
config

Prior to this commit, if a user had configured a provisioner that had a
config with a `name` option, it would not properly set the top level
provisioner classes name config option which would lead to some
understanibly confusing results when trying to `--provision-with`. This
commit fixes that by checking to see if the top level name isn't set,
look to see if that provisioners config defines a name, and use that
instead.
2020-01-06 11:10:28 -08:00
Jeff Bonhag
7fb7dd8608
Enable WinSSH shell for vagrant ssh -c (#11258)
This commit changes the behavior of the builtin SSHRun action to use a Windows
shell if the WinSSH communicator is active.  This allows for running one-off SSH
commands with Windows Command Prompt or PowerShell.  By default, this will not
allocate a TTY for any SSH commands.

Example usage:

```
vagrant ssh -c 'dir "c:\program files"'
```

Updates docs to reflect a change made in
a55a53e6a46438d5093487f83248f01ddece4534.
2019-12-20 13:10:11 -05:00
Jeff Bonhag
ade076cabb
Fixes #11236: Windows port detection (#11244)
This reverts commit 81553263ab812a7fd0a2ab0f627bee139ad6397c.

This fixes a regression with Windows port detection which led to port
collisions not being fixed on `vagrant up`.

PR #8517 changed `IsPortOpen#is_port_open?` to rescue
Errno::EADDRNOTAVAIL, but when we merged it into master, there was code
in `HandleForwardedPortCollisions#port_check` that depended on that
error bubbling up.
2019-12-19 14:46:13 -05:00
Chris Roberts
25659a6f6b Support properly setting up synced folders on Catalina
Since the root file system is marked as read-only, attempting to
link the shared directory to `/vagrant` will fail. If the guest
path is on the root file system and APFS is used, create the
link as a firmlink instead.
2019-12-18 13:11:30 -08:00
Chris Roberts
80c05460ab Call hooks before and after each action if they are available 2019-12-18 13:11:30 -08:00
Brian Cain
4e58dfed2b
Merge pull request #11265 from briancain/LOCAL-ANSIBLE-BUG-PLUS-RSPEC
Fixup: ansible_local: Add `cap` bug fixes and related RSpec coverage
2019-12-18 08:20:59 -08:00
Brian Cain
61ee42976b
Merge pull request #11262 from briancain/return-if-no-disk-config
Return if no disk config
2019-12-17 13:55:08 -08:00
Brian Cain
7d667c9dea
Update ansible install tests 2019-12-17 13:34:52 -08:00
Brian Cain
0c0352201d
Update ansible_install_test.rb
Remove extra whitespace
2019-12-17 12:51:39 -08:00
Gilles Cornu
bcdda99dfa
ansible_local: Fix pip setup on Arch Linux guest
Add 'python' package requirement. Tested against `archlinux/archlinux`
box, at version "2019.11.24".
2019-12-17 12:51:39 -08:00
Gilles Cornu
069122f42c
[minor] Align Ruby formatting across ansible_local files
GH-11148: Remove unwanted formatting changes proposed in 920361150f9b91fa1b544d024432c300471f20f3.
2019-12-17 12:51:39 -08:00
Gilles Cornu
a2b87eace4
Fix broken 'ansible_install' methods signature
- By the way: Trim the generate 'pip install' command in Ansible::Cap::Guest::Pip::pip_install
- GH-11048: Fix same regression for FreeBSD and SuSE guests.
- GH-6633:  Add RSpec examples to cover ansible_local 'cap' code.

Note: RedHat/Fedora guests are not covered yet by unit tests.
2019-12-17 12:51:39 -08:00
Gilles Cornu
113a0a7aaa
[minor] Use the correct "pip_install_cmd" name
There is no such thing like 'pip_install_command' option in the
Ansible Local provision, so let's avoid any misunderstanding ;-)
2019-12-17 12:51:39 -08:00
Brian Cain
9f2261a6fc
Add test for builtin disk action 2019-12-17 10:56:48 -08:00
Jeff Bonhag
d7a5f74897
Fixes #11128: Error if machine folder inaccessible (#11239)
This commit catches the Errno::EPERM raised by the operating system if
the machine folder is inaccessible and displays it as a more friendly
error message.

This can be an issue on macOS Catalina if virtual machine files are kept
in a special directory (Documents/Downloads/Desktop) that Vagrant's
embedded Ruby is not allowed to access.
2019-12-17 12:41:12 -05:00
Jeff Bonhag
2fa44f5b8f
Fixes #11218: Update apk cache when installing rsync (#11220)
This ensures that rsync can be installed on an Alpine Linux machine where the
apk cache may not be current.

Display a warning if the vagrant-alpine plugin is installed, since Alpine guest
support has been merged into Vagrant core.
2019-12-17 12:34:53 -05:00
Brian Cain
bcf4d5a210
Fixes #11228: Allow to force check for box updates
Prior to this commit, if a user had recently checked for updates, there
was no way to force Vagrant to re-check without manually deleting a
state file in the local `.vagrant` data dir. This commit fixes that by
giving users the ability to force check for updates for a given box with
a flag to the `vagrant box outdated` command.
2019-12-03 11:42:55 -08:00
Jeff Bonhag
c6ee1049aa
Darwin: put each NFS export on its own line (#11216)
This commit introduces a Darwin-specific template for NFS exports.  This is almost identical to the standard BSD template except it puts each NFS export on its own line.

This resolves NFS issues discovered in macOS Catalina.
2019-11-25 15:41:05 -05:00
Brian Cain
f55aca091c
Wrap disk feature in experimental flag 2019-11-22 14:40:23 -08:00
Brian Cain
734aad1ede
Enforce unique names for disk config objects 2019-11-22 14:40:23 -08:00
Brian Cain
cd98a8bf64
Include unit test for numeric class 2019-11-22 14:40:23 -08:00
Brian Cain
a457dee8b0
Set default disk to non-primary 2019-11-22 14:40:23 -08:00
Brian Cain
f01c90e676
Rename rspec test name 2019-11-22 14:40:23 -08:00
Brian Cain
87366cf4f3
Add basic disk config unit tests 2019-11-22 14:40:23 -08:00
Brian Cain
93828508ec
Update config/vm with tests for disk config 2019-11-22 14:40:23 -08:00