kitchen-hyperv 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e4e642af67fa6dbf7dd7ef08ef7606cf98d1b9ad
4
- data.tar.gz: e46fe0ffef97676104b6df51e1a0b58cf039317e
3
+ metadata.gz: bc8adc83fec3612c07e420580b9d9dadd136453f
4
+ data.tar.gz: ff2c67cd195c9e65790709aedeb7bd689f7c6ff7
5
5
  SHA512:
6
- metadata.gz: 2ed858d108232d6f6924576ed1303468f0bb6a0f9a420956d602a6871ba04dccfbce92a3c757a3cb26fb274efffe4abf4e4ab86abc4d62bb16427a95dde45dbe
7
- data.tar.gz: cf81b9412cdf7a56cbab5cb4c83fbf3c8223c4098e8054ee755a1f3fc8b286f8f2a556e3b5839a36deb332b3b800d5dc626b00b2ca8e2456b4be79c812fbd331
6
+ metadata.gz: e6115d39b205d23a10a48af908b4c2e6d4f09e8869cc3c93d1811a3c9d9a56771b33ecf6505c67c7141fb93fa87dfbef4e07ca5652dfff7529b5ccf97661e52a
7
+ data.tar.gz: 69c108c4a4bb8415ed18c2d1c046c32b43fc1de3e887bb5234b67e260a0bfcb18392389b0d7fa941cc5a83d6ba1f1abadcaab0ab1eade5ad504461fe02ebc7b5
@@ -40,6 +40,7 @@ module Kitchen
40
40
  default_config :processor_count, 2
41
41
  default_config :ip_address
42
42
  default_config :vm_switch
43
+ default_config :iso_path
43
44
 
44
45
  include Kitchen::Driver::PowerShellScripts
45
46
 
@@ -49,6 +50,7 @@ module Kitchen
49
50
  create_new_differencing_disk
50
51
  create_virtual_machine
51
52
  update_state
53
+ mount_virtual_machine_iso
52
54
  instance.transport.connection(@state).wait_until_ready
53
55
  info("Hyper-V instance #{instance.to_str} created.")
54
56
  end
@@ -65,6 +67,12 @@ module Kitchen
65
67
 
66
68
  private
67
69
 
70
+ def mount_virtual_machine_iso
71
+ return unless config[:iso_path]
72
+ info("Mounting #{config[:iso_path]}")
73
+ run_ps mount_vm_iso
74
+ end
75
+
68
76
  def validate_vm_settings
69
77
  return if config[:vm_switch]
70
78
  config[:vm_switch] = (run_ps vm_default_switch_ps)['Name']
@@ -17,6 +17,6 @@
17
17
 
18
18
  module Kitchen
19
19
  module Driver
20
- HYPERV_VERSION = '0.1.3'
20
+ HYPERV_VERSION = '0.1.4'
21
21
  end
22
22
  end
@@ -126,6 +126,12 @@ module Kitchen
126
126
  Get-DefaultVMSwitch | ConvertTo-Json
127
127
  VMSWITCH
128
128
  end
129
+
130
+ def mount_vm_iso
131
+ <<-MOUNTISO
132
+ mount-vmiso -id "#{@state[:id]}" -Path #{config[:iso_path]}
133
+ MOUNTISO
134
+ end
129
135
  end
130
136
  end
131
137
  end
data/support/hyperv.ps1 CHANGED
@@ -140,4 +140,12 @@ function Get-VmDetail
140
140
  function Get-DefaultVMSwitch
141
141
  {
142
142
  Get-VMSwitch | Select -First 1
143
+ }
144
+
145
+ function Mount-VMISO {
146
+ [cmdletbinding()]
147
+ param($Id, $Path)
148
+
149
+ set-VMDvdDrive -VMName (get-vm -id $Id).Name -Path $Path
150
+
143
151
  }
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.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Murawski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-12 00:00:00.000000000 Z
11
+ date: 2015-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler