Commit Graph

26 Commits

Author SHA1 Message Date
Mitchell Hashimoto a9dfb6b3bd core: default provider chosen by usability and prority 2014-05-01 09:40:52 -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 2dff1ac417 core: get tests passing on Windows, more tweaks 2014-01-15 21:30:47 -08:00
Mitchell Hashimoto 008dd8e6e7 core: fix tests failing on WIndows dueo to bad temp dir gen 2014-01-15 11:09:00 -08:00
Mitchell Hashimoto 37e9553bf5 core: don't use Tempdir for tests, use Dir.mktmpdir
Tempdir didn't work on Windows, just spun forever.
2014-01-15 10:48:19 -08:00
Mitchell Hashimoto 9cf0387e00 core: interrupt in Cli exits with 1 2014-01-13 21:42:40 -08:00
Mitchell Hashimoto 8bc36824bf commands/list-commands: lists all commands primary and non-primary 2014-01-11 09:32:13 -08:00
Mitchell Hashimoto 38fbbb6c56 synced_folders/rsync: Initial commit working 2014-01-10 17:40:29 -08:00
Mitchell Hashimoto c1d56da1ca core: get tests passing for changes 2014-01-07 16:29:05 -08:00
Mitchell Hashimoto 1f760b2c48 core: pass extra args to detect? when detecting capability host 2014-01-07 16:26:58 -08:00
Mitchell Hashimoto c04fa5e54e core: clean up tests for synced folder built-ins 2013-12-03 18:30:59 -08:00
Paul Hinze c25172d0f7 providers/virtualbox: support DHCP interfaces for NFS
Previously, we required a host-only interface with a static IP for NFS
to work in VirtualBox, because we needed access to the guest's IP in
order to properly configure mount commands.

After boot, VirtualBox exposes the IP addresses of a guest's network
adapters via the "guestproperty" interface.

This adds support for reading VirtualBox guest properties to the
VirtualBox driver and utilizes that support to prepare NFS settings,
which removes the necessity for a static IP for NFS to work.

In this commit we also start building out scaffolding for unit testing
vbox actions and drivers.

Test plan:
 - Prepare a Vagrantfile with the following:
   * private network with type: :dhcp
   * synced folder with nfs: true
 - Boot a VM from this Vagrantfile using the virtualbox provider
 - Machine should boot successfully with working synced folder
2013-12-03 10:21:28 -05:00
Paul Hinze 4daa21e0b1 guests/debian: remove empty test file added by mistake 2013-12-01 09:49:31 -05:00
phinze 688bca14f5 refactoring ubuntu/debian change_host_name
there's been a lot of churn around this code, so i figure it was worth
trying to clean it up.

 - the methods were doing a lot, so make them into template methods with
   one helper per step
 - spread out /etc/hosts regexp into a couple of helper variables for
   clarity
 - remove handling for broken hostname implementations (like basing all
   of the checks on name.split('.')[0]), since it seems reasonable to
   remove code dedicated only to handling broken boxes
 - DRY up the shared code between debian/ubuntu implementations, which
   clarifies the differences as well
 - add unit tests around the behavior; this will help us in the future
   to separate flaws in our understanding from flaws in implementation
 - includes a new DummyCommunicator in tests which should be useful in
   supporting additional unit testing of this kind
 - manually tested this on squeeze, wheezy, precise, quantal, raring,
   and saucy successfully.

handles the issue in #2333
2013-11-24 11:46:12 -06:00
Mitchell Hashimoto 253b433864 Support configuring the version for test plugins. 2012-11-06 21:32:26 -08:00
Mitchell Hashimoto 02e499da47 Update tests to create V2 plugins 2012-11-06 21:19:27 -08:00
Mitchell Hashimoto c803b0508a Much cleaner plugin part querying syntax.
Before we were manually going over every plugin and getting each piece,
all over the place. Now we have a central manager that will give us all
the pieces we want. There is still some cleanup to do here but this is
much better overall.
2012-11-03 21:25:28 -07:00
Mitchell Hashimoto f9752d78d8 Properly resolve and load the guest class impl for Machines 2012-08-12 18:35:19 -07:00
Mitchell Hashimoto 42826356ad Basic "Box2" implementation.
This is the beginning of the new box internals. The basic idea is that
the new box has a new field: provider. The provider will describe what
provider that box was built with and what provider it is made to work
with.
2012-07-11 18:36:20 -07:00
Mitchell Hashimoto 194cd2145d Fix some nondeterminism in tests with GCing tempfiles.
Before, the tempfile "f" could be GC'd before the path was used,
resulting in failed tests because when it is GC'd the tempfile is
removed. We now store the tempfile in an instance variable so that it
isn't even available for GC until after the test is finished running.
2012-06-26 15:06:04 -07:00
Mitchell Hashimoto 37c54c7b20 Use a temporary directory for the VAGRANT_CWD when running tests
Tests before were picking up a Vagrantfile in the Vagrant source
directory, which can cause some funny failures. This ensures that each
test run will actually establish a new temporary CWD so that a
Vagrantfile is hopefully never found.
2012-06-23 23:56:39 -07:00
Mitchell Hashimoto c2e3a3050a Ruby 1.8.7 compatibility 2011-12-17 20:22:46 -08:00
Mitchell Hashimoto 42a5e02db4 Clean up test load paths 2011-12-11 15:53:11 -08:00
Mitchell Hashimoto aeb6533607 Fix issue with Tempfile in test being deleted 2011-12-09 17:26:06 -08:00
Mitchell Hashimoto 99982fb26e VM-specific configuration now works. 2011-12-03 19:05:50 -08:00
Mitchell Hashimoto 1a8c4199b2 Introduce Config::Loader
Config::Loader will be the new class responsible for loading configuration
and replaces the previous dual-role "Vagrant::Config" played. While this
commit is very early-stage, once this new architecture is flushed out, it
will make loading, using, and extending configuration much easier and cleaner.

Additionally, I believe this will help post Vagrant 1.0 if multi-language
configuration is implemented.
2011-12-03 17:12:48 -08:00