96 Commits

Author SHA1 Message Date
Chris Roberts
6e13612111 Add test coverage for architecture support 2023-09-14 16:15:03 -07:00
hashicorp-copywrite[bot]
36a312ee26
add missing license headers and update copyright file headers to BUS-1.1 2023-08-10 21:53:25 +01:00
Chris Roberts
602d42bbc8 Add and update tests for insecure private keys
Updates existing test coverage to use insecure private key collection
and adds testing for behavior changes within the communicator and the
keypair utility.
2023-06-26 15:47:32 -07:00
William Bradford Clark
15df2c69b4 (#12884) Use default ssh.private_key_path when ssh.keys_only = false 2022-09-10 02:16:51 -04:00
Chris Roberts
3d0d0148e9 Update tests to use real UI instance
Replaces use of UI doubles within tests to use actual UI instance
    to ensure calls are passing parameters correctly.
2021-06-23 14:04:48 -07:00
sophia
132720e3b4 Add local machine to global index of machines if it does not exist 2020-06-09 17:22:55 -05:00
Chris Roberts
4546d804b1 Add support for configuring SSH connect timeout
Retains the original default value of 15 seconds for SSH connect
timeout. Allows users to modify this timeout via SSH communicator
option. Enforces integer values for timeout and validates custom
values are greater than 0.
2020-04-20 14:23:21 -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
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
90a5854684 Fill out ssh options config and remote_user
Include config option within ssh_config command output template. Default
remote_user value to set username value. Include existence check on
provided config value to ensure file is available. Update tests to
include coverage on all changes. Add new options to the docs.
2018-12-11 08:09:43 -08:00
Brian Cain
dac78eb626
Add test for identical file paths 2018-09-18 14:15:34 -07:00
Chris Roberts
6c1a9dc58e Store box metadata of active guest
When a guest is created, the box metadata information is stored in the
machine data directory. This allows modifications to happen to the
Vagrantfile definition of the box in use (box name change, box version
change, etc) while still allowing the Machine instance of an active
guest successfully load the box currently backing it.
2018-08-02 11:01:36 -07:00
Chris Roberts
0e0f660f62 Fix stray test checking verify_host_key 2018-07-27 16:51:58 -07:00
Chris Roberts
84c0aafe71 Support non-interactive local plugin install 2018-07-17 14:49:41 -07:00
Brian Cain
a177bcf4b7
Ensure internal trigger fire does not get called if plugin installed
This commit wraps up the internal machine action level trigger calls if
the community vagrant-trigger plugin is installed.
2018-05-07 11:33:55 -07:00
Brian Cain
092e73d87f
(#9775) Move triggers object init in machine
Prior to this commit, the hyper-v provider called an action on a machine
that hadn't fully finished initializing. This commit fixes that by
moving up the initialization of the triggers object next to the rest of
the instance variables of the machine object.
2018-05-04 14:32:57 -07:00
Brian Cain
c9e5a22bff (#9062) Deprecate :paranoid in favor of :verify_host_key
As of `net-ssh` version 4.2.0, the key :paranoid has been deprecated in
favor of using :verify_host_key. This commit updates Vagrants ssh config
to use the new key, and deprecates the use of :paranoid.
2018-01-05 10:02:45 -08: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
1b4d7848bc Fix vagrant_cwd warnings
Prior to this commit, if a user ran a vagrant command within a subdir,
it would warn about the cwd changing which is not actually the case.
This commit adds an additional check to see if vagrant is being invoked
within a subdirectory so that it doesn't warn the user.
2017-06-19 13:05:26 -07:00
Brian Cain
79c7799fd9 Add basic unit test for CWD change warning 2017-06-06 08:38:03 -07:00
Fernando Seror
48b0e00368 Tests regarding warning whenever CWD changes 2017-06-05 13:25:30 -07:00
Zack Train
cb70749bd8 redux of pr 7398 for ssh-agent key fix 2016-08-11 11:48:10 -07:00
Seth Vargo
ca337122dc
Fix test issues 2016-05-28 23:44:11 -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
Mitchell Hashimoto
27412e6ee9 core: fix some failing Windows tests 2015-11-20 14:54:38 -08:00
Mitchell Hashimoto
1a7937ed50 core: don't replace insecure key on base package [GH-5310] 2015-11-18 16:25:07 -08:00
Mitchell Hashimoto
1330244fef core: save the UID that created a machine 2015-07-06 18:04:16 -06:00
Mitchell Hashimoto
341534299d core: ssh private_key_path overwrites insecure key [GH-5632] 2015-07-06 16:17:54 -06:00
Mitchell Hashimoto
6aeae27889 core: just don't use ** to avoid symbol/strings mixup
/cc @sethvargo
2015-01-05 12:37:58 -08:00
Seth Vargo
2377247ba0 Test that the environment has string keys 2015-01-05 10:57:06 -05:00
Mitchell Hashimoto
f8a2322459 core: only delete state if not created on initialize only
/cc @sethvargo
2014-11-10 16:29:19 -08:00
Matt Wrock
dc628cd722 fixes infinite loop in machine state call if provider calls machine.action 2014-11-06 08:51:47 -08:00
Mitchell Hashimoto
f0a73c7c05 core: call #state in any #action call [GH-4513] 2014-10-23 12:20:16 -07:00
Mitchell Hashimoto
5036d16461 update CHANGELOG 2014-10-23 09:15:47 -07:00
Mitchell Hashimoto
381f1332c8 Merge pull request #4670 from gildegoma/dry-check-ssh-perms
Check SSH key permissions in machine.ssh_info
2014-10-23 09:14:31 -07:00
Mitchell Hashimoto
cff57c8d01 core: trigger machine_id_changed for reload [GH-3963] 2014-10-22 12:07:49 -07:00
Gilles Cornu
89a4a29d65 Memoize machine.ssh_info when ready for connection 2014-10-20 17:45:02 +02:00
Gilles Cornu
4e81be879c Check SSH key permissions in machine.ssh_info
With this change, any caller of machine.ssh_info is assured that best
efforts will be done to fix possible wrong permissions on the private
key files.

Fix #4652
2014-10-20 17:33:06 +02:00
Mitchell Hashimoto
083dce5c61 Revert "core: guard against SSH to localhost:22 [GH-4070]"
This reverts commit 62561f28448bc848fe4572a1849adea4488b0a17.

This broke WinRM. Will fix in a future version.
2014-08-30 22:55:13 -07:00
Veres Lajos
4ef996dca9 typofixes - https://github.com/vlajos/misspell_fixer 2014-08-25 20:12:25 +01:00
Mitchell Hashimoto
62561f2844 core: guard against SSH to localhost:22 [GH-4070] 2014-08-08 11:58:53 -07:00
Mitchell Hashimoto
7f5f720e0a core: Machine#reload 2014-08-06 16:46:31 -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
5d94ab9e60 core: if state ID is NOT_CREATED_ID, destroy machine state 2014-05-05 21:44:34 -07:00
Mitchell Hashimoto
da69bd60a4 Fix some tests 2014-04-23 06:22:58 -07:00
Mitchell Hashimoto
2660252ede core: Store the actual box data, not just the name 2014-04-22 16:46:11 -07:00
Mitchell Hashimoto
519c8af971 core: MachineIndex stores the box associated with a machine when ID is set 2014-04-22 15:26:56 -07:00
Mitchell Hashimoto
862414af12 core: lock around machine actions 2014-04-21 13:56:09 -07:00