Commit Graph

1978 Commits

Author SHA1 Message Date
Chris Roberts 9bae0a7094 Support loading machine configuration without provider validation
Allow Vagrantfile#machine_config to load properly when the requested
provider may not be currently available. Update the Environment to
utilize this when searching for plugin information to properly allow
box provided Vagrantfiles to define required plugins.
2019-06-14 11:50:06 -07:00
Brian Cain 1b0148bc78
Fixes #10895: Use relative paths to machines folder path for Listener
Prior to this commit, the rsync helper expanded all exclude paths that
should be ignored to be full qualified and regexp escaped. However the
Listen gem expects these ignore paths to be relative to the path passed
into the listener, not a full path. This commit fixes that by using the
path given by the user for the `rsync__exclude` option
2019-06-11 14:58:42 -07:00
Brian Cain bf55e43460
Fixes #10869: Remove excludes if array is empty
Prior to this commit, if a user specified that their `rsync__excludes`
option was an empty array, Vagrant would treat that as if it included
options inside the array rather than ignoring it. This commit fixes that
by only adding the excludes option when it exists and is not empty.
2019-06-10 13:44:39 -07:00
Chris Roberts 2507b68045
Merge pull request #10891 from chrisroberts/f-trigger-multithread
Update trigger abort behavior when running parallel actions
2019-06-05 13:58:44 -07:00
Chris Roberts f5f89f72b7
Merge pull request #10889 from chrisroberts/f-local-plugins-boxfile
Support loading plugin information from nested Vagrantfiles
2019-06-05 13:56:29 -07:00
Chris Roberts bbf8f05d75
Merge pull request #10884 from GregJPreece/feature/10506-machine-readable-status
#10506 - Machine Readable Global-Status
2019-06-05 13:54:47 -07:00
Chris Roberts fd34ea657b Add test coverage on expected machine-readable output 2019-06-05 13:04:47 -07:00
Brian Cain fb80e8da9f
Merge pull request #10890 from briancain/add-usability-check-for-docker-plus-tests
Add usability check for docker plus tests
2019-06-05 07:58:23 -07:00
Greg J Preece b57d467fa2 Revert "Updating unit tests w/ UI message suppression"
This reverts commit f25427869c.
2019-06-04 20:58:46 -07:00
Chris Roberts 88c675694a Update trigger abort behavior when running parallel actions
When the provider supports parallel actions and actions are being
run in parallel, do not immediately kill the process on failure.
Instead terminate the action thread and log the exit code. Once
all running actions have completed, the process will then exit
with the stored exit code.
2019-06-04 16:40:59 -07:00
Brian Cain b8b2111700
Remove unnecessary test from virtualbox context 2019-06-04 14:56:31 -07:00
Brian Cain bb6913e6e8
Fixup virtualbox provider tests for Travis 2019-06-04 14:43:13 -07:00
Brian Cain 74c89e5ec1
Add virtualbox provider rspec tests 2019-06-04 14:14:06 -07:00
Brian Cain 34e53a5a4b
Add docker provider class test
This commit introduces aa provider_test class for the Docker provider
2019-06-04 13:24:07 -07:00
Chris Roberts 0cba5263ad
Merge pull request #10811 from chrisroberts/f-synced-folder-creds
Remove configuration information from SMB synced folder data
2019-06-04 11:33:33 -07:00
Chris Roberts 50c4464d44 Support loading plugin information from nested Vagrantfiles
Since plugin installation happens when the environment is first
initialized, attempt to determine the provider in use and load
any box provided Vagrantfiles to include any plugin configuration
they may include.
2019-06-04 10:07:02 -07:00
Anders Kaseorg 7980178d19 providers/docker: Add usability test
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-05-30 13:13:43 -07:00
Greg J Preece f25427869c Updating unit tests w/ UI message suppression 2019-05-30 09:17:30 -07:00
Brian Cain eb3e309f89
Ensure guest names are string when filtering
Prior to this commit, if a guest name was given as a symbol, the
filter_triggers method would fail to properly match it with the only_on
option, as it is not a valid type to the #String.match method. This
commit fixes that by converting the parameter to a string so that it can
be properly matched on the guest.
2019-05-13 14:07:22 -07:00
Brian Cain 93497b8ca3
Merge pull request #10829 from briancain/box-update-continue
Continue updating environment boxes if metadata not found
2019-05-08 09:32:58 -07:00
Brian Cain 237209d6e4
Merge pull request #10828 from briancain/snapshot-list-ux-fixup
Separate snapshot names when listing snapshots
2019-05-08 09:17:06 -07:00
Brian Cain 86800421db
Merge pull request #10824 from briancain/exit-process-on-abort-triggers
Fixes #10823: Use Process.exit! for abort trigger option
2019-05-08 09:15:51 -07:00
Brian Cain a613044baf
Merge pull request #10820 from briancain/docker-compose-volumes
Fixes #10798: Enhance how docker compose driver path expands
2019-05-08 09:14:33 -07:00
Brian Cain 9a0fa8c061
Merge pull request #10803 from briancain/ensure-gemrc-set
Set gemrc through configuration method rather than relying on environment variable
2019-05-08 09:12:11 -07:00
Brian Cain e2d017b219
Continue updating environment boxes if metadata not found
Prior to this commit, if a user ran a `vagrant box update` on their
entire environment and one of the boxes did not have a metadata file,
the rest of the boxes in the update would be skipped. This commit fixes
that by ignoring those boxes and showng a warning, so that the rest of
the boxes could check for updates.
2019-05-08 09:04:45 -07:00
Brian Cain ca232444e7
Separate snapshot names when listing snapshots
Prior to this commit, Vagrant would list all machine snapshots in a flat
list, without showing which snapshots were associated with which guests.
This commit fixes that by placing some separation to make it clear which
snapshots belong to which guests.
2019-05-06 11:09:34 -07:00
Brian Cain 35ee3e2342
Fixes #10823: Use Process.exit! for abort trigger option
Prior to this commit, the `abort` option for triggers would just call
`exit`, which would end up raising a SystemExit exception, signaling
Vagrant to abort. This broke down however in a multithreaded context
like when running multiple guests at once on supported providers,
resulting in Vagrant failing to exit cleanly and instead raise an
exception. This commit changes that by instead using `Process.exit!` to
abort Vagrant.
2019-05-03 14:48:54 -07:00
Brian Cain ca0fd64ded
Fixes #10798: Enhance how docker compose driver path expands
Prior to this commit, the docker compose driver would _always_ path
expand a host volume no matter what. This is not always the correct
option, for example if that host volume is actually a reference to a key
inside a `volumes` hash instead of a path on disk. This commit changes
that by looking to see if the requested host volume is actually a
defined key inside the compose config, and if not, it will path expand
it like before. Otherwise it will leave the key "as is".
2019-04-29 16:14:37 -07:00
Chris Roberts e7e8a39c55 Stub the ssh path used for exec
Since a full path to the ssh executable is being used and is expected
at a specific location, default to providing that location when looking
up the executable. This prevents errors from occurring when a host
system provides an `ssh` match at a different path.
2019-04-25 10:44:25 -07:00
Chris Roberts 5b94bbb49b Scrub folder configuration data when persisting to disk
Before writing synced folder configuration data to the local
data directory run content through the credential scrubber to
remove any sensitive content before write.
2019-04-25 10:31:48 -07:00
Chris Roberts 92e6a29bfc Update naming in tests as instance methods are being referenced 2019-04-25 10:09:50 -07:00
Chris Roberts b493503e09 Scrub SMB credential information from folder configuration
This prevents credential information from being persisted into the
local data directory which is used during subsequent runs to determine
folder definition changes.
2019-04-25 10:07:48 -07:00
Alex Goncharov 9266899b34 Add a test for version selection for a box update 2019-04-24 19:59:37 -04:00
Brian Cain 757175b94e
Add note about removing patch fix and add test 2019-04-22 10:36:25 -07:00
Brian Cain 139ae4397f
Merge pull request #10625 from vdebroy/fix-issue-9584
Fix issue 9584
2019-04-09 15:12:02 -07:00
Brian Cain 8e9578cf5d
Merge pull request #10752 from chrisroberts/f-coreos-guest-caps
Update guest capabilities for coreos
2019-04-09 15:10:58 -07:00
Brian Cain 75d4aa42a1
Ensure non-existent machines do not attempt to list snapshots
Prior to this commit, if a snapshot restore was run on an entire
environment with some non-existent guests, Vagrant would attempt to list
their snapshots with a nil id. This commit fixes that by returning an
empty list of snapshots if the machine has not been created yet.
2019-04-09 13:11:19 -07:00
Jose Luis Duran 93f02c67f8
FreeBSD: Simplify the listing of interfaces
According to ifconfig(8), to list only Ethernet interfaces, excluding
all other interface types, including the loopback interface, the command
to use should be:

    ifconfig -l ether

