Skip to content

Commit 6d9a140

Browse files
author
Dave Try
committed
adding unit test for windows storage driver
1 parent 23f3f27 commit 6d9a140

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

manifests/init.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,13 +520,13 @@
520520
if $::osfamily == 'windows' {
521521
assert_type(Pattern[/^(windowsfilter)$/], $storage_driver) |$a, $b| {
522522
fail translate(('Valid values for storage_driver on windows are windowsfilter'))
523-
}
523+
}
524524
} else {
525525
assert_type(Pattern[/^(aufs|devicemapper|btrfs|overlay|overlay2|vfs|zfs)$/], $storage_driver) |$a, $b| {
526526
fail translate(('Valid values for storage_driver are aufs, devicemapper, btrfs, overlay, overlay2, vfs, zfs.'))
527527
}
528528
}
529-
}
529+
}
530530

531531
if ($bridge) and ($::osfamily == 'windows') {
532532
assert_type(Pattern[/^(none|nat|transparent|overlay|l2bridge|l2tunnel)$/], $bridge) |$a, $b| {

spec/classes/docker_windows_spec.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,27 @@
123123
}.to raise_error(Puppet::Error, /log_level must be one of debug, info, warn, error or fatal/)
124124
end
125125
end
126+
127+
context 'with storage_driver' do
128+
let(:params) { {
129+
'storage_driver' => 'windowsfilter',
130+
'docker_ee' => true
131+
} }
132+
it { should compile.with_all_deps }
133+
end
126134

135+
context 'with an invalid storage_driver' do
136+
let(:params) { {
137+
'storage_driver' => 'invalid',
138+
'docker_ee' => true
139+
} }
140+
it do
141+
expect {
142+
should contain_package('docker')
143+
}.to raise_error(Puppet::Error, /Valid values for storage_driver on windows are windowsfilter/)
144+
end
145+
end
146+
127147
context 'with tcp_bind' do
128148
let(:params) { {
129149
'tcp_bind' => "tcp://0.0.0.0:2376",

0 commit comments

Comments
 (0)