44 Commits

Author SHA1 Message Date
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
Dan Čermák
73ee447c87 Stop using the last argument as kwargs in unit tests
A few unit tests started failing with Ruby 3.0, because they were relying on
keyword arguments being converted into hashes automatically. This behavior was
deprecated in Ruby 2.7 and results in errors in Ruby 3.0 onward.

For further details:
https://rubyreferences.github.io/rubychanges/3.0.html#keyword-arguments-are-now-fully-separated-from-positional-arguments
2022-07-28 14:45:47 -05:00
Paul Hinze
06ad1b4565
Fixup tests for Ruby 3.0
This is a pass through test failures and deprecation warnings:

 * Make all ambiguous `.with(..., key: val)` use explicit hashes to
   prevent test failures for argument mismatch in Ruby 3.0
 * Scope down all unbounded `raise_error` to address warnings (remove
   one test that was revealed to be referencing a nonexistent variable
   once the raise_error was scoped.)
 * Update all `any_instance` usage to new syntax to address warnings
 * Allow the service cache to be cleared and do so between some tests
 * Fix a small bug in with_plugin's plugin not found code path (revealed
   by a scoped and_raise)
2022-04-25 12:26:40 -05:00
Chris Roberts
3d0d0148e9 Update tests to use real UI instance
Replaces use of UI doubles within tests to use actual UI instance
    to ensure calls are passing parameters correctly.
2021-06-23 14:04:48 -07:00
Chris Roberts
e7a6f397da Updates for Ruby 3.0 2021-06-21 15:57:46 -07:00
cam
67fdc3855f HyperV - Adding ability to disable Enhanced session transport type 2020-08-06 16:04:21 -07:00
cam
f6875818dc Hyperv: moving session transport type config from string to boolean for enhanced mode aka HvSocker 2020-08-06 16:04:17 -07:00
cam
3dd7c89bf0 hyper-v: Hyper-V: add support for EnhancedSessionTransportType. Addresses #9823 2020-08-06 16:02:26 -07:00
Brian Cain
13c91d68a6
Only grab provider_config if provider key exists and config isn't empty 2020-06-30 14:23:34 -07:00
Brian Cain
4130cfe497
Properly check for disk paths when cleaning up disks in hyper-v 2020-06-30 14:23:34 -07:00
Brian Cain
f8dfcadb70
Only convert BlockSizeBytes option for Hyper-V disk provider_config 2020-06-30 14:23:34 -07:00
Brian Cain
56645b7bc5
Finish up configure_disk_test unit tests 2020-06-30 14:23:34 -07:00
Brian Cain
99d244c4ed
Build out initial tests for configure_disks 2020-06-30 14:23:34 -07:00
Brian Cain
234bff9271
Add cleanup_disks_test unit test file 2020-06-30 14:23:34 -07:00
Brian Cain
5258c68cf2
Fixup disk unit tests 2020-06-30 14:22:41 -07:00
Brian Cain
9020868a93
Add initial files for Hyper-V disk configuration and management 2020-06-30 14:22:41 -07:00
sophia
d5cd4da0e0 Use service id for enabling/disabling vm integration services
ref:
https://github.com/PlagueHO/LabBuilder/issues/183
ref service name to id:
https://social.technet.microsoft.com/Forums/de-DE/154917de-f3ca-4b1e-b3f8-23dd4b4f0f06/getvmintegrationservice-sprachabhngig?forum=powershell_de
2020-04-13 09:39:53 -04:00
Brian Cain
54c8ebc31a
Fixes #10229: Add timeout for changing hostname on windows
Prior to this commit, if Windows was slow to reboot, Vagrant would fail
to find the right IP address to upload the wait_for_reboot script to.
This commit fixes this race condition by adding a timeout to ensure that
Vagrant can retry. It also properly catches an exception in the winrm
ready? method for checking if a guest is properly ready for
communications.
2018-11-02 09:23:00 -07:00
Chris Roberts
8aa74a03a0 Differentiate checkpoints and automatic checkpoints
Provide separate configuration settings for enabling/disabling
checkpoints and automatic checkpoints with Hyper-V provider.
2018-07-13 15:23:09 -07:00
Chris Roberts
ed2af17e45 Add delete vm action checks for data directory removal and creation 2018-06-18 10:18:05 -07:00
Chris Roberts
ea4e60247d Check for module_path entry instead of custom environment variable 2018-06-18 09:53:22 -07:00
Chris Roberts
835c500892 Add WSL check on usable? test for provider 2018-06-18 09:50:56 -07:00
Chris Roberts
1becae50a5 Include test coverage on provider option deprecation 2018-05-29 10:25:48 -07:00
Chris Roberts
c238dc0a35 Include machine name when raising invalid box errors 2018-05-25 16:43:17 -07:00
Chris Roberts
eba552ea73 Add more test coverage on Hyper-V Provider actions 2018-05-25 16:23:45 -07:00
Chris Roberts
d24b432273 Add Hyper-V provider actions test coverage 2018-05-25 15:12:39 -07:00
Chris Roberts
6c731fb86c Add test coverage on hyper-v provider driver 2018-05-25 10:11:44 -07:00
Chris Roberts
beacb5bada Add test coverage for all hyper-v configuration options 2018-05-24 16:56:46 -07:00
Brian Cain
8b1043c199 Remove stub methods and replace with allows for rpsec 3 2017-08-04 15:02:59 -07:00
Luke Bakken
57187c9f88 Add method to detect if a Windows user is a member of the "Hyper-V Administrators" group.
Modify Hyper-V provider to require a user to either be an Administrator or a member of "Hyper-V Administrators"
2015-12-10 07:04:39 -08:00
tomfanning
41beaac074 Hyper-V set mac address 2015-09-22 11:35:55 +01:00
Seth Vargo
6699e02bcf Minor cleanup 2015-05-30 11:47:23 -07:00
Volodymyr Babchynskyy
8e6db0015f Fixed typo 2015-03-30 11:01:38 -06:00
Volodymyr Babchynskyy
7628ca71e7 Removed default dependences to number 2015-03-30 10:57:11 -06:00
Volodymyr Babchynskyy
9e23d16d9c merged vlan_id changes for hyperv by tomassrnka 2015-03-30 08:37:29 -06:00
Volodymyr Babchynskyy
551a26272b tests extended to new variables 2015-01-14 17:35:44 +02:00
Mitchell Hashimoto
ba1676b232 providers/hyperv: fix tests and bug with usable? 2014-04-21 13:53:36 -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
4104f6c21f Fix Hyper-V tests 2014-03-06 09:04:23 -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