@@ -44,6 +44,18 @@ func TestBuildBindMount(t *testing.T) {
4444 assert .Equal (t , mount .Type , mountTypes .TypeBind )
4545}
4646
47+ func TestBuildNamedPipeMount (t * testing.T ) {
48+ project := composetypes.Project {}
49+ volume := composetypes.ServiceVolumeConfig {
50+ Type : composetypes .VolumeTypeNamedPipe ,
51+ Source : "\\ \\ .\\ pipe\\ docker_engine_windows" ,
52+ Target : "\\ \\ .\\ pipe\\ docker_engine" ,
53+ }
54+ mount , err := buildMount (project , volume )
55+ assert .NilError (t , err )
56+ assert .Equal (t , mount .Type , mountTypes .TypeNamedPipe )
57+ }
58+
4759func TestBuildVolumeMount (t * testing.T ) {
4860 project := composetypes.Project {
4961 Name : "myProject" ,
@@ -97,6 +109,11 @@ func TestBuildContainerMountOptions(t *testing.T) {
97109 Type : composetypes .VolumeTypeVolume ,
98110 Target : "/var/myvolume2" ,
99111 },
112+ {
113+ Type : composetypes .VolumeTypeNamedPipe ,
114+ Source : "\\ \\ .\\ pipe\\ docker_engine_windows" ,
115+ Target : "\\ \\ .\\ pipe\\ docker_engine" ,
116+ },
100117 },
101118 },
102119 },
@@ -128,18 +145,20 @@ func TestBuildContainerMountOptions(t *testing.T) {
128145 return mounts [i ].Target < mounts [j ].Target
129146 })
130147 assert .NilError (t , err )
131- assert .Assert (t , len (mounts ) == 2 )
148+ assert .Assert (t , len (mounts ) == 3 )
132149 assert .Equal (t , mounts [0 ].Target , "/var/myvolume1" )
133150 assert .Equal (t , mounts [1 ].Target , "/var/myvolume2" )
151+ assert .Equal (t , mounts [2 ].Target , "\\ \\ .\\ pipe\\ docker_engine" )
134152
135153 mounts , err = buildContainerMountOptions (project , project .Services [0 ], moby.ImageInspect {}, inherit )
136154 sort .Slice (mounts , func (i , j int ) bool {
137155 return mounts [i ].Target < mounts [j ].Target
138156 })
139157 assert .NilError (t , err )
140- assert .Assert (t , len (mounts ) == 2 )
158+ assert .Assert (t , len (mounts ) == 3 )
141159 assert .Equal (t , mounts [0 ].Target , "/var/myvolume1" )
142160 assert .Equal (t , mounts [1 ].Target , "/var/myvolume2" )
161+ assert .Equal (t , mounts [2 ].Target , "\\ \\ .\\ pipe\\ docker_engine" )
143162}
144163
145164func TestGetDefaultNetworkMode (t * testing.T ) {
0 commit comments