Commit Graph

54 Commits

Author SHA1 Message Date
Chris Roberts ddfd86f3d1 Split with shellwords and quote paths in command filter
This uses shellwords to split the command in the command filter
inside the winrm communicator. Using shellwords properly handles
things like quoted paths. Path arguments are also quoted to
prevent issues with paths that include spaces.

Fixes #9390
2018-04-09 17:00:30 -07:00
Josh Soref 1a5ddea9f4 Spelling fixes
* account
* addresses
* administrator
* afterwards
* because
* bridgeable
* capabilities
* capability
* checksum
* configuration
* configuration for
* configure
* criteria
* delimited
* delivered
* derivatives
* description
* detect
* directory
* display
* downloading
* during
* electric
* enabling
* encountered
* equivalent
* executable
* executed
* hashicorp
* hypervisor
* hyphens
* implementation
* incorporate
* inheritance
* initialize
* instance
* instead
* interactions
* invocable
* machine
* maximum
* message
* mounting
* overridden
* overwrite
* paramiko
* preparing
* provides
* provisioning
* recursively
* requested
* resetting
* retryable
* running
* satisfied
* searching
* sometimes
* specified
* successfully
* synced folders
* unauthorized
* underlying
* userprofile
* vagrant
* vagrantfile
* variable
* various
* version
* virtual
* windows
2018-03-14 14:41:04 +00:00
Brian Cain 337b200d30 Update rspec tests to remove deprecation warnings 2017-10-24 12:08:38 -07:00
Bryce Shurts 927f653437 Adding tests for winrm_info_invalid 2017-10-05 10:28:25 -05:00
Bryce Shurts 0eaf691ea0 Adding check for APIPA in winrm helper to fix #8996 2017-09-25 16:31:37 -05:00
Brian Cain a9564b2137 (#8933) Align file provisioner functionality on all platforms
This commit aligns how the file provisioner should work on all host
machines. It ensures that a `/.` is only applied if the user intended
to upload a folder to a destination under a different name. It ensures
that if uploading to a windows guest with a different destination folder
name, it does not nest the source folder under that name so that it
works the same as it does on linux platforms. It also updates the
behavior of the winrm upload communicator by allowing an array of paths
to be uploaded instead of a single file or folder to allow for this new
functionality for windows guests.
2017-08-31 15:57:53 -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
Chris Roberts 78e8e17869 Cast host value to string prior to empty? check.
Force string type prior to empty? check to prevent errors if
host ip value is nil. Add coverage for proper handling of nil
value.
2017-03-06 09:14:04 -08:00
Chris Roberts 6631fbdb9b Merge pull request #8073 from bshurts/fix/issue-7983
HyperV inaccurate winrm address - issue-7983
2017-03-06 09:11:34 -08:00
Matt Wrock 725824e1dd refactor winrm communicator to use latest winrm gems and v2 api
Signed-off-by: Matt Wrock <matt@mattwrock.com>
2016-12-11 00:52:00 -08:00
Bryce Shurts e4626d088d issue-7983 - Helper now throws WinRMNotReady exception is host ip is reported as an empty string 2016-12-01 13:03:38 -06:00
Chris Roberts f72cd286c1 Merge pull request #7831 from mwrock/nano
Use the cmd shell to check winrm availability to fix `vagrant up --no-provision` on nano
2016-09-30 16:16:42 -07:00
Matt Wrock c5e1a6d8c0 use the cmd shell to check winrm availability 2016-09-26 14:07:11 -07:00
Matt Wrock 64828f1ed3 fix #7489 preventing winrm connection leakage 2016-08-13 07:49:08 -07:00
Matt Wrock f912a81362 powershell and cmd calls should use commnand_executor to reuse oprn winrm shell 2016-01-27 11:59:10 -08:00
Matt Wrock 7ef4ae9e10 use NTLM/Negotiate authentication over basic authentication 2016-01-27 11:57:41 -08:00
Mitchell Hashimoto 0e32612324 fix more tests 2015-11-18 17:13:47 -08:00
Mitchell Hashimoto c76e45a75a fix some tests 2015-11-18 17:11:05 -08:00
Mitchell Hashimoto da116bffec fix syntax error 2015-11-18 15:57:58 -08:00
Mitchell Hashimoto d657804f18 Merge branch 'master' of https://github.com/matthewcodes/vagrant into matthewcodes-master 2015-11-18 15:09:47 -08:00
Seng Lin Shee f1647ddea6 Fixed unit test.
Command is now wrapped in more PowerShell scripts, changing its final encoded value.
2015-11-18 13:53:17 -08:00
Mitchell Hashimoto d3bcc4e5f9 Merge pull request #6213 from jrob/winrm-execution-timeout
Winrm execution timeout
2015-11-18 13:00:59 -08:00
matthewcodes cbb03a02d4 Updating tests to check for single quote 2015-10-28 16:46:43 +00:00
Dan Dunckel 9d87be51da Small refactor on conditional check and add tests 2015-10-15 12:25:50 -07:00
Paul Hinze 1e84cc4d6a communicators/winrm: respect boot_timeout when fetching winrm_info
We gained a ton of improvemnts to WinRM error handling in
https://github.com/mitchellh/vagrant/pull/4943, but we also got one bug.

The new code raises an exception when `winrm_info` does not return right
away. This was preventing us from catching the retry/timout logic that's
meant to wait until boot_timeout for the WinRM communicator to be ready.

This restores the proper behavior by rescuing the WinRMNotReady
exception and continuing to retry until the surrounding timeout fires.
2015-09-02 16:36:23 -05:00
Jeremy Roberts 44154c92a9 Fixing WinRM communicator unit test. 2015-08-31 11:42:34 -04:00
Shawn Neal d2671faa56 Fix WinRM elevated shell test
Username, password, and encoded command are now passed via PowerShell arguments which the test needs to account for.
2015-06-10 16:17:30 -07:00
Max Lincoln 39882957ee Add retry_delay setting to speed up test 2015-01-28 13:41:07 -05:00
Max Lincoln 5d5e13bc0f Change authorization error tests to match WinRM 1.3 2015-01-28 13:41:07 -05:00
Max Lincoln edc867986b Merge branch 'master' into winrm_error_handling 2015-01-20 16:07:00 -05:00
Shawn Neal f7a344fe95 Added test to ensure comm test method checks stderr 2014-12-16 09:20:51 -08:00
Max Lincoln e7e50d39d9 Fix tests - all pass but auth retry test is extremely slow 2014-12-11 13:23:40 -05:00
Max Lincoln 2caaf82ae0 Change default transport back to :plaintext, for backwards compatibility 2014-12-11 13:21:58 -05:00
Max Lincoln 072bb26a30 Change @ssl to @transport 2014-12-11 13:21:58 -05:00
Max Lincoln b3480049ad DRY the Shell: Don't duplicate the Config, especially since there were differing default values 2014-12-11 13:21:58 -05:00
Max Lincoln 1beb221bf3 Rename no_ssl_peer_verification to ssl_peer_verification, and make it configurable 2014-12-11 13:21:58 -05:00
Max Lincoln 2b9626f19c Use Winrm 1.2.0 and fix tests 2014-12-11 13:21:58 -05:00
Mitchell Hashimoto 94841ef1bc Merge pull request #4094 from mitchellh/improved-winrm-command-failure-messaging
provisioners/winrm: Better WinRM command failure messaging
2014-08-06 10:44:35 -07:00
Richard Guin 08732f5a39 Added/updated unit tests for WinRM mkdir/rm command filters 2014-07-31 14:42:11 -04:00
Shawn Neal c72a412600 Better WinRM command failure messaging
Command failures include the stdout and stderr in the error message just like the SSH communicator.
Its now possible to specify only an error_class and have that use the correct error_key by default.
2014-06-24 10:09:11 -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 d7fa60b5df communicators/winrm: use winrm_info cap if available [GH-3832] 2014-05-20 20:13:36 -07:00
Shawn Neal 0d3979f80d Fixed issue 3816
Elevated command line is now rendered to a script which is uploaded to the guest and executed. This allows the command line itself to be less than 100 chars to start the script and any user commands are puts into the script which has unlimited* length.
2014-05-19 08:04:59 -07:00
Shawn Neal f18a397289 Allow WinRM commands to be run elevated via scheduled task 2014-04-26 21:07:26 -07:00
Shawn Neal 4a2a147926 Refactored WinRM test command filter 2014-04-23 21:15:05 -07:00
Shawn Neal 1525aa0f78 Added WinRM grep command filter
This is needed because isn't available on Windows and Vagrant guest detection attempts to use grep for some OSs.
2014-04-23 20:37:15 -07:00
Shawn Neal 3efb4b1def Allow WinRM shell test less restrictive
This will allow the shell class to append additional commands like exit $EXITCODE
2014-04-23 18:05:53 -07:00
Shawn Neal 96ab8f60c5 Added WinRM command filters
These will be used to replace the guest side command_alias script that is sent with every communicator execute call. This avoids some uncessary remote calls to the guest, makes it unit testable, and allows larger PowerShell commands to be invoked.
2014-04-23 17:50:20 -07:00
Shawn Neal fdb6461af4 Fixed Windows tests to use modern Ruby hash style 2014-04-23 16:16:08 -07:00