Commit Graph

3024 Commits

Author SHA1 Message Date
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
Brian Cain e100d9cd48
Merge pull request #11205 from briancain/DOCKER-BUILDKIT-FIXUP
Enhance docker build method for the Docker provider to include buildkit output
2019-11-22 14:21:59 -08:00
Brian Cain 6831129720
Merge pull request #11211 from briancain/fixup/ensure-checksum-and-type-are-not-empty
Fixes #11207: Do not validate checksums if options are empty string
2019-11-22 10:17:10 -08:00
Brian Cain 2a2e2d5414
Update nfs client test for redhat 2019-11-21 13:44:35 -08:00
Brian Cain efd3a62ffe
Fixes #11207: Do not validate checksums if options are empty string
Prior to this commit, if Vagrant received checksum options from Vagrant
Cloud that were simply empty strings, it would try to validate its
checksum with those options. This commit fixes that by ignoring empty
string values.
2019-11-21 09:56:58 -08:00
Brian Cain 4d70856b8a
Enhance docker build matching for determining built container ID
Prior to this commit, docker would look for a container ID based on
"Successfully built" string. This output does not exist if a user has
enabled the experimental feature buildkit. This commit updates the build
behavior to match against both kinds of outputs, and instead of using
`scan`, it uses MatchData and groups the container id with match group
name `:id` instead of making hard assumptions with the matches being
contained inside arrays from scan.
2019-11-19 10:59:28 -08:00
Antonio Terceiro 4fd2373753 nfs: avoid adding extra newlines to /etc/exports
StringBlockEditor already adds the necessary newlines. That extra
newline was making /etc/exports longer and longer, full of empty lines,
because StringBlockEditor doesn't know about it and does not remove it.
2019-11-17 00:33:08 -03:00
Jeff Bonhag 307123c1f2
Fixes #10753: Add reboot support for Linux guests (#11194)
This commit adds support for setting `reboot: true` while using the
shell provisioner with Linux guests.
2019-11-15 14:46:36 -05:00
Jeff Bonhag 0e68f02dc9
Fixes #11163: Get latest version for provider (#11192)
This commit changes the behavior of `vagrant box outdated --global` so
it gets the latest version for the current machine's provider, rather
than the latest version for any provider.
2019-11-13 17:33:15 -05:00
Brian Cain 403fece5ac
Merge pull request #11184 from briancain/fixup/cleanup-cloud-publish-cmd
Fixes #11137: Fixup how cloud publish handles its arguments
2019-11-12 09:07:42 -08:00
Brian Cain 39ea1af5ab
Merge pull request #11183 from briancain/fixup/include-errors-in-checksum-util
Fixes #11179: Ensure Vagrant::Errors are loaded in file_checksum util
2019-11-12 09:06:49 -08:00
Jeff Bonhag a39a7ae794
Fixes #10741: Check if update is available locally (#11188)
This commit checks the local box collection to see if the latest box
update has already been downloaded.  If it has, Vagrant will display the
destroy/recreate message instead of the "run vagrant update" message.
2019-11-12 11:41:10 -05:00
Brian Cain ce20b70073
Merge pull request #11126 from chrisroberts/f-newline-output
Update UI to properly retain newlines when adding prefix
2019-11-11 15:34:50 -08:00
Brian Cain 145f04893c
Fixes #11137: Fixup how cloud publish handles its arguments
Prior to this commit, if a user didn't supply a box file on disk or a
box url, Vagrant would crash and display a stacktrace with an invalid
file. This commit fixes that by adding some extra handling around the
arguments supplied to the publish command.
2019-11-07 10:19:52 -08:00
Brian Cain 44c6f655be
Fixes #11179: Ensure Vagrant::Errors are loaded in file_checksum util
Prior to this commit, the file_checksum class used the `Vagrant::Errors`
class as if it were apart of the Vagrant module. However, since the
file_checksum class is an interface and not part of the Vagrant module,
it doesn't have access to that Error class like other Vagrant modules.
This commit fixes that by ensuring the `"vagrant/errors"` class is
loaded, and that the proper namespace is used.
2019-11-07 09:22:17 -08:00
Jeff Bonhag 8a69c1205c
Fixes #10170: Check for modinfo in /sbin (#11178)
Check for modinfo in /sbin if it doesn't appear on the PATH.

