kitchen-hyperv 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +117 -92
- data/Gemfile +15 -15
- data/README.md +5 -0
- data/Rakefile +39 -39
- data/kitchen-hyperv.gemspec +32 -32
- data/lib/kitchen/driver/hyperv.rb +18 -1
- data/lib/kitchen/driver/hyperv_version.rb +22 -22
- data/lib/kitchen/driver/powershell.rb +236 -235
- data/spec/support/hyperv.Tests.ps1 +194 -160
- data/support/hyperv.ps1 +5 -0
- 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: f38aa0c96d1a11f6550fca5b6d5495208eda6ddd
|
4
|
+
data.tar.gz: 90d19dc17e48f18e170355f17b9db13055add317
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9338c50b2927f9604bdacbdf2567d9924c8988e05af5f72548b8747b9c10b8b77304aa13a3a94b2a934acf52cb0171972a809b6f98588eaf8701b2a12fbf406
|
7
|
+
data.tar.gz: 1b2169fa0f88fea07cd9e8ace57de159a2e31f15585cfc49024eabe5966ddcf27625b275789cc2f42b9ea366642ceb4ee912332e99c62c10e1c08fb561d55407
|
data/CHANGELOG.md
CHANGED
@@ -1,93 +1,118 @@
|
|
1
|
-
# Change Log
|
2
|
-
|
3
|
-
## [v0.
|
4
|
-
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.
|
5
|
-
|
6
|
-
**Merged pull requests:**
|
7
|
-
|
8
|
-
-
|
9
|
-
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
-
|
26
|
-
|
27
|
-
|
28
|
-
[
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
-
|
36
|
-
-
|
37
|
-
|
38
|
-
## [v0.
|
39
|
-
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.
|
40
|
-
|
41
|
-
**Merged pull requests:**
|
42
|
-
|
43
|
-
-
|
44
|
-
|
45
|
-
## [v0.
|
46
|
-
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
[
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
[
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
-
|
82
|
-
|
83
|
-
|
84
|
-
[
|
85
|
-
|
86
|
-
|
87
|
-
**Merged pull requests:**
|
88
|
-
|
89
|
-
-
|
90
|
-
|
91
|
-
|
92
|
-
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
## [v0.5.0](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.5.0) (2017-07-05)
|
4
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.4.1...v0.5.0)
|
5
|
+
|
6
|
+
**Merged pull requests:**
|
7
|
+
|
8
|
+
- Fixed issue with existing stale diff disk [\#53](https://github.com/test-kitchen/kitchen-hyperv/pull/53) ([jdoores](https://github.com/jdoores))
|
9
|
+
- Added static\_mac\_address feature [\#52](https://github.com/test-kitchen/kitchen-hyperv/pull/52) ([jdoores](https://github.com/jdoores))
|
10
|
+
|
11
|
+
## [v0.4.1](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.4.1) (2017-03-29)
|
12
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.4.0...v0.4.1)
|
13
|
+
|
14
|
+
**Merged pull requests:**
|
15
|
+
|
16
|
+
- Fix error when no additional disks [\#48](https://github.com/test-kitchen/kitchen-hyperv/pull/48) ([smurawski](https://github.com/smurawski))
|
17
|
+
|
18
|
+
## [v0.4.0](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.4.0) (2017-03-24)
|
19
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.3.0...v0.4.0)
|
20
|
+
|
21
|
+
**Merged pull requests:**
|
22
|
+
|
23
|
+
- Feature/disable secureboot [\#44](https://github.com/test-kitchen/kitchen-hyperv/pull/44) ([smastrorocco](https://github.com/smastrorocco))
|
24
|
+
- Feature/additional disk [\#43](https://github.com/test-kitchen/kitchen-hyperv/pull/43) ([smastrorocco](https://github.com/smastrorocco))
|
25
|
+
- Feature/vlan support [\#41](https://github.com/test-kitchen/kitchen-hyperv/pull/41) ([smastrorocco](https://github.com/smastrorocco))
|
26
|
+
- 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))
|
27
|
+
|
28
|
+
## [v0.3.0](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.3.0) (2016-11-28)
|
29
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.2.3...v0.3.0)
|
30
|
+
|
31
|
+
**Merged pull requests:**
|
32
|
+
|
33
|
+
- Support setting VM notes [\#39](https://github.com/test-kitchen/kitchen-hyperv/pull/39) ([watsonlu](https://github.com/watsonlu))
|
34
|
+
- Fix mounting iso on Gen 2 VM [\#38](https://github.com/test-kitchen/kitchen-hyperv/pull/38) ([mahsoud](https://github.com/mahsoud))
|
35
|
+
- Adding support for HyperV Guest Interface Services [\#34](https://github.com/test-kitchen/kitchen-hyperv/pull/34) ([gaelcolas](https://github.com/gaelcolas))
|
36
|
+
- Fix line continuation syntax [\#32](https://github.com/test-kitchen/kitchen-hyperv/pull/32) ([brantb](https://github.com/brantb))
|
37
|
+
|
38
|
+
## [v0.2.3](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.2.3) (2016-06-10)
|
39
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.2.2...v0.2.3)
|
40
|
+
|
41
|
+
**Merged pull requests:**
|
42
|
+
|
43
|
+
- Support PowerShell v5.1 on the Insider Preview - updated [\#31](https://github.com/test-kitchen/kitchen-hyperv/pull/31) ([smurawski](https://github.com/smurawski))
|
44
|
+
|
45
|
+
## [v0.2.2](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.2.2) (2016-06-10)
|
46
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.2.1...v0.2.2)
|
47
|
+
|
48
|
+
**Merged pull requests:**
|
49
|
+
|
50
|
+
- Support PowerShell v5.1 on the Insider Preview [\#30](https://github.com/test-kitchen/kitchen-hyperv/pull/30) ([smurawski](https://github.com/smurawski))
|
51
|
+
|
52
|
+
## [v0.2.1](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.2.1) (2016-05-25)
|
53
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.20...v0.2.1)
|
54
|
+
|
55
|
+
## [v0.1.20](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.20) (2016-05-17)
|
56
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.10...v0.1.20)
|
57
|
+
|
58
|
+
**Merged pull requests:**
|
59
|
+
|
60
|
+
- More Configurable VM Networking [\#27](https://github.com/test-kitchen/kitchen-hyperv/pull/27) ([svmastersamurai](https://github.com/svmastersamurai))
|
61
|
+
- 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))
|
62
|
+
|
63
|
+
## [v0.1.10](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.10) (2015-12-03)
|
64
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.9...v0.1.10)
|
65
|
+
|
66
|
+
**Merged pull requests:**
|
67
|
+
|
68
|
+
- update incorrect module name [\#21](https://github.com/test-kitchen/kitchen-hyperv/pull/21) ([jbruettcva](https://github.com/jbruettcva))
|
69
|
+
|
70
|
+
## [v0.1.9](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.9) (2015-12-03)
|
71
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.8...v0.1.9)
|
72
|
+
|
73
|
+
## [v0.1.8](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.8) (2015-12-03)
|
74
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.7...v0.1.8)
|
75
|
+
|
76
|
+
**Merged pull requests:**
|
77
|
+
|
78
|
+
- Updating readme.md to include image configuration, specifically winrm… [\#20](https://github.com/test-kitchen/kitchen-hyperv/pull/20) ([jbruettcva](https://github.com/jbruettcva))
|
79
|
+
- Hyper-V module and Get-VMIP delay fix [\#19](https://github.com/test-kitchen/kitchen-hyperv/pull/19) ([jbruettcva](https://github.com/jbruettcva))
|
80
|
+
- File copy feature [\#17](https://github.com/test-kitchen/kitchen-hyperv/pull/17) ([dpiessens](https://github.com/dpiessens))
|
81
|
+
- Fixed NilClass exception if VM does not exist [\#16](https://github.com/test-kitchen/kitchen-hyperv/pull/16) ([dpiessens](https://github.com/dpiessens))
|
82
|
+
- Add support for dynamic memory [\#15](https://github.com/test-kitchen/kitchen-hyperv/pull/15) ([brantb](https://github.com/brantb))
|
83
|
+
|
84
|
+
## [v0.1.7](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.7) (2015-07-14)
|
85
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.6...v0.1.7)
|
86
|
+
|
87
|
+
**Merged pull requests:**
|
88
|
+
|
89
|
+
- 64-bit windows support [\#8](https://github.com/test-kitchen/kitchen-hyperv/pull/8) ([ksubrama](https://github.com/ksubrama))
|
90
|
+
|
91
|
+
## [v0.1.6](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.6) (2015-06-25)
|
92
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.5...v0.1.6)
|
93
|
+
|
94
|
+
## [v0.1.5](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.5) (2015-06-24)
|
95
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.2...v0.1.5)
|
96
|
+
|
97
|
+
**Merged pull requests:**
|
98
|
+
|
99
|
+
- Adding support for mounting ISOs [\#6](https://github.com/test-kitchen/kitchen-hyperv/pull/6) ([smurawski](https://github.com/smurawski))
|
100
|
+
|
101
|
+
## [v0.1.2](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.2) (2015-05-20)
|
102
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.1...v0.1.2)
|
103
|
+
|
104
|
+
**Merged pull requests:**
|
105
|
+
|
106
|
+
- Smurawski/updating metadata [\#4](https://github.com/test-kitchen/kitchen-hyperv/pull/4) ([smurawski](https://github.com/smurawski))
|
107
|
+
|
108
|
+
## [v0.1.1](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.1) (2015-05-20)
|
109
|
+
[Full Changelog](https://github.com/test-kitchen/kitchen-hyperv/compare/v0.1.0...v0.1.1)
|
110
|
+
|
111
|
+
## [v0.1.0](https://github.com/test-kitchen/kitchen-hyperv/tree/v0.1.0) (2015-05-20)
|
112
|
+
**Merged pull requests:**
|
113
|
+
|
114
|
+
- Prepping for release [\#3](https://github.com/test-kitchen/kitchen-hyperv/pull/3) ([smurawski](https://github.com/smurawski))
|
115
|
+
|
116
|
+
|
117
|
+
|
93
118
|
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
data/Gemfile
CHANGED
@@ -1,15 +1,15 @@
|
|
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
|
+
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'
|
data/README.md
CHANGED
@@ -101,6 +101,11 @@ driver:
|
|
101
101
|
dest: c:/users/administrator/appdata/local/temp/chef-client-12.19.36-1-x64.msi
|
102
102
|
```
|
103
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
|
+
|
104
109
|
|
105
110
|
## Image Configuration
|
106
111
|
|
data/Rakefile
CHANGED
@@ -1,39 +1,39 @@
|
|
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
|
-
desc "Display LOC stats"
|
17
|
-
task :stats do
|
18
|
-
puts "\n## Production Code Stats"
|
19
|
-
sh "countloc -r lib"
|
20
|
-
puts "\n## Test Code Stats"
|
21
|
-
sh "countloc -r spec"
|
22
|
-
end
|
23
|
-
|
24
|
-
task :default => [:test]
|
25
|
-
|
26
|
-
begin
|
27
|
-
require "github_changelog_generator/task"
|
28
|
-
|
29
|
-
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
30
|
-
config.future_release = "v#{Kitchen::Driver::HYPERV_VERSION}"
|
31
|
-
config.issues = false
|
32
|
-
config.pulls = true
|
33
|
-
config.user = 'test-kitchen'
|
34
|
-
config.project = 'kitchen-hyperv'
|
35
|
-
end
|
36
|
-
rescue LoadError
|
37
|
-
puts "github_changelog_generator is not available. " \
|
38
|
-
"gem install github_changelog_generator to generate changelogs"
|
39
|
-
end
|
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
|
+
desc "Display LOC stats"
|
17
|
+
task :stats do
|
18
|
+
puts "\n## Production Code Stats"
|
19
|
+
sh "countloc -r lib"
|
20
|
+
puts "\n## Test Code Stats"
|
21
|
+
sh "countloc -r spec"
|
22
|
+
end
|
23
|
+
|
24
|
+
task :default => [:test]
|
25
|
+
|
26
|
+
begin
|
27
|
+
require "github_changelog_generator/task"
|
28
|
+
|
29
|
+
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
30
|
+
config.future_release = "v#{Kitchen::Driver::HYPERV_VERSION}"
|
31
|
+
config.issues = false
|
32
|
+
config.pulls = true
|
33
|
+
config.user = 'test-kitchen'
|
34
|
+
config.project = 'kitchen-hyperv'
|
35
|
+
end
|
36
|
+
rescue LoadError
|
37
|
+
puts "github_changelog_generator is not available. " \
|
38
|
+
"gem install github_changelog_generator to generate changelogs"
|
39
|
+
end
|
data/kitchen-hyperv.gemspec
CHANGED
@@ -1,32 +1,32 @@
|
|
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
|
+
# 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
|
@@ -55,6 +55,7 @@ module Kitchen
|
|
55
55
|
default_config :additional_disks
|
56
56
|
default_config :vm_generation, 1
|
57
57
|
default_config :disable_secureboot, false
|
58
|
+
default_config :static_mac_address
|
58
59
|
default_config :disk_type do |driver|
|
59
60
|
File.extname(driver[:parent_vhd_name])
|
60
61
|
end
|
@@ -77,6 +78,9 @@ module Kitchen
|
|
77
78
|
|
78
79
|
def destroy(state)
|
79
80
|
@state = state
|
81
|
+
if differencing_disk_exists && !vm_exists_silent
|
82
|
+
remove_differencing_disk
|
83
|
+
end
|
80
84
|
return unless vm_exists
|
81
85
|
instance.transport.connection(state).close
|
82
86
|
remove_virtual_machine
|
@@ -113,7 +117,6 @@ module Kitchen
|
|
113
117
|
end
|
114
118
|
|
115
119
|
def create_new_differencing_disk
|
116
|
-
return if File.exist? differencing_disk_path
|
117
120
|
info("Creating differencing disk for #{instance.name}.")
|
118
121
|
run_ps new_differencing_disk_ps
|
119
122
|
info("Created differencing disk for #{instance.name}.")
|
@@ -204,6 +207,20 @@ module Kitchen
|
|
204
207
|
true
|
205
208
|
end
|
206
209
|
|
210
|
+
# Used in testing if a stale diff disk exists. Silent so the output doesn't
|
211
|
+
# appear twice on the kitchen destroy command for the second check for vm_exists
|
212
|
+
def vm_exists_silent
|
213
|
+
return false unless @state.key?(:id) && !@state[:id].nil?
|
214
|
+
existing_vm = run_ps ensure_vm_running_ps
|
215
|
+
return false if existing_vm.nil? || existing_vm['Id'].nil?
|
216
|
+
true
|
217
|
+
end
|
218
|
+
|
219
|
+
def differencing_disk_exists
|
220
|
+
return unless File.exist? differencing_disk_path
|
221
|
+
true
|
222
|
+
end
|
223
|
+
|
207
224
|
def remove_virtual_machine
|
208
225
|
info("Deleting virtual machine for #{instance.name}")
|
209
226
|
run_ps delete_vm_ps
|