34 Commits

Author SHA1 Message Date
Chris Roberts
e958c6183a Adds initial HCP config support
Adds initial basic support for HCP based configuration in vagrant-go.
The initalization process has been updated to remove Vagrantfile parsing
from the client, moving it to the runner using init jobs for the basis
and the project (if there is one). Detection is done on the file based
on extension for Ruby based parsing or HCP based parsing.

Current HCP parsing is extremely simple and currently just a base to
build off. Config components will be able to implement an `Init`
function to handle receiving configuration data from a non-native source
file. This will be extended to include a default approach for injecting
defined data in the future.

Some cleanup was done in the state around validations. Some logging
adjustments were applied on the Ruby side for better behavior
consistency.

VirtualBox provider now caches locale detection to prevent multiple
checks every time the driver is initialized.
2023-09-07 17:26:10 -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
6d88f3a54f Fix up some of the testing 2023-06-05 14:18:53 -07:00
sophia
7441927f06 Set not created machine state when appropriate 2022-07-25 15:16:40 -05:00
Chris Roberts
e78d0b6681 Close project in test to force full target removal 2022-07-08 16:38:02 -07:00
sophia
8859e2e03b Add test communicator plugin to guest detection test 2022-06-29 17:23:43 -05:00
Chris Roberts
1e2cf39faa Update target creation to force fatal on error 2022-06-27 18:12:46 -07:00
Chris Roberts
aca9eb8a25 Move test helper functions to isolated file 2022-06-27 18:11:31 -07:00
Chris Roberts
6f7e17a8b3 Update how configuration is set in tests 2022-06-27 11:22:51 -07:00
Paul Hinze
4d79c95177
Update tests and address one thing caught by them
Namely, the specified synced folder type should override the default type
2022-05-25 17:56:40 -05:00
Paul Hinze
88957f71fb
tests: Add assertion to address review comment 2022-05-25 13:42:28 -05:00
Paul Hinze
625806f448
Don't delete machine datadir when SetId("") is called
Legacy's `Machine#id=()` has an important side effect when a nil ID is
specified - it clears the contents of the machine's DataDir.

We mirrored this behavior over to gogo, with a subtle difference - we
deleted the whole DataDir vs just its children.

It turns out the Docker provider relies on the DataDir being
cleared-but-not-removed by doing a SetId dance in its InitState action.
(see 1e6259dd00d702f83048c75c5c229ce6494c4c6e).

So here we need to mirror that behavior in order for the Docker provider
to work properly.
2022-05-25 13:41:48 -05:00
sophia
07e3f7e804 Fix machine state tests 2022-05-04 09:45:51 -05:00
sophia
692dcb1b92 Allow testing plugins to have parent plugins 2022-05-02 16:50:01 -05:00
sophia
85ea3c3d1f Update machine tests 2022-05-02 15:36:47 -05:00
Chris Roberts
7e68e25994
Seed target and machine into plugins directly 2022-04-25 12:26:58 -05:00
sophia
ba0bb1d9c6
Add machine tests for boxes 2022-04-25 12:26:45 -05:00
Paul Hinze
4b0acfb513
Fix unit tests
The type needs a string pointer now. We may end up wanting a string
pointer making convenience method in the SDK at some point, but for now
I punted on that question and just made one for the test.
2022-04-25 12:26:44 -05:00
sophia
0731b5486a
Add tests for basis 2022-04-25 12:26:42 -05:00
sophia
7f0adfce78
Add tests for synced folders 2022-04-25 12:26:42 -05:00
sophia
13283a0a71
Add tests for setting machine state 2022-04-25 12:26:41 -05:00
sophia
6abbb5e8eb
Check for plugin name correctness 2022-04-25 12:26:41 -05:00
sophia
b33f1a9e01
Test guest plugin with parent 2022-04-25 12:26:41 -05:00
sophia
df0fb642b0
Add ability to get plugin with a particular instance 2022-04-25 12:26:41 -05:00
sophia
06cfbb79bf
Add more tests for guest detection 2022-04-25 12:26:41 -05:00
sophia
16e415f929
AUse test table to test for multiple configs 2022-04-25 12:26:41 -05:00
sophia
4068760588
Make test for getting guest from machine work 2022-04-25 12:26:41 -05:00
sophia
8f95994a88
Create test dummy plugins 2022-04-25 12:26:41 -05:00
sophia
1117e06e38
Add testing plugin and plugin manager 2022-04-25 12:26:40 -05:00
sophia
83921cf3f9
Add minimal project for tests 2022-04-25 12:26:40 -05:00
sophia
fb642616a8
Add minimal Machine/Target setup 2022-04-25 12:26:40 -05:00
sophia
1cfbea7437
Testing guest detection 2022-04-25 12:26:40 -05:00
sophia
9ea254735a
Set target uuid opposed to resource id
The uuid is the public identifier vs the resource id which should
be for internal operations.
The target uuid should correspond to the machine id (given by
the provider)
2022-04-25 12:26:13 -05:00
sophia
63a4b76c21
Add tests for setting machine id 2022-04-25 12:26:13 -05:00