kitchen-hyperv 0.5.1 → 0.5.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8d3ff9e9f8b99293939c7c141455c2ec41abd93d
4
- data.tar.gz: 0c2f6720c12e51087617bc30f26118ed8d5a94b7
2
+ SHA256:
3
+ metadata.gz: 9d4200c123c96038ab396e818f5513515fe3cf69ffe7bb9a02a1a8d01a753329
4
+ data.tar.gz: 47b526e068201baed55c9b4df68c6a7e84644cf28b48a94bfd94428b474430f4
5
5
  SHA512:
6
- metadata.gz: d0c19962957e55d526736b5e8dc9ee0a94939c7e46192077ff13b29717294d68ded617672260025a8b8f3470737c798bca125560f53bbe77d262d0891897d566
7
- data.tar.gz: 6d95718a8bd947220c7d6a12c82539ec03befc7509d8281e0e152b49c996cecd3b90bc7ceffdf6f4e38c5749798d0e9c4cde16c4c0af760e6cdad2b84f85ded9
6
+ metadata.gz: 075cd8245a0a390d13b1071626faff6cdb01efa9577722bb044a0c607f1d387c5719902927ed3408bf66b9712a2bc534e84a19684f699968187b2106fc516f56
7
+ data.tar.gz: a9154005a646e70518395c497bb440d7566abf0490a3b4e04362208e5e487e9a07a519a909ec9a90a8a9a20c60fe53cc1f9d9d3e04a502d7bb897fb161e2b049
data/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright (c) 2015 Steven Murawski
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
@@ -22,7 +22,7 @@ require 'kitchen/driver/hyperv_version'
22
22
  require 'kitchen/driver/powershell'
23
23
  require 'mixlib/shellout'
24
24
  require 'fileutils'
25
- require 'JSON'
25
+ require 'json'
26
26
 
27
27
  module Kitchen
28
28
 
@@ -1,22 +1,22 @@
1
- #
2
- # Author:: Steven Murawski <smurawski@chef.io>
3
- # Copyright:: Copyright (c) 2015 Chef Software, Inc.
4
- # License:: Apache License, Version 2.0
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
-
18
- module Kitchen
19
- module Driver
20
- HYPERV_VERSION = '0.5.1'.freeze
21
- end
22
- end
1
+ #
2
+ # Author:: Steven Murawski <smurawski@chef.io>
3
+ # Copyright:: Copyright (c) 2015-2018 Chef Software, Inc.
4
+ # License:: Apache License, Version 2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+ module Kitchen
19
+ module Driver
20
+ HYPERV_VERSION = '0.5.2'.freeze
21
+ end
22
+ end
@@ -17,7 +17,7 @@
17
17
 
18
18
  require 'mixlib/shellout'
19
19
  require 'fileutils'
20
- require 'JSON'
20
+ require 'json'
21
21
 
22
22
  module Kitchen
23
23
  module Driver
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-hyperv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Murawski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-08 00:00:00.000000000 Z
11
+ date: 2018-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pry
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -143,25 +143,14 @@ executables: []
143
143
  extensions: []
144
144
  extra_rdoc_files: []
145
145
  files:
146
- - ".cane"
147
- - ".gitignore"
148
- - ".rubocop.yml"
149
- - CHANGELOG.md
150
- - Gemfile
151
- - LICENSE.txt
152
- - README.md
153
- - Rakefile
154
- - kitchen-hyperv.gemspec
146
+ - LICENSE
155
147
  - lib/kitchen/driver/hyperv.rb
156
148
  - lib/kitchen/driver/hyperv_version.rb
157
149
  - lib/kitchen/driver/powershell.rb
158
- - spec/kitchen/driver/hyperv_spec.rb
159
- - spec/spec_helper.rb
160
- - spec/support/hyperv.Tests.ps1
161
150
  - support/hyperv.ps1
162
151
  homepage: https://github.com/test-kitchen/kitchen-hyperv
163
152
  licenses:
164
- - Apache 2
153
+ - Apache-2.0
165
154
  metadata: {}
166
155
  post_install_message:
167
156
  rdoc_options: []
@@ -179,11 +168,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
168
  version: '0'
180
169
  requirements: []
181
170
  rubyforge_project:
