65 Commits

Author SHA1 Message Date
Chris Roberts
c8a7989b88 Adjust internal layout to allow downgrading
With the initial layout of `provider/architecture`, after installing a
box with architecture support downgrading Vagrant would result in it
being unable to process the box collection. Swapping the layout to be
`architecture/provider` allows downgrades to still properly process the
box collection.
2023-09-25 15:09:29 -07:00
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
d53d8e61bc Fix LANG value used for VirtualBox driver
The VirtualBox driver sets the LANG env var to prevent localized output
being returned when executing CLI commands. If the `locale` command is
present, do a best effort lookup to determine the properly value to use
for the LANG environment variable.
2023-05-15 11:01:29 -07:00
Chris Roberts
e9cae1a2f2 Allow stub_env to remove environment variable value 2020-11-06 08:01:16 -08:00
sophia
bc898e385d Update tests for synced folder typed hash 2020-08-19 15:00:40 -05: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
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
d5fa7416ff core: more heuristics for determining Cygwin 2015-11-21 11:17:36 -08:00
Mitchell Hashimoto
edcaafacb1 not sure how this happens but travis told us so 2015-11-20 15:29:28 -08:00
Mitchell Hashimoto
684410836c use temporary files to avoid permission errors on Windows 2015-11-20 15:18:41 -08:00
Mitchell Hashimoto
fafd8b8986 more passing tests on Windows 2015-11-20 15:09:17 -08:00
Seth Vargo
c1623ee740 Fix port collision in tests 2015-11-18 18:47:19 -08:00
Gilles Cornu
faeb8a9440 core: plugin management requires bundler
With this change, the `Vagrant::plugins_enabled?` is now false when the
embedded Bundler is not available.

Resolve the broken RSpec unit tests after
479323f1e849b7a8cc570c703566a607a4c6353c.
2015-07-10 13:37:33 +02:00
Seth Vargo
f06703cdb1 Stub ATLAS_TOKEN in tests
Without this stub, the tests will fail if ATLAS_TOKEN is set locally 
when running the tests.
2014-12-14 23:28:14 -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
Kalman Hazins
bb052366f7 Change symbols inside hashes to 1.9 JSON-like syntax 2014-05-22 12:35:12 -04:00
Mitchell Hashimoto
45fc89877c core: MachineIndex valid test is better 2014-05-05 21:50:51 -07:00
Mitchell Hashimoto
a9dfb6b3bd core: default provider chosen by usability and prority 2014-05-01 09:40:52 -07:00
Mitchell Hashimoto
600d01d792 Merge pull request #3102 from sax/smartos
guests/smartos
2014-03-20 17:50:20 -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
Eric Saxby
edb4efa10a Dummy communicator runs :test correctly 2014-03-10 18:51:47 -07:00
Mitchell Hashimoto
7a6d1a3ff1 commands/box: update command can update a specific box now 2014-02-05 21:20:23 -08:00
Mitchell Hashimoto
e111b7a691 core: environment tests pass 2014-02-05 21:19:12 -08:00
Mitchell Hashimoto
77b5fa94b7 core: BoxCollection#all returns versions 2014-02-05 21:19:06 -08:00
Mitchell Hashimoto
2dff1ac417 core: get tests passing on Windows, more tweaks 2014-01-15 21:30:47 -08:00
Mitchell Hashimoto
0fcce91d69 core: fix more cases where ".path" was being called on strings 2014-01-15 11:10:38 -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
dea881cad2 vagrant box add --force works again [GH-1413] 2013-03-13 21:20:25 -07:00
Mitchell Hashimoto
64af19c783 Remove archive::tar::minitar from tests 2013-01-28 13:28:40 -08:00
Mitchell Hashimoto
a6e0d3908f Create a "dummy" provider for tests 2012-12-23 16:29:24 -08: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
cc076e5ee5 Box#repackage to repackage a box. 2012-07-11 18:36:22 -07:00
Mitchell Hashimoto
1d197d84c3 BoxCollection#add transparently upgrades V1 boxes to V2
This means that V1 boxes can be added to a V2 box collection without
issue.
2012-07-11 18:36:22 -07:00
Mitchell Hashimoto
da15105a8f Make Box2 the new Box
This involved defaulting all box searching at the moment to VirtualBox.
Additionally, box upgrading is not yet handled. This needs to be done at
some point.
2012-07-11 18:36:21 -07:00
Mitchell Hashimoto
9cb0015b6e Test that an added box provider must match expected. 2012-07-11 18:36:21 -07:00
Mitchell Hashimoto
c2151681ec Box collection can add a new box. This is the happy path only. 2012-07-11 18:36:21 -07:00