Related to: #8760
2019-03-29 02:47:39 -03:00
Jose Luis Duran 1cf0e62400
BSD: VirtualBox shared folders naming convention
This is a follow-up of #10717 to use the same naming convention as on
Linux guests, in order to reduce the diffs.

Also adds the missing capability to `unmount_virtualbox_shared_folder`
on FreeBSD guests.
2019-03-28 02:34:34 -03:00
Brian Cain ec67151312
Merge pull request #10702 from briancain/docker-network-support
Docker Provider Network Support
2019-03-25 15:43:23 -07:00
Chris Roberts 8ba69e587c Update guest capabilities for coreos 2019-03-22 15:20:37 -07:00
Brian Cain f8744b66f0
Add connect cli argument tests 2019-03-22 09:24:26 -07:00
Brian Cain 4f80a9e6d5
Add test for requesting public ip range for docker network provider 2019-03-22 09:02:40 -07:00
Brian Cain 36f2aaf55e
Add test for public network gateway request 2019-03-22 08:45:14 -07:00
Brian Cain b56f89775d
Add more mocks for public network
Ensure test values are used rather than real values from machine
2019-03-22 08:24:22 -07:00
Brian Cain 6bffdca972
Add beginning of connect network tests for docker provider 2019-03-21 16:06:24 -07:00
Brian Cain 88a18fe2c5
Add public network tests for docker provider 2019-03-21 16:06:11 -07:00
Brian Cain 82700d95b3
Ensure subnet is used if specified from user config options 2019-03-21 15:29:04 -07:00
Brian Cain 2bc6fa854a
Add tests for validating network configurations 2019-03-21 13:51:24 -07:00
Brian Cain 36a41957c9
Fix travis ci tests for public gateway and ip range issues 2019-03-21 13:51:07 -07:00
Brian Cain 98e41eb936
Mock out public/private network calls for existing subnet tests 2019-03-21 13:26:37 -07:00
Brian Cain 32807d70c7
Mock up public/private network calls for #call test 2019-03-21 13:03:39 -07:00
Brian Cain 8c169714c5
Ensure variable names exist in method 2019-03-21 11:39:16 -07:00
Brian Cain 6ce453ab70
Delete old file and add blank describe blocks for remaining tests 2019-03-21 11:16:26 -07:00
Brian Cain 96a19aa00c
Fix how options to cli args are handled
Since options could also be defined as strings, convert it all to string
and compare those instead
2019-03-21 11:15:41 -07:00
Brian Cain 5215354d16
Fix missing docker error classes, and finish out initial #call tests 2019-03-21 10:50:45 -07:00
Brian Cain 75d6c17386
Fix up call method and add todo for prepare networks 2019-03-20 16:41:42 -07:00
Chris Roberts 2d5091a985
Merge pull request #10713 from renatoaguiar/fix-void-nfs
Fix NFS capability detection on Void Linux
2019-03-20 15:48:46 -07:00
Brian Cain 1027636e41
Split up and rename unit tests for docker network operations 2019-03-20 15:14:39 -07:00
Brian Cain eb75431c4a
Update docker driver and docker driver unit tests 2019-03-20 14:50:28 -07:00
Brian Cain c09bce5386
Fixup docker action destroy_network test 2019-03-20 13:35:46 -07:00
Brian Cain 5ed5868067
Inspect networks before creating new ones
This commit updates the behavior of how the docker provider creates new
docker networks. It looks at each existing network to see if the
requested subnet has already been configured in the docker engine. If
so, Vagrant will use that network rather than creating a new one. This
includes networks not created by Vagrant. Vagrant will not clean up
these networks if created outside of Vagrant.
2019-03-12 10:36:57 -07:00
Chris Roberts 1c650a7fb8 Remove whitespace from id file on load
If the id file includes whitespace, remove it. If the content of
the id file is empty, do not set the machine id.

