Commit Graph

812 Commits

Author SHA1 Message Date
Mitchell Hashimoto d6b7f3a855 Fix tests 2014-04-29 17:02:10 -07:00
Mitchell Hashimoto c818a14072 providers/docker: expose ports 2014-04-27 18:37:25 -07:00
Mitchell Hashimoto ac040102f9 Merge pull request #3544 from benesch/rsync-conservative-chown
synced_folders/rsync: only chown when necessary
2014-04-27 15:59:40 -07:00
Mitchell Hashimoto 8c8099aebc Merge pull request #3551 from benesch/3550
core: return {} if cached synced folders file missing [GH-3550]
2014-04-27 15:55:25 -07:00
Shawn Neal cf71634813 DRY'd up Chef command building
There's very little difference between the command building on Linux and Windows other than path formatting. All Chef provisioners support the --no-color argument now.

Added unit tests to verify changes.
2014-04-26 21:07:26 -07:00
Shawn Neal ebca0e7e44 Fixed bug in CommandBuilderWindows
CommandBuilderWindows would not include the Chef binary in the command when the binary_path was specified in the config.

Backfilled unit tests for CommandBuilderWindows
2014-04-26 21:07:26 -07:00
Shawn Neal f18a397289 Allow WinRM commands to be run elevated via scheduled task 2014-04-26 21:07:26 -07:00
Nikhil Benesch 54e580149a core: return {} if cached synced folders file missing [GH-3550]
A missing synced folders cache indicates an empty cache, not a failure
that should be handled by the caller. The cache file is missing from
data dirs created by an earlier version of Vagrant.

Fixes #3550.
2014-04-26 15:39:25 -04:00
Gilles Cornu de6ad1d5d3 provisioners/ansible: fix unit tests for [GH-3491] 2014-04-26 14:08:10 +02:00
jjshoe 7ef8477e43 provisioners/ansible: Don't run with two --limits
Conflicts:
	test/unit/plugins/provisioners/ansible/provisioner_test.rb
2014-04-26 11:55:59 +02:00
Gilles Cornu 557a451e2f provisioners/ansible: fix an error in a unit test 2014-04-25 22:11:13 +02:00
Gilles Cornu 4465eba753 provisioners/ansible: minor change in unit tests
Combine a maximum of options in the last test:
- Ansible Vault options from [GH-3338]
- raw_arguments

Note: it is not expected from Vagrant to reject incoherent combinations
2014-04-25 21:59:39 +02:00
Nikhil Benesch 2df36892dd synced_folders/rsync: only chown when necessary [GH-3525]
Run remote rsync as root to guarantee that rsync can write to guestpath.
This obviates the need to chown the guestpath to the SSH user prior to
sync.