If it's not found on the PATH or in /sbin, the command will default back to modinfo so the user sees the error message about adding it to their PATH.
2019-11-06 16:10:24 -05:00
Brian Cain d4f83ca4a3
Merge pull request #11170 from moench-tegeder/suse_hostname_vs_getent
explicitly test the hostname we'll be setting
2019-11-05 09:30:28 -08:00
Brian Cain f30b136c57
Merge pull request #11151 from dcermak/fix_exception_in_docker_test
Catch NetworkNoInterfaces error in docker prepare_networks_test
2019-11-01 10:58:52 -07:00
Dan Čermák fe4743a22b
Mock call to PrepareNetworks.list_interfaces in docker prepare_networks_test
The test "generates a network name and configuration" calls at the end
`process_public_network()`, which can return an empty list if the currently
executing machine has no usable network interfaces (this is typically the case
for workers that build rpm packages in OBS or Koji). This results in an
exception of type Errors::NetworkNoInterfaces to be thrown and causing this test
to fail.

This commit adds a mock of the PrepareNetworks.list_interfaces call that returns
a single entry with just the required defaults.
2019-11-01 17:36:31 +01:00
Brian Cain 4b1297b5d3
Merge pull request #11152 from briancain/fixup/command-snapshot-save-all-vms
Fixes #11139: Skip machines that haven't been created for snapshot save
2019-11-01 08:13:31 -07:00
Christoph Moench-Tegeder 6f6e58f4ae explicitly test the hostname we'll be setting
getent queries the system resolver for the hostname - but it's not
the resolver we're interested in. In fact, the hostname-to-be-set
may already exist in DNS (becuase DNS really is a nifty thing and
can do a lot of things which are not that possible with /etc/hosts
alone), in which case getent will "not fail" and vagrant will believe
the hostname had already been set.
Instead, query hostnamectl for the "static" hostname - that's the
one we will be setting, so we're ok IFF hostnamectl returns exactly
what we would be setting.
2019-11-01 15:41:04 +01:00
Brian Cain ce033454ca
Ensure nfsd call is mocked up in BSD NFS test 2019-10-25 09:02:30 -07:00
Brian Cain f998e535ce
Fixes #11139: Skip machines that haven't been created for snapshot save
This commit fixes the original #11027 fix, which assumed that the
hyper-v provider just wasn't properly getting a VM id when it listed
snapshots. In reality, it was just that if you invoke the
`with_target_vm` method with no arguments, it runs on the entire environment.
This meant that the capability snapshot_list attempted to be invoked on
machines that didn't exist yet, which is the original cause for why the
list_snapshot method did not recieve a vm ID. This commit fixes that by
simply skipping the machine if it does not yet exist.
2019-10-24 13:33:25 -07:00
Chris Roberts 318dca294a Ensure empty message values are properly formatted 2019-10-15 08:54:24 -07:00
Chris Roberts 783f5fc65d Update UI to properly retain newlines when adding prefix
When using a Prefixed UI instance prevent new line characters from
being removed when adding prefix formatting to output messages.

