kitchen-hyperv 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.cane +1 -1
- data/.gitignore +15 -15
- data/CHANGELOG.md +92 -92
- data/LICENSE.txt +22 -22
- data/README.md +44 -7
- data/Rakefile +1 -30
- data/lib/kitchen/driver/hyperv.rb +57 -0
- data/lib/kitchen/driver/hyperv_version.rb +1 -1
- data/lib/kitchen/driver/powershell.rb +16 -0
- data/spec/kitchen/driver/hyperv_spec.rb +70 -70
- data/spec/spec_helper.rb +43 -43
- data/spec/support/hyperv.Tests.ps1 +142 -25
- data/support/hyperv.ps1 +90 -92
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bc2c3434848b858549e45714e5828f52182159f5
|
|
4
|
+
data.tar.gz: 79cb0919ca938194aca1446c14fa899a01b4a141
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c67ce7d0ce7789ccfea65bc7cff15552cde8bc8f6902d2845e36ed0748d56756147ba869f76de36b3a0df8261e9e282c0395a88724119b3c3aca1d6992bc8333
|
|
7
|
+
data.tar.gz: 2ed67e5ae88901c540d6371670b8dea20df6cf1a093af90ba26de0431b9b47046d15ae1795d6275487e6f89fba009b8e8c7fb3c8b5037f35473ddb2b04bf2b9d
|
data/.cane
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
--no-doc
|
|
1
|
+
--no-doc
|
|
2
2
|
--style-measure 100
|
data/.gitignore
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/.bundle/
|
|
2
|
-
/.yardoc
|
|
3
|
-
/Gemfile.lock
|
|
4
|
-
/_yardoc/
|
|
5
|
-
/coverage/
|
|
6
|
-
/doc/
|
|
7
|
-
/pkg/
|
|
8
|
-
/spec/reports/
|
|
9
|
-
/tmp/
|
|
10
|
-
*.bundle
|
|
11
|
-
*.so
|
|
12
|
-
*.o
|
|
13
|
-
*.a
|
|
14
|
-
mkmf.log
|
|
15
|
-
*.gem
|
|
1
|
+
/.bundle/
|
|
2
|
+
/.yardoc
|
|
3
|
+
/Gemfile.lock
|
|
4
|
+
/_yardoc/
|
|
5
|
+
/coverage/
|
|
6
|
+
/doc/
|
|
7
|
+
/pkg/
|
|
8
|
+
/spec/reports/
|
|
9
|
+
/tmp/
|
|
10
|
+
*.bundle
|
|
11
|
+
*.so
|
|
12
|
+
*.o
|
|
13
|
+
*.a
|
|
14
|
+
mkmf.log
|
|
15
|
+
*.gem
|
data/CHANGELOG.md
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
## [v0.3.0](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.3.0) (2016-11-28)
|
|
4
|
-
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.2.3...v0.3.0)
|
|
5
|
-
|
|
6
|
-
**Merged pull requests:**
|
|
7
|
-
|
|
8
|
-
- Support setting VM notes [\#39](https://github.com/test-kitchen/kitchen-hyperv/pull/39) ([watsonlu](https://github.com/watsonlu))
|
|
9
|
-
- Fix mounting iso on Gen 2 VM [\#38](https://github.com/test-kitchen/kitchen-hyperv/pull/38) ([mahsoud](https://github.com/mahsoud))
|
|
10
|
-
- Adding support for HyperV Guest Interface Services [\#34](https://github.com/test-kitchen/kitchen-hyperv/pull/34) ([gaelcolas](https://github.com/gaelcolas))
|
|
11
|
-
- Fix line continuation syntax [\#32](https://github.com/test-kitchen/kitchen-hyperv/pull/32) ([brantb](https://github.com/brantb))
|
|
12
|
-
|
|
13
|
-
## [v0.2.3](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.2.3) (2016-06-10)
|
|
14
|
-
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.2.2...v0.2.3)
|
|
15
|
-
|
|
16
|
-
**Merged pull requests:**
|
|
17
|
-
|
|
18
|
-
- Support PowerShell v5.1 on the Insider Preview - updated [\#31](https://github.com/test-kitchen/kitchen-hyperv/pull/31) ([smurawski](https://github.com/smurawski))
|
|
19
|
-
|
|
20
|
-
## [v0.2.2](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.2.2) (2016-06-10)
|
|
21
|
-
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.2.1...v0.2.2)
|
|
22
|
-
|
|
23
|
-
**Merged pull requests:**
|
|
24
|
-
|
|
25
|
-
- Support PowerShell v5.1 on the Insider Preview [\#30](https://github.com/test-kitchen/kitchen-hyperv/pull/30) ([smurawski](https://github.com/smurawski))
|
|
26
|
-
|
|
27
|
-
## [v0.2.1](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.2.1) (2016-05-25)
|
|
28
|
-
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.20...v0.2.1)
|
|
29
|
-
|
|
30
|
-
## [v0.1.20](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.20) (2016-05-17)
|
|
31
|
-
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.10...v0.1.20)
|
|
32
|
-
|
|
33
|
-
**Merged pull requests:**
|
|
34
|
-
|
|
35
|
-
- More Configurable VM Networking [\#27](https://github.com/test-kitchen/kitchen-hyperv/pull/27) ([svmastersamurai](https://github.com/svmastersamurai))
|
|
36
|
-
- Add -noprofile to powershell executions to prevent users' custom prof… [\#23](https://github.com/test-kitchen/kitchen-hyperv/pull/23) ([kriszentner](https://github.com/kriszentner))
|
|
37
|
-
|
|
38
|
-
## [v0.1.10](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.10) (2015-12-03)
|
|
39
|
-
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.9...v0.1.10)
|
|
40
|
-
|
|
41
|
-
**Merged pull requests:**
|
|
42
|
-
|
|
43
|
-
- update incorrect module name [\#21](https://github.com/test-kitchen/kitchen-hyperv/pull/21) ([jbruettcva](https://github.com/jbruettcva))
|
|
44
|
-
|
|
45
|
-
## [v0.1.9](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.9) (2015-12-03)
|
|
46
|
-
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.8...v0.1.9)
|
|
47
|
-
|
|
48
|
-
## [v0.1.8](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.8) (2015-12-03)
|
|
49
|
-
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.7...v0.1.8)
|
|
50
|
-
|
|
51
|
-
**Merged pull requests:**
|
|
52
|
-
|
|
53
|
-
- Updating readme.md to include image configuration, specifically winrm… [\#20](https://github.com/test-kitchen/kitchen-hyperv/pull/20) ([jbruettcva](https://github.com/jbruettcva))
|
|
54
|
-
- Hyper-V module and Get-VMIP delay fix [\#19](https://github.com/test-kitchen/kitchen-hyperv/pull/19) ([jbruettcva](https://github.com/jbruettcva))
|
|
55
|
-
- File copy feature [\#17](https://github.com/test-kitchen/kitchen-hyperv/pull/17) ([dpiessens](https://github.com/dpiessens))
|
|
56
|
-
- Fixed NilClass exception if VM does not exist [\#16](https://github.com/test-kitchen/kitchen-hyperv/pull/16) ([dpiessens](https://github.com/dpiessens))
|
|
57
|
-
- Add support for dynamic memory [\#15](https://github.com/test-kitchen/kitchen-hyperv/pull/15) ([brantb](https://github.com/brantb))
|
|
58
|
-
|
|
59
|
-
## [v0.1.7](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.7) (2015-07-14)
|
|
60
|
-
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.6...v0.1.7)
|
|
61
|
-
|
|
62
|
-
**Merged pull requests:**
|
|
63
|
-
|
|
64
|
-
- 64-bit windows support [\#8](https://github.com/test-kitchen/kitchen-hyperv/pull/8) ([ksubrama](https://github.com/ksubrama))
|
|
65
|
-
|
|
66
|
-
## [v0.1.6](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.6) (2015-06-25)
|
|
67
|
-
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.5...v0.1.6)
|
|
68
|
-
|
|
69
|
-
## [v0.1.5](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.5) (2015-06-24)
|
|
70
|
-
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.2...v0.1.5)
|
|
71
|
-
|
|
72
|
-
**Merged pull requests:**
|
|
73
|
-
|
|
74
|
-
- Adding support for mounting ISOs [\#6](https://github.com/test-kitchen/kitchen-hyperv/pull/6) ([smurawski](https://github.com/smurawski))
|
|
75
|
-
|
|
76
|
-
## [v0.1.2](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.2) (2015-05-20)
|
|
77
|
-
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.1...v0.1.2)
|
|
78
|
-
|
|
79
|
-
**Merged pull requests:**
|
|
80
|
-
|
|
81
|
-
- Smurawski/updating metadata [\#4](https://github.com/test-kitchen/kitchen-hyperv/pull/4) ([smurawski](https://github.com/smurawski))
|
|
82
|
-
|
|
83
|
-
## [v0.1.1](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.1) (2015-05-20)
|
|
84
|
-
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.0...v0.1.1)
|
|
85
|
-
|
|
86
|
-
## [v0.1.0](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.0) (2015-05-20)
|
|
87
|
-
**Merged pull requests:**
|
|
88
|
-
|
|
89
|
-
- Prepping for release [\#3](https://github.com/test-kitchen/kitchen-hyperv/pull/3) ([smurawski](https://github.com/smurawski))
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
## [v0.3.0](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.3.0) (2016-11-28)
|
|
4
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.2.3...v0.3.0)
|
|
5
|
+
|
|
6
|
+
**Merged pull requests:**
|
|
7
|
+
|
|
8
|
+
- Support setting VM notes [\#39](https://github.com/test-kitchen/kitchen-hyperv/pull/39) ([watsonlu](https://github.com/watsonlu))
|
|
9
|
+
- Fix mounting iso on Gen 2 VM [\#38](https://github.com/test-kitchen/kitchen-hyperv/pull/38) ([mahsoud](https://github.com/mahsoud))
|
|
10
|
+
- Adding support for HyperV Guest Interface Services [\#34](https://github.com/test-kitchen/kitchen-hyperv/pull/34) ([gaelcolas](https://github.com/gaelcolas))
|
|
11
|
+
- Fix line continuation syntax [\#32](https://github.com/test-kitchen/kitchen-hyperv/pull/32) ([brantb](https://github.com/brantb))
|
|
12
|
+
|
|
13
|
+
## [v0.2.3](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.2.3) (2016-06-10)
|
|
14
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.2.2...v0.2.3)
|
|
15
|
+
|
|
16
|
+
**Merged pull requests:**
|
|
17
|
+
|
|
18
|
+
- Support PowerShell v5.1 on the Insider Preview - updated [\#31](https://github.com/test-kitchen/kitchen-hyperv/pull/31) ([smurawski](https://github.com/smurawski))
|
|
19
|
+
|
|
20
|
+
## [v0.2.2](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.2.2) (2016-06-10)
|
|
21
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.2.1...v0.2.2)
|
|
22
|
+
|
|
23
|
+
**Merged pull requests:**
|
|
24
|
+
|
|
25
|
+
- Support PowerShell v5.1 on the Insider Preview [\#30](https://github.com/test-kitchen/kitchen-hyperv/pull/30) ([smurawski](https://github.com/smurawski))
|
|
26
|
+
|
|
27
|
+
## [v0.2.1](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.2.1) (2016-05-25)
|
|
28
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.20...v0.2.1)
|
|
29
|
+
|
|
30
|
+
## [v0.1.20](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.20) (2016-05-17)
|
|
31
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.10...v0.1.20)
|
|
32
|
+
|
|
33
|
+
**Merged pull requests:**
|
|
34
|
+
|
|
35
|
+
- More Configurable VM Networking [\#27](https://github.com/test-kitchen/kitchen-hyperv/pull/27) ([svmastersamurai](https://github.com/svmastersamurai))
|
|
36
|
+
- Add -noprofile to powershell executions to prevent users' custom prof… [\#23](https://github.com/test-kitchen/kitchen-hyperv/pull/23) ([kriszentner](https://github.com/kriszentner))
|
|
37
|
+
|
|
38
|
+
## [v0.1.10](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.10) (2015-12-03)
|
|
39
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.9...v0.1.10)
|
|
40
|
+
|
|
41
|
+
**Merged pull requests:**
|
|
42
|
+
|
|
43
|
+
- update incorrect module name [\#21](https://github.com/test-kitchen/kitchen-hyperv/pull/21) ([jbruettcva](https://github.com/jbruettcva))
|
|
44
|
+
|
|
45
|
+
## [v0.1.9](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.9) (2015-12-03)
|
|
46
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.8...v0.1.9)
|
|
47
|
+
|
|
48
|
+
## [v0.1.8](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.8) (2015-12-03)
|
|
49
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.7...v0.1.8)
|
|
50
|
+
|
|
51
|
+
**Merged pull requests:**
|
|
52
|
+
|
|
53
|
+
- Updating readme.md to include image configuration, specifically winrm… [\#20](https://github.com/test-kitchen/kitchen-hyperv/pull/20) ([jbruettcva](https://github.com/jbruettcva))
|
|
54
|
+
- Hyper-V module and Get-VMIP delay fix [\#19](https://github.com/test-kitchen/kitchen-hyperv/pull/19) ([jbruettcva](https://github.com/jbruettcva))
|
|
55
|
+
- File copy feature [\#17](https://github.com/test-kitchen/kitchen-hyperv/pull/17) ([dpiessens](https://github.com/dpiessens))
|
|
56
|
+
- Fixed NilClass exception if VM does not exist [\#16](https://github.com/test-kitchen/kitchen-hyperv/pull/16) ([dpiessens](https://github.com/dpiessens))
|
|
57
|
+
- Add support for dynamic memory [\#15](https://github.com/test-kitchen/kitchen-hyperv/pull/15) ([brantb](https://github.com/brantb))
|
|
58
|
+
|
|
59
|
+
## [v0.1.7](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.7) (2015-07-14)
|
|
60
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.6...v0.1.7)
|
|
61
|
+
|
|
62
|
+
**Merged pull requests:**
|
|
63
|
+
|
|
64
|
+
- 64-bit windows support [\#8](https://github.com/test-kitchen/kitchen-hyperv/pull/8) ([ksubrama](https://github.com/ksubrama))
|
|
65
|
+
|
|
66
|
+
## [v0.1.6](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.6) (2015-06-25)
|
|
67
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.5...v0.1.6)
|
|
68
|
+
|
|
69
|
+
## [v0.1.5](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.5) (2015-06-24)
|
|
70
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.2...v0.1.5)
|
|
71
|
+
|
|
72
|
+
**Merged pull requests:**
|
|
73
|
+
|
|
74
|
+
- Adding support for mounting ISOs [\#6](https://github.com/test-kitchen/kitchen-hyperv/pull/6) ([smurawski](https://github.com/smurawski))
|
|
75
|
+
|
|
76
|
+
## [v0.1.2](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.2) (2015-05-20)
|
|
77
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.1...v0.1.2)
|
|
78
|
+
|
|
79
|
+
**Merged pull requests:**
|
|
80
|
+
|
|
81
|
+
- Smurawski/updating metadata [\#4](https://github.com/test-kitchen/kitchen-hyperv/pull/4) ([smurawski](https://github.com/smurawski))
|
|
82
|
+
|
|
83
|
+
## [v0.1.1](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.1) (2015-05-20)
|
|
84
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.0...v0.1.1)
|
|
85
|
+
|
|
86
|
+
## [v0.1.0](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.0) (2015-05-20)
|
|
87
|
+
**Merged pull requests:**
|
|
88
|
+
|
|
89
|
+
- Prepping for release [\#3](https://github.com/test-kitchen/kitchen-hyperv/pull/3) ([smurawski](https://github.com/smurawski))
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
93
|
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
data/LICENSE.txt
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
Copyright (c) 2015 Steven Murawski
|
|
2
|
-
|
|
3
|
-
MIT License
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
-
a copy of this software and associated documentation files (the
|
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
-
the following conditions:
|
|
12
|
-
|
|
13
|
-
The above copyright notice and this permission notice shall be
|
|
14
|
-
included in all copies or substantial portions of the Software.
|
|
15
|
-
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
Copyright (c) 2015 Steven Murawski
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
|
@@ -47,30 +47,67 @@ driver:
|
|
|
47
47
|
* A list of DNS Servers that can be reached on the virtual network.
|
|
48
48
|
* vm_switch
|
|
49
49
|
* The virtual switch to attach the guest VMs. Defaults to the first switch returned from Get-VMSwitch.
|
|
50
|
+
* vm_vlan_id
|
|
51
|
+
* The VLAN ID to assign the virtual network adapter on the VM (Valid values: 1-4094). Defaults to untagged.
|
|
50
52
|
* iso_path
|
|
51
53
|
* Path on the host to the ISO to mount on the VMs.
|
|
52
54
|
* boot_iso_path
|
|
53
55
|
* Path on the host to the ISO to mount before starting the VMs.
|
|
54
56
|
* vm_generation
|
|
55
57
|
* The generation for the hyper-v VM. Defaults to 1.
|
|
58
|
+
* disable_secureboot
|
|
59
|
+
* Boolean. If true, will disable secure boot for the VM. Only applies if `vm_generation=2`. Defaults to false.
|
|
56
60
|
* enable_guest_services
|
|
57
61
|
* Enable the Hyper-V Integration Guest services for the VM before starting it. Hyper-V defauls is false (true|false)
|
|
58
62
|
* disk_type
|
|
59
63
|
* The type of virtual disk to create, .VHD or .VHDX. Defaults to the file extension of the parent virtual hard drive.
|
|
64
|
+
* resize_vhd
|
|
65
|
+
* Resize the disk to the specified size. Leave empty to keep the original size. Only works on newly created VM's. Defaults to empty.
|
|
66
|
+
* additional_disks
|
|
67
|
+
* An array of hashes (`name`,`size_gb`, and `type`) of additional disks to attach to the VM.
|
|
68
|
+
* **Required parameters:**
|
|
69
|
+
* name
|
|
70
|
+
* Unique name for the virtual disk.
|
|
71
|
+
* **Optional parameters:**
|
|
72
|
+
* size_gb
|
|
73
|
+
* Integer. If not provided, will default to 5.
|
|
74
|
+
* type
|
|
75
|
+
* The type of virtual disk to create, .VHD or .VHDX. Defaults to the file extension of the parent virtual hard drive.
|
|
76
|
+
* Example:
|
|
77
|
+
|
|
78
|
+
```yaml
|
|
79
|
+
driver:
|
|
80
|
+
name: hyperv
|
|
81
|
+
parent_vhd_folder: 'D:\Hyper-V\Virtual Hard Disks'
|
|
82
|
+
parent_vhd_name: tk_test.vhdx
|
|
83
|
+
additional_disks:
|
|
84
|
+
- name: disk1
|
|
85
|
+
size_gb: 10
|
|
86
|
+
- name: disk2
|
|
87
|
+
size_gb: 50
|
|
88
|
+
type: .VHD
|
|
89
|
+
```
|
|
60
90
|
* vm_note
|
|
61
91
|
* A note to add to the VM's note field. Defaults to empty.
|
|
92
|
+
* copy_vm_files
|
|
93
|
+
* An array of hashes (`source` and `dest`) of files or directories to copy over to the sytem under test.
|
|
94
|
+
* example:
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
driver:
|
|
98
|
+
name: hyperv
|
|
99
|
+
copy_vm_files:
|
|
100
|
+
- source: c:/users/steven/downloads/chef-client-12.19.36-1-x64.msi
|
|
101
|
+
dest: c:/users/administrator/appdata/local/temp/chef-client-12.19.36-1-x64.msi
|
|
102
|
+
```
|
|
103
|
+
|
|
62
104
|
|
|
63
105
|
## Image Configuration
|
|
64
106
|
|
|
65
107
|
The following changes need to be made to a Windows image that is going to be used for testing. This is not an exhaustive list and, your milage may vary.
|
|
108
|
+
|
|
109
|
+
* Guest VMs should have the latest Integration Components installed. See https://support.microsoft.com/en-us/help/3063109/hyper-v-integration-components-update-for-windows-virtual-machines-that-are-running-on-a-windows-10-based-host
|
|
66
110
|
|
|
67
|
-
#### WinRM
|
|
68
|
-
|
|
69
|
-
```powershell
|
|
70
|
-
winrm set winrm/config/client/auth @{Basic="true"}
|
|
71
|
-
winrm set winrm/config/service/auth @{Basic="true"}
|
|
72
|
-
winrm set winrm/config/service @{AllowUnencrypted="true"}
|
|
73
|
-
```
|
|
74
111
|
## Contributing
|
|
75
112
|
|
|
76
113
|
1. Fork it ( https://github.com/[my-github-username]/kitchen-hyperv/fork )
|
data/Rakefile
CHANGED
|
@@ -21,36 +21,7 @@ task :stats do
|
|
|
21
21
|
sh "countloc -r spec"
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
require "rubocop/rake_task"
|
|
26
|
-
RuboCop::RakeTask.new(:style) do |task|
|
|
27
|
-
task.options << "--display-cop-names"
|
|
28
|
-
task.options << "--lint"
|
|
29
|
-
task.options << '--config' << '.rubocop.yml'
|
|
30
|
-
task.patterns = ['lib/**/*.rb']
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
require "cane/rake_task"
|
|
34
|
-
desc "Run cane to check quality metrics"
|
|
35
|
-
Cane::RakeTask.new do |cane|
|
|
36
|
-
cane.canefile = "./.cane"
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
desc "Run all quality tasks"
|
|
40
|
-
task :quality => [:cane, :style, :stats]
|
|
41
|
-
|
|
42
|
-
require "yard"
|
|
43
|
-
YARD::Rake::YardocTask.new
|
|
44
|
-
|
|
45
|
-
desc "Generate gem dependency graph"
|
|
46
|
-
task :viz do
|
|
47
|
-
Bundler.with_clean_env do
|
|
48
|
-
sh "bundle viz --without test development guard " \
|
|
49
|
-
"--requirements --version"
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
task :default => [:test, :quality]
|
|
24
|
+
task :default => [:test]
|
|
54
25
|
|
|
55
26
|
begin
|
|
56
27
|
require "github_changelog_generator/task"
|
|
@@ -46,11 +46,14 @@ module Kitchen
|
|
|
46
46
|
default_config :dns_servers
|
|
47
47
|
default_config :subnet, '255.255.255.0'
|
|
48
48
|
default_config :vm_switch
|
|
49
|
+
default_config :vm_vlan_id
|
|
49
50
|
default_config :iso_path
|
|
50
51
|
default_config :boot_iso_path
|
|
51
52
|
default_config :enable_guest_services
|
|
52
53
|
default_config :vm_note
|
|
54
|
+
default_config :resize_vhd
|
|
53
55
|
default_config :vm_generation, 1
|
|
56
|
+
default_config :disable_secureboot, false
|
|
54
57
|
default_config :disk_type do |driver|
|
|
55
58
|
File.extname(driver[:parent_vhd_name])
|
|
56
59
|
end
|
|
@@ -61,6 +64,7 @@ module Kitchen
|
|
|
61
64
|
@state = state
|
|
62
65
|
validate_vm_settings
|
|
63
66
|
create_new_differencing_disk
|
|
67
|
+
create_additional_disks
|
|
64
68
|
create_virtual_machine
|
|
65
69
|
set_virtual_machine_note
|
|
66
70
|
update_state
|
|
@@ -76,6 +80,7 @@ module Kitchen
|
|
|
76
80
|
instance.transport.connection(state).close
|
|
77
81
|
remove_virtual_machine
|
|
78
82
|
remove_differencing_disk
|
|
83
|
+
remove_additional_disks
|
|
79
84
|
info("The Hyper-V instance #{instance.to_str} has been removed.")
|
|
80
85
|
state.delete(:id)
|
|
81
86
|
end
|
|
@@ -95,6 +100,15 @@ module Kitchen
|
|
|
95
100
|
raise warning unless memory_valid
|
|
96
101
|
end
|
|
97
102
|
config[:vm_switch] = vm_switch
|
|
103
|
+
if config[:vm_vlan_id]
|
|
104
|
+
vm_vlan_id = config[:vm_vlan_id]
|
|
105
|
+
vm_vlan_id_min = 1
|
|
106
|
+
vm_vlan_id_max = 4094
|
|
107
|
+
vm_vlan_id_valid = vm_vlan_id.between?(vm_vlan_id_min, vm_vlan_id_max)
|
|
108
|
+
vm_vlan_id_warning = "vm_vlan_id (#{vm_vlan_id}) must be a valid 802.1Q" \
|
|
109
|
+
" VLAN ID between (#{vm_vlan_id_min}-#{vm_vlan_id_max})"
|
|
110
|
+
raise vm_vlan_id_warning unless vm_vlan_id_valid
|
|
111
|
+
end
|
|
98
112
|
end
|
|
99
113
|
|
|
100
114
|
def create_new_differencing_disk
|
|
@@ -102,6 +116,23 @@ module Kitchen
|
|
|
102
116
|
info("Creating differencing disk for #{instance.name}.")
|
|
103
117
|
run_ps new_differencing_disk_ps
|
|
104
118
|
info("Created differencing disk for #{instance.name}.")
|
|
119
|
+
set_new_vhd_size
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
def create_additional_disks
|
|
123
|
+
return if config[:additional_disks].nil?
|
|
124
|
+
@additional_disk_objects = []
|
|
125
|
+
config[:additional_disks].each do |additional_disk|
|
|
126
|
+
raise "Missing name for additional disk" unless additional_disk[:name]
|
|
127
|
+
disk_type = additional_disk[:type] || config[:disk_type]
|
|
128
|
+
disk_path = additional_disk_path(additional_disk[:name], disk_type)
|
|
129
|
+
raise "Additional disk file already exists: #{disk_path}" unless !File.exist?(disk_path)
|
|
130
|
+
disk_size = additional_disk[:size_gb] || 5
|
|
131
|
+
info("Creating additional disk #{additional_disk[:name]} for #{instance.name}.")
|
|
132
|
+
run_ps new_additional_disk_ps(disk_path, disk_size)
|
|
133
|
+
info("Created additional disk #{additional_disk[:name]} for #{instance.name}.")
|
|
134
|
+
@additional_disk_objects.push(disk_path)
|
|
135
|
+
end
|
|
105
136
|
end
|
|
106
137
|
|
|
107
138
|
def vm_switch
|
|
@@ -140,6 +171,14 @@ module Kitchen
|
|
|
140
171
|
run_ps mount_vm_iso
|
|
141
172
|
info("Done mounting #{config[:iso_path]}")
|
|
142
173
|
end
|
|
174
|
+
|
|
175
|
+
def set_new_vhd_size
|
|
176
|
+
return unless config[:resize_vhd]
|
|
177
|
+
info("Resizing differencing disk for #{instance.name}.")
|
|
178
|
+
run_ps resize_vhd
|
|
179
|
+
info("Resized differencing disk for #{instance.name}.")
|
|
180
|
+
end
|
|
181
|
+
|
|
143
182
|
def set_virtual_machine_note
|
|
144
183
|
return unless config[:vm_note]
|
|
145
184
|
info("Adding note to VM: '#{config[:vm_note]}'")
|
|
@@ -176,6 +215,20 @@ module Kitchen
|
|
|
176
215
|
info("Removed the differencing disk for #{instance.name}.")
|
|
177
216
|
end
|
|
178
217
|
|
|
218
|
+
def remove_additional_disks
|
|
219
|
+
return if config[:additional_disks].nil?
|
|
220
|
+
config[:additional_disks].each do |additional_disk|
|
|
221
|
+
raise "Missing name for additional disk" unless additional_disk[:name]
|
|
222
|
+
disk_type = additional_disk[:type] || config[:disk_type]
|
|
223
|
+
disk_path = additional_disk_path(additional_disk[:name], disk_type)
|
|
224
|
+
if File.exist?(disk_path)
|
|
225
|
+
info("Removing additional disk #{additional_disk[:name]} for #{instance.name}.")
|
|
226
|
+
FileUtils.rm(disk_path)
|
|
227
|
+
info("Removed additional disk #{additional_disk[:name]} for #{instance.name}.")
|
|
228
|
+
end
|
|
229
|
+
end
|
|
230
|
+
end
|
|
231
|
+
|
|
179
232
|
def kitchen_vm_path
|
|
180
233
|
@kitchen_vm_path ||= File.join(config[:kitchen_root], ".kitchen/#{instance.name}")
|
|
181
234
|
end
|
|
@@ -188,6 +241,10 @@ module Kitchen
|
|
|
188
241
|
@differencing_disk_path ||= File.join(kitchen_vm_path, "diff" + "#{config[:disk_type]}")
|
|
189
242
|
end
|
|
190
243
|
|
|
244
|
+
def additional_disk_path(disk_name, disk_type)
|
|
245
|
+
File.join(kitchen_vm_path, disk_name + disk_type)
|
|
246
|
+
end
|
|
247
|
+
|
|
191
248
|
def parent_vhd_path
|
|
192
249
|
@parent_vhd_path ||= File.join(config[:parent_vhd_folder], config[:parent_vhd_name])
|
|
193
250
|
end
|