This brings a substantial speedup (2x on a moderately-sized shared
folder) and properly triggers filesystem notifications on only the files
changed by a given sync.
2014-04-25 15:00:12 -04:00
Mitchell Hashimoto 1a08c4def5 core: Box#in_use? as an API 2014-04-25 02:02:49 -07:00
Mitchell Hashimoto 4fb9832589 core: clean up the lock cleanup code, tests 2014-04-25 01:33:25 -07:00
Mitchell Hashimoto de6759f94d Merge pull request #3538 from mitchellh/f-box-usage
Track box usage (local) to know if envs are using boxes
2014-04-24 10:42:02 -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
Shawn Neal 59c140ab82 Fixed Windows test code style to use more elegant tap method 2014-04-23 16:12:27 -07:00
Mitchell Hashimoto da69bd60a4 Fix some tests 2014-04-23 06:22:58 -07:00
Mitchell Hashimoto 5da77dee5c commands/box/remove: add --force flag 2014-04-23 06:16:51 -07:00
Mitchell Hashimoto 85f4a4d5ee commands/box/remove: if box is in use, warn user, ask for confirmation 2014-04-23 06:13:16 -07:00
Mitchell Hashimoto e985308e9a core: MachineIndex::Entry#valid? method and tests 2014-04-22 17:09:44 -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
Shawn Neal dbe73e842f Added guest network tests for Windows guests 2014-04-22 14:03:07 -07:00
Shawn Neal 929e41aa5c Backfilled unit tests for Windows guest support
- Fixed typo in helper test
- Removed extraneous machine.config prefix from Windows guest config validation
- Added WinRM communicator unit tests
- Added Windows guest capability unit tests
2014-04-22 11:03:37 -07:00
Mitchell Hashimoto afd3f1ff43 synced_folders/nfs: can say functional is false explicitly 2014-04-21 20:37:14 -07:00
Mitchell Hashimoto 4372ab034e providers/virtualbox: merge customizations properly 2014-04-21 13:56:32 -07:00
Emilien Kenler 744e5b9b30 More tests 2014-04-21 13:56:17 -07:00
Emilien Kenler b77bd3e6bb Unit test + vault password file existence check 2014-04-21 13:56:16 -07:00
Mitchell Hashimoto 8171471628 providers/docker: make merge logic a bit more sensible 2014-04-21 13:56:13 -07:00
Mitchell Hashimoto 862414af12 core: lock around machine actions 2014-04-21 13:56:09 -07:00
Mitchell Hashimoto 8a76c2bc76 providers/docker: can force a host VM optionally 2014-04-21 13:56:08 -07:00
Mitchell Hashimoto 79793ab130 providers/docker: config validation and specs 2014-04-21 13:56:07 -07:00
Mitchell Hashimoto d2e2ccb625 core: A function for diffing synced folders 2014-04-21 13:55:56 -07:00
Mitchell Hashimoto 81df70eee0 providers/docker: support building Dockerfiles 2014-04-21 13:55:54 -07:00
Mitchell Hashimoto 61388186e9 providers/docker: can set custom container name 2014-04-21 13:55:51 -07:00
Mitchell Hashimoto 58ddc66b9c providers/docker: can specify links 2014-04-21 13:55:50 -07:00
Mitchell Hashimoto 71d615212d providers/docker: can set environmental variables 2014-04-21 13:55:49 -07:00
Mitchell Hashimoto 704ff98200 providers/docker: only sync folders if they're not already there 2014-04-21 13:55:26 -07:00
Mitchell Hashimoto 6883109d27 Fix tests 2014-04-21 13:55:25 -07:00
Mitchell Hashimoto cabacae4cb core: return nil if cached synced folders file doesn't exist 2014-04-21 13:55:24 -07:00
Mitchell Hashimoto 4557ece4df core: SyncedFolders middleware saves what it synced 2014-04-21 13:55:23 -07:00
Mitchell Hashimoto 794cd4f287 core: MixinSyncedFolders have methods for save/reading from cache 2014-04-21 13:55:22 -07:00
Mitchell Hashimoto ea864986fd core: Add more tests for what we recently added 2014-04-21 13:55:21 -07:00
Mitchell Hashimoto 3c9219b8c9 core: Builtin SyncedFolders accepts alternate config 2014-04-21 13:55:18 -07:00
Mitchell Hashimoto 0153e0ccbb core: Machine#action_raw for calling raw callables 2014-04-21 13:55:17 -07:00
Mitchell Hashimoto d8bdb62ed4 core: MixinSyncedFolders lets a custom config through 2014-04-21 13:55:15 -07:00
Mitchell Hashimoto 646f0fa907 core: MachineIndex preserves the local data path for an env 2014-04-21 13:55:02 -07:00
Mitchell Hashimoto e78d087c27 Tests passing 2014-04-21 13:54:59 -07:00
Mitchell Hashimoto aa1abdd1c4 core: SSHExec middleware can have ssh info overridden 2014-04-21 13:54:53 -07:00
Mitchell Hashimoto 2add94ee28 core: BatchAction can run arbitrary code 2014-04-21 13:54:46 -07:00
Mitchell Hashimoto 8c7ab333a0 Squash the f-docker-hostmachine branch.
Initial work

commands/up: make sure all names to with_target_vms are strings

providers/docker: create a docker host VM if needed

providers/docker: executor abstraction for driver to eventually support remote

providers/docker: vagrant executor

providers/docker: support creating the machine

providers/docker: status works if host VM is gone

providers/docker: use start fence to get real docker output

core: Call preserves stack ordering

core: support Message post option

providers/docker: Guard some features with HasSSH checks

providers/docker: much better messaging around create/destroy

providers/docker: output the container ID on create

providers/docker: copy the hostmachine Vagrantfile to the data dir

providers/docker: should make host machine before any up action

providers/docker: HandleBox before the host machine

providers/virtualbox: functional_vboxsf to disable vboxsf

providers/virtualbox: synced folder usable method should take 2 args