Fixes #11044
2019-10-14 16:56:40 -07:00
Brian Cain 7c93151f67
Add test for listing interfaces with docker networks 2019-10-10 11:38:57 -07:00
Chris Roberts b12a23273e
Merge pull request #11108 from chrisroberts/macos-catalina
Fix NFS sharing in macOS 10.15 (based on #11105)
2019-10-10 09:20:33 -07:00
Brian Cain 8458a21657
Determine prefix with netmask 2019-10-09 15:40:36 -07:00
Brian Cain 62b7e35169
Fixes #11094: Determine prefix for docker public networks
Prior to this commit, the docker action was using the method `prefix` on
an IPv4 and IPv6 address. This works fine for ruby versions 2.5 and
newer, however the ruby shipped with Vagrant is before 2.5, and
therefore the IPv4 and IPv6 classes do not have the prefix method,
resulting in an error. This commit fixes that by using a different
method of determining the prefix.
2019-10-09 09:56:59 -07:00
Chris Roberts da15c1d171 Add test coverage on host plugin updates for nfs and resove_host_path capabilities 2019-10-08 16:42:36 -07:00
Brian Cain 00e0dc9279
Merge pull request #11076 from dcermak/suse_nfs_support
Update nfs & service daemon names for suse based hosts
2019-10-08 13:41:22 -07:00
Andy Fowler ae9c3e28d6 Fix #10961 NFS sharing in macOS 10.15 host
On OS X 10.15, / is read-only and paths inside of /Users (and elsewhere)
are mounted via a "firmlink" (which is a new invention in APFS). These
must be resolved to their full path to be shareable via NFS.

/Users/johnsmith/mycode  =>  /System/Volumes/Data/Users/johnsmith/mycode

We check to see if a path is mounted here with `df`, and prepend it.

Firmlinks are only createable by the OS and this wasn't supposed to be
visible to applications anyway:
https://developer.apple.com/videos/play/wwdc2019/710/?time=481
2019-10-08 13:21:34 -07:00
Chris Roberts 04a1bb58f3 Add coverage on new behavior of FileChecksum 2019-10-08 11:23:48 -07:00
Chris Roberts 0bce1e6307 Update tests for checksum and filechecksum 2019-10-08 11:23:48 -07:00
Chris Roberts 7fb81bcea1 Add support for other checksum types 2019-10-08 11:23:48 -07:00
Brian Cain ea550289a9
Merge pull request #11100 from chkpnt/suse-hostname
Use hostnamectl instead of hostname to set the hostname under SUSE
2019-10-08 09:26:46 -07:00
Brian Cain 7616c99c79
Merge pull request #11106 from briancain/bug/docker_compose_build_args
Ensure build_args are passed into docker compose config file
2019-10-07 14:30:30 -07:00
Brian Cain d6f556c83d
Merge pull request #11099 from briancain/file-provisioner-source-path
Ensure relative path for file provisioner is relative to machines cwd
2019-10-07 14:28:13 -07:00
Brian Cain f1ea4eaac0
Ensure build_args are passed into docker compose config file
Prior to this commit, the docker compose build method would not properly
set build_args if given in a Vagrantfile. This commit fixes that by
using the passed in key `extra_args` from the docker build action.
2019-10-07 12:48:59 -07:00
Brian Cain 96e275451c
Merge pull request #10938 from andersk/virtualbox-usable
virtualbox: Fix usability test to reject bad installs without crashing
2019-10-07 09:04:24 -07:00
Anders Kaseorg 4afd370d6a virtualbox: Fix usability test to reject bad installs without crashing
If VirtualBox is installed but the kernel module is missing or the
service is stopped, the usability test should fail without crashing so
we can fall back to other providers.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-10-04 15:56:10 -07:00
Gregor Dschung 8442b6b59f Use hostnamectl instead of hostname to set the hostname under SUSE 2019-10-03 14:46:14 +02:00
Brian Cain 0a6c4e2d0f
Ensure relative path for file provisioner is relative to machines cwd
Prior to this commit, if you ran Vagrant in a different current working
directory other than where a current guest machines location is, the
file provisioner would not take into account the machines local dir, and
would instead use the path where Vagrant was invoked to expand the
`source` path option for a file provisioner. This commit fixes that by
passing the root path `machine.env.cwd` when expanding the source dir.
2019-10-02 15:33:23 -07:00
Brian Cain 968a126405
Merge pull request #11098 from briancain/finalize-ansible-config-values
Fixes #10950: Ensure pip_install_cmd is finalized
2019-10-02 12:51:33 -07:00
Brian Cain 23352d406c
Merge pull request #11097 from briancain/hyperv-command-snapshot-save-fix
Fixes #11027: Ensure VM id is passed to list snapshots
2019-10-02 12:49:38 -07:00
Brian Cain 96c20ad3cc
Fixes #10950: Ensure pip_install_cmd is finalized
Prior to this commit, the `pip_install_cmd` option for ansible guest
config was not properly finalized. This commit ensures that if that
value is still UNSET_VALUE, it gets set to empty string in the finalize!
method.
2019-10-02 10:33:31 -07:00
Brian Cain 66ec57a637
Fixes #11027: Ensure VM id is passed to list snapshots
Prior to this commit, if you tried to save a snapshot without giving it
a name, the hyper-v driver would not properly obtain a vm id to save a
snapshot on, resulting in an error. This commit updates the command
snapshot save to hold onto the machines ID in argv rather than `pop` it
off, so that the hyperv driver can obtain the guests id when saving a
snapshot.
2019-10-01 13:33:39 -07:00