182
- rubygems_version: 2.6.11
171
+ rubygems_version: 2.7.6
183
172
  signing_key:
184
173
  specification_version: 4
185
174
  summary: Hyper-V Driver for Test-Kitchen
186
- test_files:
187
- - spec/kitchen/driver/hyperv_spec.rb
188
- - spec/spec_helper.rb
189
- - spec/support/hyperv.Tests.ps1
175
+ test_files: []
data/.cane DELETED
@@ -1,2 +0,0 @@
1
- --no-doc
2
- --style-measure 100
data/.gitignore DELETED
@@ -1,15 +0,0 @@
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,5 +0,0 @@
1
- Metrics/LineLength:
2
- Max: 100
3
-
4
- Style/Documentation:
5
- Enabled: false
@@ -1,126 +0,0 @@
1
- # Change Log
2
-
3
- ## [v0.5.1](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.5.1) (2017-09-08)
4
- [Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.5.0...v0.5.1)
5
-
6
- **Merged pull requests:**
7
-
8
- - Change resize\_vhd parameter to -SizeBytes [\#58](https://github.com/test-kitchen/kitchen-hyperv/pull/58) ([jdoores](https://github.com/jdoores))
9
-
10
- ## [v0.5.0](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.5.0) (2017-07-05)
11
- [Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.4.1...v0.5.0)
12
-
13
- **Merged pull requests:**
14
-
15
- - version bump and changelog for v0.5.0 [\#55](https://github.com/test-kitchen/kitchen-hyperv/pull/55) ([smurawski](https://github.com/smurawski))
16
- - Fixed issue with existing stale diff disk [\#53](https://github.com/test-kitchen/kitchen-hyperv/pull/53) ([jdoores](https://github.com/jdoores))
17
- - Added static\_mac\_address feature [\#52](https://github.com/test-kitchen/kitchen-hyperv/pull/52) ([jdoores](https://github.com/jdoores))
18
-
19
- ## [v0.4.1](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.4.1) (2017-03-29)
20
- [Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.4.0...v0.4.1)
21
-
22
- **Merged pull requests:**
23
-
24
- - Fix error when no additional disks [\#48](https://github.com/test-kitchen/kitchen-hyperv/pull/48) ([smurawski](https://github.com/smurawski))
25
-
26
- ## [v0.4.0](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.4.0) (2017-03-24)
27
- [Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.3.0...v0.4.0)
28
-
29
- **Merged pull requests:**
30
-
31
- - Feature/disable secureboot [\#44](https://github.com/test-kitchen/kitchen-hyperv/pull/44) ([smastrorocco](https://github.com/smastrorocco))
32
- - Feature/additional disk [\#43](https://github.com/test-kitchen/kitchen-hyperv/pull/43) ([smastrorocco](https://github.com/smastrorocco))
33
- - Feature/vlan support [\#41](https://github.com/test-kitchen/kitchen-hyperv/pull/41) ([smastrorocco](https://github.com/smastrorocco))
34
- - Add ability to resize a the VHD when the disk is created [\#40](https://github.com/test-kitchen/kitchen-hyperv/pull/40) ([watsonlu](https://github.com/watsonlu))
35
-
36
- ## [v0.3.0](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.3.0) (2016-11-28)
37
- [Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.2.3...v0.3.0)
38
-
39
- **Merged pull requests:**
40
-
41
- - Support setting VM notes [\#39](https://github.com/test-kitchen/kitchen-hyperv/pull/39) ([watsonlu](https://github.com/watsonlu))
42
- - Fix mounting iso on Gen 2 VM [\#38](https://github.com/test-kitchen/kitchen-hyperv/pull/38) ([mahsoud](https://github.com/mahsoud))
43
- - Adding support for HyperV Guest Interface Services [\#34](https://github.com/test-kitchen/kitchen-hyperv/pull/34) ([gaelcolas](https://github.com/gaelcolas))
44
- - Fix line continuation syntax [\#32](https://github.com/test-kitchen/kitchen-hyperv/pull/32) ([brantb](https://github.com/brantb))
45
-
46
- ## [v0.2.3](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.2.3) (2016-06-10)
47
- [Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.2.2...v0.2.3)
48
-
49
- **Merged pull requests:**
50
-
51
- - Support PowerShell v5.1 on the Insider Preview - updated [\#31](https://github.com/test-kitchen/kitchen-hyperv/pull/31) ([smurawski](https://github.com/smurawski))
52
-
53
- ## [v0.2.2](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.2.2) (2016-06-10)
54
- [Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.2.1...v0.2.2)
55
-
56
- **Merged pull requests:**
57
-
58
- - Support PowerShell v5.1 on the Insider Preview [\#30](https://github.com/test-kitchen/kitchen-hyperv/pull/30) ([smurawski](https://github.com/smurawski))
59
-
60
- ## [v0.2.1](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.2.1) (2016-05-25)
61
- [Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.20...v0.2.1)
62
-
63
- ## [v0.1.20](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.20) (2016-05-17)
64
- [Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.10...v0.1.20)
65
-
66
- **Merged pull requests:**
67
-
68
- - More Configurable VM Networking [\#27](https://github.com/test-kitchen/kitchen-hyperv/pull/27) ([svmastersamurai](https://github.com/svmastersamurai))
69
- - 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))
70
-
71
- ## [v0.1.10](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.10) (2015-12-03)
72
- [Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.9...v0.1.10)
73
-
74
- **Merged pull requests:**
75
-
76
- - update incorrect module name [\#21](https://github.com/test-kitchen/kitchen-hyperv/pull/21) ([jbruettcva](https://github.com/jbruettcva))
77
-
78
- ## [v0.1.9](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.9) (2015-12-03)
79
- [Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.8...v0.1.9)
80
-
81
- ## [v0.1.8](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.8) (2015-12-03)
82
- [Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.7...v0.1.8)
83
-
84
- **Merged pull requests:**
85
-
86
- - Updating readme.md to include image configuration, specifically winrm… [\#20](https://github.com/test-kitchen/kitchen-hyperv/pull/20) ([jbruettcva](https://github.com/jbruettcva))
87
- - Hyper-V module and Get-VMIP delay fix [\#19](https://github.com/test-kitchen/kitchen-hyperv/pull/19) ([jbruettcva](https://github.com/jbruettcva))
88
- - File copy feature [\#17](https://github.com/test-kitchen/kitchen-hyperv/pull/17) ([dpiessens](https://github.com/dpiessens))
89
- - Fixed NilClass exception if VM does not exist [\#16](https://github.com/test-kitchen/kitchen-hyperv/pull/16) ([dpiessens](https://github.com/dpiessens))
90
- - Add support for dynamic memory [\#15](https://github.com/test-kitchen/kitchen-hyperv/pull/15) ([brantb](https://github.com/brantb))
91
-
92
- ## [v0.1.7](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.7) (2015-07-14)
93
- [Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.6...v0.1.7)
94
-
95
- **Merged pull requests:**
96
-
97
- - 64-bit windows support [\#8](https://github.com/test-kitchen/kitchen-hyperv/pull/8) ([ksubrama](https://github.com/ksubrama))
98
-
99
- ## [v0.1.6](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.6) (2015-06-25)
100
- [Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.5...v0.1.6)
101
-
102
- ## [v0.1.5](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.5) (2015-06-24)
103
- [Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.2...v0.1.5)
104
-
105
- **Merged pull requests:**
106
-
107
- - Adding support for mounting ISOs [\#6](https://github.com/test-kitchen/kitchen-hyperv/pull/6) ([smurawski](https://github.com/smurawski))
108
-
109
- ## [v0.1.2](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.2) (2015-05-20)
110
- [Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.1...v0.1.2)
111
-
112
- **Merged pull requests:**
113
-
114
- - Smurawski/updating metadata [\#4](https://github.com/test-kitchen/kitchen-hyperv/pull/4) ([smurawski](https://github.com/smurawski))
115
-
116
- ## [v0.1.1](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.1) (2015-05-20)
117
- [Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.0...v0.1.1)
118
-
119
- ## [v0.1.0](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.0) (2015-05-20)
120
- **Merged pull requests:**
121
-
122
- - Prepping for release [\#3](https://github.com/test-kitchen/kitchen-hyperv/pull/3) ([smurawski](https://github.com/smurawski))
123
-
124
-
125
-
126
- \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
data/Gemfile DELETED
@@ -1,15 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in kitchen-hyperv.gemspec
4
- gemspec
5
-
6
- gem 'win32-process'
7
- gem 'win32-api'
8
- gem 'windows-pr'
9
- gem 'windows-api'
10
- gem 'ffi'
11
- gem 'rb-readline'
12
- gem 'pry'
13
- gem 'pry-stack_explorer'
14
- gem 'pry-byebug'
15
- gem 'github_changelog_generator'
@@ -1,22 +0,0 @@
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 DELETED
@@ -1,122 +0,0 @@
1
- [![Gem Version](https://badge.fury.io/rb/kitchen-hyperv.svg)](http://badge.fury.io/rb/kitchen-hyperv)
2
- # Kitchen::Hyperv
3
-
4
- TODO: Write a gem description
5
-
6
- ## Installation
7
-
8
- Add this line to your application's Gemfile:
9
-
10
- ```ruby
11
- gem 'kitchen-hyperv'
12
- ```
13
-
14
- ## Usage
15
-
16
- In the .kitchen.yml
17
-
18
- ```yaml
19
- driver:
20
- name: 'hyperv'
21
- ```
22
-
23
- ### Required parameters:
24
-
25
- * parent_vhd_folder
26
- * Location of the base vhd files
27
- * parent_vhd_name
28
- * Vhd file name for the base vhd file
29
-
30
- ### Optional parameters:
31
-
32
- * memory_startup_bytes
33
- * amount of RAM to assign to each virtual machine. Defaults to 536,870,912.
34
- * processor_count
35
- * number of virtual processors to assign to each virtual machine. Defaults to 2.
36
- * dynamic_memory
37
- * if true, the amount of memory allocated to a virtual machine is adjusted by Hyper-V dynamically. Defaults to false.
38
- * dynamic_memory_min_bytes / dynamic_memory_max_bytes
39
- * The minimum and maximum amount of memory Hyper-V will allocate to a virtual machine if dynamic_memory is enabled. Defaults to 536,870,912 and 2,147,483,648 (512MB-2GB)
40
- * ip_address
41
- * IP address for the virtual machine. If the VM is not on a network with DHCP, this can be used to assign an IP that can be reached from the host machine.
42
- * subnet
43
- * The subnet of the virtual machine. Defaults to `255.255.255.0`
44
- * gateway
45
- * The default gateway of the virtual machine.
46
- * dns_servers
47
- * A list of DNS Servers that can be reached on the virtual network.
48
- * vm_switch
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.
52
- * iso_path
53
- * Path on the host to the ISO to mount on the VMs.
54
- * boot_iso_path
55
- * Path on the host to the ISO to mount before starting the VMs.
56
- * vm_generation
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.
60
- * enable_guest_services
61
- * Enable the Hyper-V Integration Guest services for the VM before starting it. Hyper-V defauls is false (true|false)
62
- * disk_type
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
- ```
90
- * vm_note
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
-
104
- * static_mac_address
105
- * String value specifying a static MAC Address to be set at virtual machine creation time.
106
- * Hyper-V will automatically assign a valid dynamic address if your input doesn't give a valid MAC Address.
107
- * example: `static_mac_address: '00155d123456'`
108
-
109
-
110
- ## Image Configuration
111
-
112
- 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.
113
-
114
- * 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
115
-
116
- ## Contributing
117
-
118
- 1. Fork it ( https://github.com/[my-github-username]/kitchen-hyperv/fork )
119
- 2. Create your feature branch (`git checkout -b my-new-feature`)
120
- 3. Commit your changes (`git commit -am 'Add some feature'`)
121
- 4. Push to the branch (`git push origin my-new-feature`)
122
- 5. Create a new Pull Request
data/Rakefile DELETED
@@ -1,32 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- require "bundler/gem_tasks"
4
- require "kitchen/driver/hyperv_version"
5
-
6
- require "rake/testtask"
7
- Rake::TestTask.new(:unit) do |t|
8
- t.libs.push "lib"
9
- t.test_files = FileList["spec/**/*_spec.rb"]
10
- t.verbose = true
11
- end
12
-
13
- desc "Run all test suites"
14
- task :test => [:unit]
15
-
16
-
17
- task :default => [:test]
18
-
19
- begin
20
- require "github_changelog_generator/task"
21
-
22
- GitHubChangelogGenerator::RakeTask.new :changelog do |config|
23
- config.future_release = "v#{Kitchen::Driver::HYPERV_VERSION}"
24
- config.issues = false
25
- config.pulls = true
26
- config.user = 'test-kitchen'
27
- config.project = 'kitchen-hyperv'
28
- end
29
- rescue LoadError
30
- puts "github_changelog_generator is not available. " \
31
- "gem install github_changelog_generator to generate changelogs"
32
- end
@@ -1,32 +0,0 @@
1
- # encoding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
-
5
- require 'kitchen/driver/hyperv_version'
6
-
7
- Gem::Specification.new do |spec|
8
- spec.name = "kitchen-hyperv"
9
- spec.version = Kitchen::Driver::HYPERV_VERSION
10
- spec.authors = ["Steven Murawski"]
11
- spec.email = ["steven.murawski@gmail.com"]
12
- spec.summary = 'Hyper-V Driver for Test-Kitchen'
13
- spec.description = 'Hyper-V Driver for Test-Kitchen'
14
- spec.homepage = "https://github.com/test-kitchen/kitchen-hyperv"
15
- spec.license = "Apache 2"
16
-
17
- spec.files = `git ls-files -z`.split("\x0")
18
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
- spec.require_paths = ["lib"]
21
-
22
- spec.add_development_dependency "bundler", "~> 1.7"
23
- spec.add_development_dependency "rake", "~> 10.0"
24
- spec.add_development_dependency "pry", "~> 0.10"
25
- spec.add_development_dependency "cane"
26
- spec.add_development_dependency "finstyle"
27
- spec.add_development_dependency "rubocop"
28
- spec.add_development_dependency "yard"
29
- spec.add_development_dependency "countloc"
30
-
31
- spec.add_dependency "test-kitchen", "~> 1.4"
32
- end
@@ -1,70 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- #
3
- # Author:: Fletcher (<fnichol@nichol.ca>)
4
- #
5
- # Copyright (C) 2015, Fletcher Nichol
6
- #
7
- # Licensed under the Apache License, Version 2.0 (the "License");
8
- # you may not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing, software
14
- # distributed under the License is distributed on an "AS IS" BASIS,
15
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- # See the License for the specific language governing permissions and
17
- # limitations under the License.
18
-
19
- require_relative "../../spec_helper"
20
-
21
- require "logger"
22
- require "stringio"
23
- require "kitchen"
24
- require 'kitchen/driver/hyperv_version'
25
- require "kitchen/driver/hyperv"
26
- require "kitchen/provisioner/dummy"
27
- require "kitchen/transport/dummy"
28
- require "kitchen/verifier/dummy"
29
-
30
- describe Kitchen::Driver::Hyperv do
31
-
32
- let(:logged_output) { StringIO.new }
33
- let(:logger) { Logger.new(logged_output) }
34
- let(:config) { { :kitchen_root => "c:/test_root" } }
35
- let(:platform) { Kitchen::Platform.new(:name => "fooos-99") }
36
- let(:suite) { Kitchen::Suite.new(:name => "suitey") }
37
- let(:verifier) { Kitchen::Verifier::Dummy.new }
38
- let(:provisioner) { Kitchen::Provisioner::Dummy.new }
39
- let(:transport) { Kitchen::Transport::Dummy.new }
40
- let(:state_file) { stub("state_file") }
41
- let(:state) { Hash.new }
42
- let(:env) { Hash.new }
43
-
44
- let(:driver_object) { Kitchen::Driver::Hyperv.new(config) }
45
-
46
- let(:driver) do
47
- d = driver_object
48
- instance
49
- d
50
- end
51
-
52
- let(:instance) do
53
- Kitchen::Instance.new(
54
- :verifier => verifier,
55
- :driver => driver_object,
56
- :logger => logger,
57
- :suite => suite,
58
- :platform => platform,
59
- :provisioner => provisioner,
60
- :transport => transport,
61
- :state_file => state_file
62
- )
63
- end
64
-
65
- #before { stub_const("ENV", env) }
66
-
67
- it 'driver api_version is 2' do
68
- driver.diagnose_plugin[:api_version].must_equal(2)
69
- end
70
- end
@@ -1,43 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- #
3
- # Author:: Fletcher Nichol (<fnichol@nichol.ca>)
4
- #
5
- # Copyright (C) 2012, Fletcher Nichol
6
- #
7
- # Licensed under the Apache License, Version 2.0 (the "License");
8
- # you may not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing, software
14
- # distributed under the License is distributed on an "AS IS" BASIS,
15
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- # See the License for the specific language governing permissions and
17
- # limitations under the License.
18
-
19
- gem "minitest"
20
- gem "minitest-stub-const"
21
-
22
- if ENV["CODECLIMATE_REPO_TOKEN"]
23
- require "codeclimate-test-reporter"
24
- CodeClimate::TestReporter.start
25
- elsif ENV["COVERAGE"]
26
- require "simplecov"
27
- SimpleCov.profiles.define "gem" do
28
- command_name "Specs"
29
-
30
- add_filter ".gem/"
31
- add_filter "/spec/"
32
- add_filter "/lib/vendor/"
33
-
34
- add_group "Libraries", "/lib/"
35
- end
36
- SimpleCov.start "gem"
37
- end
38
-
39
- require 'minitest'
40
- require 'minitest/stub_const'
41
- require "minitest/autorun"
42
- require "mocha/setup"
43
- require "tempfile"
@@ -1,194 +0,0 @@
1
- . $PSScriptRoot\..\..\support\hyperv.ps1
2
-
3
- describe 'New-DifferencingDisk' {
4
- mock new-vhd -Verifiable -MockWith {}
5
-
6
- context 'mandatory parameters' {
7
- mock Test-Path -MockWith {}
8
-
9
- $command = get-command new-differencingDisk
10
-
11
- it 'Path is mandatory' {
12
- $Command.Parameters['Path'].Attributes.Mandatory | should be $true
13
- }
14
- it 'ParentPath is mandatory' {
15
- $Command.Parameters['ParentPath'].Attributes.Mandatory | should be $true
16
- }
17
- }
18
-
19
- context 'when differencing disk exists' {
20
- mock Test-Path -ParameterFilter {$Path -eq 'c:\.kitchen\diff.vhd'} -MockWith {$true}
21
-
22
- new-differencingDisk -Path 'c:\.kitchen\diff.vhd' -parentpath 'c:\source.vhd'
23
-
24
- it 'does not create a new vhd' {
25
- Assert-MockCalled new-vhd -Times 0
26
- }
27
- }
28
-
29
- context 'when a differencing disk does not exist' {
30
- mock Test-Path -ParameterFilter {$Path -eq 'c:\.kitchen\diff.vhd'} -MockWith {$false}
31
-
32
- new-differencingDisk -Path 'c:\.kitchen\diff.vhd' -parentpath 'c:\source.vhd'
33
-
34
- it 'creates a new differencing disk' {
35
- Assert-MockCalled new-vhd -Times 1 -ParameterFilter {
36
- $Path -eq 'c:\.kitchen\diff.vhd' -and
37
- $ParentPath -eq 'c:\source.vhd' -and
38
- $Differencing -eq $true
39
- }
40
- }
41
- }
42
- }
43
-
44
- Describe "New-KitchenVM with VlanId" {
45
- function New-VM {}
46
- function Set-VM {}
47
- function Set-VMMemory {}
48
- function Set-VMNetworkAdapterVlan {param ($VM, [Switch]$Access, $VlanId)}
49
- function Start-VM {}
50
-
51
- Mock New-VM
52
- Mock Set-VM
53
- Mock Set-VMMemory
54
- Mock Set-VMNetworkAdapterVlan
55
- Mock Start-VM
56
-
57
- Context "When VlanId is not specified" {
58
- New-KitchenVM
59
-
60
- It "Should not set the VlanId for the VM" {
61
- Assert-MockCalled Set-VMNetworkAdapterVlan -Times 0
62
- }
63
- }
64
-
65
- Context "When VlanId is specified" {
66
- $testVlanId = 1
67
- New-KitchenVM -VlanId $testVlanId
68
-
69
- It "Should set the VlanId for the VM" {
70
- Assert-MockCalled Set-VMNetworkAdapterVlan -Times 1 -ParameterFilter {
71
- $VM -eq $null -and
72
- $Access -eq $true -and
73
- $VlanId -eq $testVlanId
74
- }
75
- }
76
- }
77
- }
78
-
79
- Describe "New-KitchenVM with AdditionalDisks" {
80
- function New-VM {}
81
- function Set-VM {}
82
- function Set-VMMemory {}
83
- function Add-VMHardDiskDrive {param ($Path)}
84
- function Start-VM {}
85
-
86
- Mock New-VM
87
- Mock Set-VM
88
- Mock Set-VMMemory
89
- Mock Add-VMHardDiskDrive
90
- Mock Start-VM
91
-
92
- Context "When AdditionalDisks is not specified" {
93
- New-KitchenVM
94
-
95
- It "Should not add additional disks to the VM" {
96
- Assert-MockCalled Add-VMHardDiskDrive -Times 0
97
- }
98
- }
99
-
100
- Context "When AdditionalDisks is specified" {
101
- $AdditionalDisks = @(".\test1.vhd", ".\test2.vhdx")
102
- New-KitchenVM -AdditionalDisks $AdditionalDisks
103
-
104
- It "Should add additinoal disks to the VM" {
105
- Assert-MockCalled Add-VMHardDiskDrive -Times $AdditionalDisks.Count -ParameterFilter {
106
- $VM -eq $null -and
107
- $Path -in $AdditionalDisks
108
- }
109
- }
110
- }
111
- }
112
-
113
- Describe "New-KitchenVM with DisableSecureBoot" {
114
- function New-VM {}
115
- function Set-VM {}
116
- function Set-VMMemory {}
117
- function Set-VMFirmware {param ($EnableSecureBoot)}
118
- function Start-VM {}
119
-
120
- Mock New-VM
121
- Mock Set-VM
122
- Mock Set-VMMemory
123
- Mock Set-VMFirmware
124
- Mock Start-VM
125
-
126
- Context "When DisableSecureBoot is not specified" {
127
- New-KitchenVM
128
-
129
- It "Should not set firmware settings on the VM" {
130
- Assert-MockCalled Set-VMFirmware -Times 0
131
- }
132
- }
133
-
134
- Context "When DisableSecureBoot is False" {
135
- New-KitchenVM -DisableSecureBoot $false
136
-
137
- It "Should not set firmware settings on the VM" {
138
- Assert-MockCalled Set-VMFirmware -Times 0
139
- }
140
- }
141
-
142
- Context "When DisableSecureBoot is True and Generation is 1" {
143
- New-KitchenVM -Generation 1 -DisableSecureBoot $true
144
-
145
- It "Should not set firmware settings on the VM" {
146
- Assert-MockCalled Set-VMFirmware -Times 0
147
- }
148
- }
149
-
150
- Context "When DisableSecureBoot is True and Generation is 2" {
151
- New-KitchenVM -Generation 2 -DisableSecureBoot $true
152
-
153
- It "Should disable secure boot on the VM" {
154
- Assert-MockCalled Set-VMFirmware -Times 1 -ParameterFilter {
155
- $VM -eq $null -and
156
- $EnableSecureBoot -eq "Off"
157
- }
158
- }
159
- }
160
- }
161
-
162
- Describe "New-KitchenVM with StaticMacAddress" {
163
- function New-VM {}
164
- function Set-VM {}
165
- function Set-VMMemory {}
166
- function Set-VMNetworkAdapter {param ($VM, $StaticMacAddress)}
167
- function Start-VM {}
168
-
169
- Mock New-VM
170
- Mock Set-VM
171
- Mock Set-VMMemory
172
- Mock Set-VMNetworkAdapter
173
- Mock Start-VM
174
-
175
- Context "When StaticMacAddress is not specified" {
176
- New-KitchenVM -StaticMacAddress ""
177
-
178
- It "Should not set the StaticMacAddress for the VM" {
179
- Assert-MockCalled Set-VMNetworkAdapter -Times 1
180
- }
181
- }
182
-
183
- Context "When StaticMacAddress is specified" {
184
- $testStaticMacAddress = "00155D01B532"
185
- New-KitchenVM -StaticMacAddress $testStaticMacAddress
186
-
187
- It "Should set the StaticMacAddress for the VM" {
188
- Assert-MockCalled Set-VMNetworkAdapter -Times 1 -ParameterFilter {
189
- $VM -eq $VM.VMName -and
190
- $StaticMacAddress -eq $testStaticMacAddress
191
- }
192
- }
193
- }
194
- }