64 Commits

Author SHA1 Message Date
Brian Cain
085feb6526 (#8923) Quote path passed into IdentityFile for ssh command
Prior to this commit, a change to how the IdentityFile setting for the
ssh command broke when a path with a space was used. This commit fixes
that by quoting the path used to set the IdentityFile so that it uses
the full path instead of part of the path after the space.
2017-08-28 13:14:45 -07:00
Brian Cain
b45ee4f455 (#6656) Format windows paths for ssh_config command
Prior to this commit, if the ssh-config command was invoked within
cygwin or msys2, it would show a regular windows style path for private
keys rather than a path that could be used within msys2 or cygwin. This
commit updates that behavior by converting all of the private key paths
to the proper msys2 or cygwin path if the platform is windows and the
command was invoked from one of those two shells.
2017-08-25 13:17:19 -07:00
Brian Cain
ffec0ff8d9 (#8697) Introduce extra_args setting for ssh configs
Prior to this commit, there was no way to add additional ssh arguments
within a Vagrantfile for a given vagrant machine. This commit introduces
a new option extra_args that allows users to pass in a single argument
or an array of flags that will be added onto the ssh command.
2017-08-17 09:02:20 -07:00
Brian Cain
8b1043c199 Remove stub methods and replace with allows for rpsec 3 2017-08-04 15:02:59 -07:00
Chris Roberts
1a62743bc5 Update rspec to recent version and fix deprecations 2017-08-03 17:54:07 -07:00
Brian Cain
773c4fff13 Fixup util/ssh and ansible/provisioner tests 2017-07-17 10:21:26 -07:00
Chris Roberts
36a50f4d69 Allow a bit more time for process to get started 2017-07-07 11:26:32 -07:00
Chris Roberts
954569d1fc Remove PATH based cygwin detection
Detecting cygwin via PATH contents can result in false positives
resulting in errors when using Vagrant on Windows outside of a
cygwin shell. Use environment based detection instead.
2017-07-03 14:40:27 -07:00
Brian Cain
d66122f84d Fixup util/ssh unit tests
This commit properly mocks out the ChildProcess library for testing the
`util/ssh` class when subprocess is enabled.
2017-06-20 16:43:11 -07:00
Brian Cain
b02f110cd8 (#7855) Introduce more ssh options for machines
This commit allows the user to configure two additional options that
were previously not configurable: Compression and DSAAuthentication.
Each config option is set as a boolean, and if left out of the config
will default to its previous behavior which is included and set to
"yes". If the user explicitly sets it to false, it will not be included
as an ssh option.
2017-06-15 16:29:53 -07:00
Chris Roberts
a8b2f78f59 Do not prefix Windows paths if UNC prefix already exists
While VirtualBox has commented that they do not support UNC remote
paths (but do for long paths) it seems that remote paths can work.
If user provides UNC path, allow it to be used as-is.

Fixes #7011
2017-04-20 16:33:38 -07:00
Chris Roberts
8a9fa302f0 Removing timing issues from test coverage 2017-03-03 09:49:55 -08:00
Chris Roberts
e2acb5250a Add command deprecation helper module 2017-02-24 06:22:39 -08:00
Chris Roberts
903428e569 Add Util::Subprocess#stop and Util::Subprocess#running? 2017-02-08 14:15:47 -08:00
Chris Roberts
25a2bdd279 Prevent generating environment variables with invalid empty names 2017-01-12 15:12:41 -08:00
Chris Roberts
beffa70941 Downloader checksum output information and digester usage
Add more output information around type of checksum being validated.
Use builtin Digest#file to read target file for generation of hexdigest.
2016-11-14 10:22:25 -08:00
Chris Roberts
da45ca707c Add md5 and sha1 checksum support to Downloader.
Allows checksum validation on downloaded files via Util::Downloader
using MD5 and/or SHA1 checksums. This also integrates checksum validation
support with the shell provisioner for downloaded remote files.
2016-11-09 16:05:39 -08:00
Jake Teton-Landis
51f68f41a2 Unit test Vagrant::Util::Subprocess's STDIN support
- create new unit test file for this class, as none existed.
- test `Vagrant::Util::Subprocess#execute` behavior relating to STDIN
  handling.
2016-09-15 18:19:01 -07:00
Seth Vargo
2a230a11e2
Cache the results of common operations
This commit changes Vagrant::Util::Platform to cache the result of some
common operations. These values are highly unlikely to change over the
course of a single Vagrant run and they are only cached for that run.
2016-05-30 18:27:12 -04:00
Seth Vargo
fb60d34236
Add unique names to all tmpdir and tempfile calls in tests + cleanup
This commit attempts to uniquely identify the temporary files and
directories that are created during test runs. Where it was a quick
fix, this commit also removes the temporary files and directories.

There are still a ton of temporary files due to calls to
.isolated_environment in the tests without an easy API an easy way
to provide a closer to that function.
2016-05-28 23:22:34 -04:00
Seth Vargo
8c3f833e8e Use the new presence helpers in the Chef provisioner 2015-11-23 18:33:47 -05:00
Seth Vargo
4c55c39b2d Add presence helpers 2015-11-23 18:04:18 -05:00
Mitchell Hashimoto
d5fa7416ff core: more heuristics for determining Cygwin 2015-11-21 11:17:36 -08:00
Mitchell Hashimoto
ec0b0fb7f9 providers/virtualbox: IPv6 host only networks 2015-09-30 17:23:25 -07:00
Mitchell Hashimoto
6c06db776d core: test for URI escaping 2015-07-06 16:26:06 -06:00
Jean-Francois Bibeau
45e14a8dc4 UNC paths should have backslashes, not front-slashes. 2015-04-16 11:02:58 -04:00
Jean-Francois Bibeau
415837c544 moved function to platform utils, added unit test as per @sethvargo 2015-04-06 16:51:55 -04:00
Seth Vargo
d2874064f4 Use .key? instead of .has_key? 2015-01-05 18:29:01 -05:00
Mitchell Hashimoto
f4dec575ed core: Vagrant::Util::Keypair for generating keypairs 2014-10-24 09:33:44 -07:00
Mitchell Hashimoto
e198652e75 core: don't load curlrc [GH-4328] 2014-08-10 20:49:53 -07:00
Kalman Hazins
bb052366f7 Change symbols inside hashes to 1.9 JSON-like syntax 2014-05-22 12:35:12 -04:00
Mitchell Hashimoto
81df70eee0 providers/docker: support building Dockerfiles 2014-04-21 13:55:54 -07:00
Fabio Rehm
54656151cf Convert specs to RSpec 2.14.8 syntax with Transpec
This conversion is done by Transpec 1.10.2 with the following command:
    transpec test/unit/

* 507 conversions
    from: obj.should
      to: expect(obj).to

* 394 conversions
    from: == expected
      to: eq(expected)

* 260 conversions
    from: obj.should_receive(:message)
      to: expect(obj).to receive(:message)

* 85 conversions
    from: obj.stub(:message)
      to: allow(obj).to receive(:message)

* 25 conversions
    from: its(:attr) { }
      to: describe '#attr' do subject { super().attr }; it { } end

* 19 conversions
    from: obj.should_not
      to: expect(obj).not_to

* 7 conversions
    from: obj.should_not_receive(:message)
      to: expect(obj).not_to receive(:message)

* 3 conversions
    from: Klass.any_instance.should_receive(:message)
      to: expect_any_instance_of(Klass).to receive(:message)
2014-03-14 12:02:07 -03:00
Mitchell Hashimoto
513efa6739 core: Downloads with user/pass use curl -u flag [GH-3183] 2014-03-13 08:53:18 -07:00
Mitchell Hashimoto
4c9e6e46b2 provisioners/salt: don't use exteranl deep_merge [GH-2348] 2014-03-07 09:18:34 -08:00
Mitchell Hashimoto
05eeefbe36 core: Fix Downloader tests 2014-02-05 21:19:34 -08:00
Mitchell Hashimoto
7248797fa5 core: add test for fs_real_path on Windows 2014-01-15 11:32:53 -08:00
Mitchell Hashimoto
b386e1dbbd test: allow skipping certain tests on Windows 2014-01-15 10:54:50 -08:00
Mitchell Hashimoto
72398faeaf core: put shell quoting into its own util class, it is useful 2013-12-13 21:17:15 -08:00
Fabio Rehm
bf4131af17 Clean up downloader test a bit 2013-07-28 20:23:27 -03:00
Fabio Rehm
c7aed1a6a1 Provide a custom user agent header to cURL request so that URL shorteners are able to track the amount of downloads 2013-07-28 20:23:27 -03:00
Mitchell Hashimoto
2239036b59 Use Mozilla CA cert bundle for SSL validation 2013-04-16 17:32:30 -07:00
Mitchell Hashimoto
43c14dfb26 Fix the tests 2013-04-16 13:32:37 -07:00
Mitchell Hashimoto
932f15665b Fix downloader tests 2013-04-03 12:04:58 -07:00
Mitchell Hashimoto
d1eccbf98f SafeChdir all the things for thread safety 2013-04-03 08:31:43 -07:00
Mitchell Hashimoto
b9a2855fcb Tests for the downloader 2013-04-03 08:31:41 -07:00
Mitchell Hashimoto
43f3764e5b Properly quote regular expression inputs to StringBlockEditor 2013-03-14 12:41:03 -07:00
Mitchell Hashimoto
987b3008fe Which_test 2013-02-08 22:31:13 -08:00
Patrick Wyatt
bd06bea3e5 Enable Windows users with SSH installed to use 'vagrant ssh' 2013-02-08 22:09:11 -08:00
Mitchell Hashimoto
23668d4ed0 Fix some newline weirdness with StringBlockEditor 2013-01-15 21:53:11 -08:00