forked from StefanScherer/packer-windows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
windows_vcloud.rb
81 lines (70 loc) · 2.36 KB
/
windows_vcloud.rb
1
2
3
4
5
6
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
39
40
41
42
43
44
45
46
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
require_relative 'spec_helper'
describe 'box' do
describe 'windows box' do
it 'should have a vagrant user' do
expect(user 'vagrant').to exist
end
end
# this tests if rsync works from bin/test-box-vcloud.bat
describe file('c:/vagrant/testdir/testfile.txt') do
it { should be_file }
it { should contain "Works" }
end
describe command('& rsync --version') do
it { should return_stdout(/rsync *version *3.1.0/) }
end
# check SSH
describe service('OpenSSH Server') do
it { should be_installed }
it { should be_enabled }
it { should be_running }
it { should have_start_mode("Automatic") }
end
describe port(22) do
it { should be_listening }
end
describe service('VMware Tools') do
it { should be_installed }
it { should be_enabled }
it { should be_running }
it { should have_start_mode("Automatic") }
end
# check WinRM
describe port(5985) do
it { should be_listening }
end
# check RDP
describe port(3389) do
it { should be_listening }
end
describe windows_registry_key('HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\fDenyTSConnections') do
it { should exist }
it { should have_property('dword value', :type_dword) }
it { should have_value('0') }
end
describe windows_registry_key('HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\UserAuthentication') do
it { should exist }
it { should have_property('dword value', :type_dword) }
it { should have_value('0') }
end
# check for 10 GBit vmxnet3 network adapter
describe command('& "ipconfig" /all') do
it { should return_stdout(/Description(\.| )*: vmxnet3/) }
end
# no Windows Updates, just manual updates, but Windows updates service is running
describe service('Windows Update') do
it { should be_installed }
it { should be_enabled }
it { should be_running }
it { should have_start_mode("Automatic") }
end
describe windows_registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\AUOptions') do
it { should exist }
it { should have_property('dword value', :type_dword) }
it { should have_value('1') }
end
# check time zone
describe command('& tzutil /g') do
it { should return_stdout(/W. Europe Standard Time/) }
end
end