@@ -41,7 +41,7 @@ func TestConvertVolumeToMountUnapprovedType(t *testing.T) {
41
41
Target : "/foo/bar" ,
42
42
}
43
43
_ , err := convertVolumeToMount (config , volumes {}, NewNamespace ("foo" ))
44
- assert .Error (t , err , "volume type must be volume, bind, or tmpfs " )
44
+ assert .Error (t , err , "volume type must be volume, bind, tmpfs or npipe " )
45
45
}
46
46
47
47
func TestConvertVolumeToMountConflictingOptionsBindInVolume (t * testing.T ) {
@@ -343,3 +343,19 @@ func TestConvertTmpfsToMountVolumeWithSource(t *testing.T) {
343
343
_ , err := convertVolumeToMount (config , volumes {}, NewNamespace ("foo" ))
344
344
assert .Error (t , err , "invalid tmpfs source, source must be empty" )
345
345
}
346
+
347
+ func TestConvertVolumeToMountAnonymousNpipe (t * testing.T ) {
348
+ config := composetypes.ServiceVolumeConfig {
349
+ Type : "npipe" ,
350
+ Source : `\\.\pipe\foo` ,
351
+ Target : `\\.\pipe\foo` ,
352
+ }
353
+ expected := mount.Mount {
354
+ Type : mount .TypeNamedPipe ,
355
+ Source : `\\.\pipe\foo` ,
356
+ Target : `\\.\pipe\foo` ,
357
+ }
358
+ mount , err := convertVolumeToMount (config , volumes {}, NewNamespace ("foo" ))
359
+ assert .NilError (t , err )
360
+ assert .Check (t , is .DeepEqual (expected , mount ))
361
+ }
0 commit comments