providers/docker: default machine name to :default
2014-04-21 13:54:33 -07:00
Mitchell Hashimoto 2b07dec059 core: Use the MachineIndex#vagrant_env method 2014-04-21 13:54:31 -07:00
Mitchell Hashimoto 09ff31e3a3 commands/global-status: add --prune flag 2014-04-21 13:54:29 -07:00
Mitchell Hashimoto 6bf1f51e5b core: add global-status tests 2014-04-21 13:54:26 -07:00
Mitchell Hashimoto 9b22ccbd32 core: MachineIndex updates existing entry if name, provider, path match 2014-04-21 13:54:25 -07:00
Mitchell Hashimoto d72c18a8b1 MachineIndexTest 2014-04-21 13:54:24 -07:00
Mitchell Hashimoto 0dc40e1680 core: MachineIndex can have extra data attached to it 2014-04-21 13:53:38 -07:00
Mitchell Hashimoto ba1676b232 providers/hyperv: fix tests and bug with usable? 2014-04-21 13:53:36 -07:00
Mitchell Hashimoto 1c29c39f1b core: generalize the autostart stuff so we don't have a bunch of specials 2014-04-21 13:53:35 -07:00
Mitchell Hashimoto 9dd9fff637 core: check if provider is usable when requesting a machine 2014-04-21 13:53:10 -07:00
Mitchell Hashimoto bc2e3727a9 core: Add usable? check to providers 2014-04-21 13:53:07 -07:00
Mitchell Hashimoto ab2cae2379 providers/docker: synced folder usable? raises error, tests
/cc @fgrehm
2014-04-21 13:53:05 -07:00
Mitchell Hashimoto 2e13feb130 providers/docker: Clean up config and make a spec 2014-04-21 13:53:04 -07:00
Mitchell Hashimoto 61ffa53134 kernel/v2: boxes can be optional if a provider says so
/cc @fgrehm - For the DOcker provider, we can now make boxes optional. :)
No more dummy boxes!
2014-04-21 13:53:03 -07:00
Mitchell Hashimoto e52556b5f5 tests passing 2014-04-21 13:53:00 -07:00
Mitchell Hashimoto aad8e7f80d core: provision "once" or "always" [GH-2421] 2014-04-21 13:52:30 -07:00
Mitchell Hashimoto f6fb9016a1 core: can specify a "post_up_message" [GH-1968] 2014-04-21 13:52:28 -07:00
Mitchell Hashimoto c4a4b998df core: Test eager loading of WinRM 2014-04-21 13:51:51 -07:00
Fabio Rehm e5375715ef providers/docker: Update driver to docker 0.9 2014-04-21 13:51:45 -07:00
Fabio Rehm 5a60e568ce providers/docker: Import code from https://github.com/fgrehm/docker-provider with some initial tweaks 2014-04-21 13:51:31 -07:00
Fabio Rehm efc1122c42 provisioners/docker: Change to VagrantPlugins::DockerProvisioner namespace 2014-04-21 13:51:30 -07:00
Mitchell Hashimoto a0e9f46251 core: commands can use the IDs from anywhere to control 2014-04-21 13:51:24 -07:00
Mitchell Hashimoto 48cf2c38f7 core: MachineIndex is enumerable 2014-04-21 13:51:21 -07:00
Mitchell Hashimoto 13a4db391a core: Machine updates state cache when querying state 2014-04-21 13:51:20 -07:00
Mitchell Hashimoto 44e379e961 core: Machine sets index entries on ID sets 2014-04-21 13:51:19 -07:00
Mitchell Hashimoto 8a6bdbf710 core: Environment#machine_index 2014-04-21 13:51:17 -07:00
Mitchell Hashimoto a29f5d7e01 core: Add MachineIndex#delete 2014-04-21 13:51:16 -07:00
Mitchell Hashimoto ac032db6a6 core: MachineIndex has precision locking for entries 2014-04-21 13:51:14 -07:00
Mitchell Hashimoto 016afc7922 core: Basic MachineIndex class, starting point 2014-04-21 13:51:13 -07:00
Mitchell Hashimoto 21ac0810fd communicators/winrm: more tests 2014-04-21 13:51:04 -07:00
Mitchell Hashimoto f07ee5754a core: Configurable communicator 2014-04-21 13:51:02 -07:00
Mitchell Hashimoto 40d89cf5ea kernel/v2: configurable communicator (doesn't do anything yet) 2014-04-21 13:51:01 -07:00
Mitchell Hashimoto eebebd8837 communicators/winrm: Config unit tests (a little) 2014-04-21 13:50:59 -07:00
Ramon de la Fuente f6a5e20688 Add autostart as an option for vagrant boxes
Added specs for the environment and vagrantfile. Added a methd to retrieve
autostart_machine_names. Changed the plugin up/command to use autostart_machine_names
when no argument was given to the command.
2014-04-21 13:50:57 -07:00
Kenny Rasschaert fc95e77237 provisioners/salt: error if minion_config missing 2014-04-19 23:24:30 +02:00
Mitchell Hashimoto 20473fe4ca core: allow overriding default SSH port [GH-3474] 2014-04-15 10:37:08 -07:00
Mitchell Hashimoto e7e9bcd360 Fix tests 2014-04-12 18:04:17 -07:00
Gilles Cornu 7ed17ae9ed provisioners/ansible: use strict boolean options
With this change, the ansible provisioner fully complies with
the current user documentation.
2014-04-12 13:48:15 +02:00
Gilles Cornu ad038890bb provisioners/ansible: update specs after [GH-3436] 2014-04-12 10:53:02 +02:00
Gilles Cornu baf0649dcf provisioners/ansible: add more unit tests
Remove wrong usage of shared examples and introduce embedded class methods
(as kind of simple "RSpec macros") to reduce code duplication.
2014-04-12 10:53:01 +02:00
Gilles Cornu e32783312b provisioners/ansible: improve unit tests (wip)
- Don't mock the config object, but use a true instance
- When possible, take advantage of Rpsec before/after hooks to
  reduce code repetitions
- Add an example ("with inventory_path option")
- Use a global variable to store the path of the generated inventory
- Miscellaneous changes in existing examples (style, fixes)
2014-04-12 08:18:35 +02:00
Gilles Cornu f0a596b47c provisioners/ansible: add first unit tests 2014-04-12 08:18:34 +02:00
Mitchell Hashimoto 2cb6a21a5a core: Fix tests, which found broken logic in synced folders 2014-04-11 16:28:38 -07:00
Mitchell Hashimoto 3aad85fa30 style 2014-04-11 09:56:35 -07:00
Mitchell Hashimoto 794ca7a4df Tests passing again 2014-04-09 10:57:00 -07:00
Mitchell Hashimoto 800cf7539b synced_folders/rsync: don't crash if comm error during rsync-auto [GH-3419] 2014-04-09 08:58:56 -07:00
Mitchell Hashimoto 5f12126d32 core: network issues don't halt Vagrant during box update check [GH-3391] 2014-04-05 09:25:03 -07:00
Mitchell Hashimoto 0e46c5d9de core: Raise predictable error if box metadata downlaod fails 2014-04-05 09:20:03 -07:00
Mitchell Hashimoto 5b360d0990 core: BoxCollection#find version constraint can benil 2014-04-02 19:50:44 -07:00
Mitchell Hashimoto d1caf8c624 core: Allow direct box adding again 2014-04-02 19:45:49 -07:00
Mitchell Hashimoto 32d86ca42b core: don't allow version for old-style box [GH-3260] 2014-04-02 09:32:34 -07:00
Mitchell Hashimoto af7a589231 core: outdated check checks local boxes [GH-3321] 2014-04-02 08:37:03 -07:00
Mitchell Hashimoto 36ad327ec1 core: ignore if box doesn't exist on update check [GH-3326] 2014-04-02 08:24:38 -07:00
Mitchell Hashimoto 097dd2917c core: better error when adding box with malformed version [GH-3332] 2014-04-01 22:48:52 -07:00
Mitchell Hashimoto 8195f7faab core: add test for removing box version [GH-3364]
/cc @berendt - Added a test
2014-04-01 21:47:51 -07:00
Mitchell Hashimoto 600d01d792 Merge pull request #3102 from sax/smartos
guests/smartos
2014-03-20 17:50:20 -07:00
Paulo Bittencourt 1f694d4978 kernel/v2: allow provisioner plugins to register without config 2014-03-19 17:37:52 -04:00
Mitchell Hashimoto 846f942ff0 core: check for data_dir [GH-3208] 2014-03-14 14:04:00 -07:00
Fabio Rehm 99547eef8f For some weird reason the changes introduced by transpec made this spec fail, this should fix it 2014-03-14 12:09:07 -03: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 012c28606f kernel/v2: validate forwarded ports [GH-3187] 2014-03-13 08:32:05 -07:00
Eric Saxby f36d372b32 Resolve confusion around SmartOS rsync_pre
rsync should *always* be pre-installed in SmartOS (global and local zones), as
it's part of the kernel. Previous commits incorrectly attributed #rsync_install
to running rsync, rather than to installing the rsync command.
2014-03-12 22:35:32 -07:00
Mitchell Hashimoto 8634cc309b core: error earlier if adding a path that doesn't exist 2014-03-12 20:33:12 -07:00
Mitchell Hashimoto 56dd0e8531 synced_folders/rsync: don't watch excluded paths [GH-3159] 2014-03-12 19:40:18 -07:00
Mitchell Hashimoto a6eafd6a12 synced_folders/rsync: execute rsync_post cap if it exists [GH-3163] 2014-03-12 18:43:59 -07:00
Mitchell Hashimoto 8624e2cbf2 Fix failing tests on Windows 2014-03-11 11:09:37 -07:00
Eric Saxby 31da3860e5 Add unit tests for smartos compatibility 2014-03-10 18:52:20 -07:00
Eric Saxby edb4efa10a Dummy communicator runs :test correctly 2014-03-10 18:51:47 -07:00
Mitchell Hashimoto ee23b87eb6 core: Private boxes authenticate metadata box URLs too 2014-03-09 19:24:54 -07:00
Mitchell Hashimoto 06c881708d Fix tests 2014-03-09 18:29:45 -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 d4511131b4 synced_folders/rsync: allow custom args [GH-3070] 2014-03-06 11:27:58 -08:00
Mitchell Hashimoto 4104f6c21f Fix Hyper-V tests 2014-03-06 09:04:23 -08:00
Mitchell Hashimoto 79df69392f core: initialize synced folder class only once [GH-3067] 2014-03-06 08:35:21 -08:00
Mitchell Hashimoto 35adc6063b providers/hyperv: add test for windows guests 2014-03-05 18:50:31 -08:00
Mitchell Hashimoto 7f2fe524b3 core: use default color by default (not white) 2014-03-05 10:19:53 -08:00
Mitchell Hashimoto 857b989c47 provisioners/docker: setting to not auto assign name 2014-03-04 07:31:13 -08:00
Mitchell Hashimoto 4437bcd77f core: better error if attempting to uninstall system plugin 2014-03-03 15:05:32 -08:00
Mitchell Hashimoto b5637da6c4 core: plugin manager marks system gems as system 2014-03-03 14:55:34 -08:00
Mitchell Hashimoto efddef0a80 core: add tests fornew systems path for plugin manager 2014-03-03 09:50:16 -08:00
Mitchell Hashimoto 7710fd16fa core: load system plugins if they are installed 2014-03-03 09:44:29 -08:00
Mitchell Hashimoto 616bf15df5 core: Vagrant.installer_embedded_dir 2014-03-03 09:37:22 -08:00
Mitchell Hashimoto 5018e4d8a4 core: checksums supported when adding box from metadata 2014-03-01 12:03:22 +01:00
Mitchell Hashimoto 23bd397cb8 core: BoxMetadata supports checksums 2014-03-01 11:59:16 +01:00
Mitchell Hashimoto ce350fe872 core: box checksums just work properly again for direct box adds 2014-03-01 11:54:37 +01:00
Mitchell Hashimoto 7926f7f051 core: box URLs can be authenticated by hooking 2014-03-01 11:38:04 +01:00
Mitchell Hashimoto c735e81e4d core: expand IsState to support inversions 2014-02-27 08:13:12 -08:00
Mitchell Hashimoto e93038fd0e providers/hyperv: suspend/resume 2014-02-27 08:13:11 -08:00
Mitchell Hashimoto 5d19285774 providers/hyperv: wait for IP on boot 2014-02-27 08:12:57 -08:00
Mitchell Hashimoto 7c0948c81d providers/hyperv: clean up status script 2014-02-27 08:12:55 -08:00
Mitchell Hashimoto fe93b0d2a5 providers/hyperv: more checks on machine import 2014-02-27 08:12:53 -08:00
Mitchell Hashimoto 784a5b2e32 providers/hyperv: all sorts of tests to verify Windows/admins 2014-02-27 08:12:51 -08:00
Mitchell Hashimoto a1958ee12f providers/hyperv: shuffle things around 2014-02-27 08:12:48 -08:00