Fixes: #10722
2019-03-11 17:08:13 -07:00
Brian Cain 2f0c66f832
Only enable shared folder mounts on freebsd guests
Since the virtualbox guest additions seem to only be available for
freeBSD, move the shared folder functionality over to freebsd guests
rather than all BSD guests.
2019-03-08 11:03:23 -08:00
Brian Cain fe002b7e48
Add unit tests for virtualbox shared folders 2019-03-07 10:35:37 -08:00
Renato Aguiar 4de7716ffb Fix NFS capability detection on Void Linux 2019-03-05 10:03:52 -08:00
Brian Cain 2be0bc2d81
Add unit tests for docker network actions 2019-03-05 09:49:15 -08:00
Brian Cain ba2a1224e0
Update driver to include network tests 2019-03-01 08:34:43 -08:00
Chris Roberts c0eaac791d Write metadata file to box contents during package
If the provider does not include a metadata.json file prior to
compressing the box, determine current provider and write
metadata.json file before compressing.
2019-02-28 15:31:49 -08:00
Brian Cain 1592c0c216
Merge pull request #10690 from briancain/cleanup-rsync-tmp-folders
Cleanup rsync tmp folders
2019-02-26 13:25:34 -08:00
Brian Cain 3b540e502f
Force removal of rsync tmp dir
Force delete entry to prevent any potentail failures when trying to
clean up the tmp dir from rsync
2019-02-26 09:08:56 -08:00
Chris Roberts e2b6a6645c Always ensure remote destination directory exists 2019-02-26 08:54:49 -08:00
Chris Roberts 6b105d704d Update communicator upload behavior to handle `/.` path directives
This update was prompted by updates in openssh to the scp behavior
making source directory paths suffixed with `.` no longer valid
resulting in errors on upload. The upload implementation within
the ssh communicator has been updated to retain the existing
behavior.

Included in this update is modifications to the winrm communicator
so the upload functionality matches that of the ssh communicator
respecting the trailing `.` behavior on source paths. With the
communicators updated to properly handle the paths, the file
provisioner was also updated to simply apply previously defined
path update rules only.

Fixes #10675
2019-02-26 08:02:09 -08:00
Brian Cain 401a571642
Add windows platform test for ensuring tmp file does not exist 2019-02-22 12:44:46 -08:00
Brian Cain 45ca16ffd5
Add rsync helper test for linux machines 2019-02-22 12:38:23 -08:00
Andrew Eikum 7517faa9ee
Remove tmpdir after rsync completes 2019-02-22 12:24:13 -08:00
Brian Cain cdcedb0a9e
Fixes #10682: Move over AddAuthentication middleware and hooks
Prior to this commit, the AddAuthentication hooks still existed in a
deprecated class LoginCommand. This commit fixes that by moving it over
to the vagrant cloud cli namespace instead.
2019-02-21 09:42:16 -08:00
Brian Cain 31b9aafcf7
Merge pull request #10622 from mattin4d/master
Change remaining box_client_cert refs to box_download_client_cert
2019-02-20 11:03:49 -08:00
Vidroha Debroy 7c0ffe369a Updated based on recommended changes per review. 2019-02-15 12:14:37 -06:00
Brian Cain 6b9cdb4e48
Fixes #10663: Ignore boxes in collection with malformed version numbers
Prior to this commit, if a box some how got on disk that had an
incorrect or invalid version number that did not match Gem::Version,
Vagrant would throw an exception when attempting to generate a list of
the boxes on disk. This commit fixes that by looking at the version from
the path generated, and shows a warning to the user about the box and
skips it from the list so they at least know about the problematic box
and can still get a list of boxes.
2019-02-14 15:30:11 -08:00
Brian Cain 68e21d8ac5
Merge pull request #10664 from chrisroberts/f-plugin-config-format
Fix format finalization of plugins in Vagrantfile
2019-02-12 10:00:14 -08:00
Brian Cain 26d05130c4
Merge pull request #10647 from chrisroberts/f-appimage-ld
Use ld path with appimage libs on suffix
2019-02-12 09:58:53 -08:00
Brian Cain 9636f59232
Merge pull request #10638 from chrisroberts/e-reboot-message
Add reboot output to guest capability
2019-02-12 09:57:30 -08:00
Brian Cain 0bc0bdd616
Merge pull request #10615 from briancain/introduce-typed-triggers
Introduce :type option for Vagrant triggers
2019-02-12 09:16:01 -08:00
Chris Roberts 2e58e002d6 Fix format finalization of plugins in Vagrantfile 2019-02-11 15:48:43 -08:00
Chris Roberts e165a5bc6e Update test checking ld path modifications 2019-02-05 07:16:40 -08:00
Brian Cain 91e351b937
Add unit test for dockers compare_synced_folders 2019-02-04 11:12:55 -08:00
Chris Roberts 80705c4804
Merge pull request #10637 from chrisroberts/f-address-config
Add base_address to core vagrant vm config
2019-02-01 16:15:50 -08:00
Chris Roberts ade5370db3 Add reboot output to guest capability 2019-02-01 15:47:02 -08:00
Chris Roberts 61cf179b42 Add base address attribute to vm config 2019-02-01 14:47:11 -08:00
Brian Cain 64e21a1215
Add test for Action classes with no name 2019-02-01 13:34:15 -08:00
Brian Cain 6ac23f1a15
Add fire trigger test for cli class 2019-02-01 13:34:15 -08:00
Brian Cain 16b5ad74ca
Handle command triggers with run_remote options
This commit adds some handling around when a machine does not exist at
all but a trigger was defined with a run_remote option
2019-02-01 13:34:15 -08:00
Brian Cain 09846b30fe
Fixup action tests
This commit fixes up the action tests by adding a `name` field for all
the Action classes used within the various tests.
2019-02-01 13:34:15 -08:00
Brian Cain fefb702359
Introduce `type` and `command` triggers
This commit introduces some basic functionality for typed triggers:

- command
- action

Command triggers are triggers that will run before or after a given
sub-command.

Action triggers are for running triggers before or after internal
actions for Vagrant. This could be before or after a provision step,
before or after synced folders, or networking, etc.
2019-02-01 13:34:15 -08:00
Chris Roberts d7e036981f Add coverage for windows path behavior in vbox6 driver 2019-01-29 11:09:30 -08:00
Vidroha Debroy 281203edf1 Handling the cases for UNSET_VALUE, i.e., config is not finalized. 2019-01-28 13:35:50 -06:00
Matt Adams a3836f5fec Change remaining box_client_cert refs
This fixes issues with box add/update when self hosting with client
certs. The --cert option was not being added to the curl subprocess
in these cases.
2019-01-28 08:45:24 -06:00
Vidroha Debroy d2c11e81ae Config has pip_install_cmd for Provisioner to pick it up. Tests updated. 2019-01-25 16:51:58 -06:00
Vidroha Debroy 84df098135 Handling empty strings passed as pip_install_command. 2019-01-25 14:55:39 -06:00