@@ -44,6 +44,18 @@ func TestBuildBindMount(t *testing.T) {
44
44
assert .Equal (t , mount .Type , mountTypes .TypeBind )
45
45
}
46
46
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
+
47
59
func TestBuildVolumeMount (t * testing.T ) {
48
60
project := composetypes.Project {
49
61
Name : "myProject" ,
@@ -97,6 +109,11 @@ func TestBuildContainerMountOptions(t *testing.T) {
97
109
Type : composetypes .VolumeTypeVolume ,
98
110
Target : "/var/myvolume2" ,
99
111
},
112
+ {
113
+ Type : composetypes .VolumeTypeNamedPipe ,
114
+ Source : "\\ \\ .\\ pipe\\ docker_engine_windows" ,
115
+ Target : "\\ \\ .\\ pipe\\ docker_engine" ,
116
+ },
100
117
},
101
118
},
102
119
},
@@ -128,18 +145,20 @@ func TestBuildContainerMountOptions(t *testing.T) {
128
145
return mounts [i ].Target < mounts [j ].Target
129
146
})
130
147
assert .NilError (t , err )
131
- assert .Assert (t , len (mounts ) == 2 )
148
+ assert .Assert (t , len (mounts ) == 3 )
132
149
assert .Equal (t , mounts [0 ].Target , "/var/myvolume1" )
133
150
assert .Equal (t , mounts [1 ].Target , "/var/myvolume2" )
151
+ assert .Equal (t , mounts [2 ].Target , "\\ \\ .\\ pipe\\ docker_engine" )
134
152
135
153
mounts , err = buildContainerMountOptions (project , project .Services [0 ], moby.ImageInspect {}, inherit )
136
154
sort .Slice (mounts , func (i , j int ) bool {
137
155
return mounts [i ].Target < mounts [j ].Target
138
156
})
139
157
assert .NilError (t , err )
140
- assert .Assert (t , len (mounts ) == 2 )
158
+ assert .Assert (t , len (mounts ) == 3 )
141
159
assert .Equal (t , mounts [0 ].Target , "/var/myvolume1" )
142
160
assert .Equal (t , mounts [1 ].Target , "/var/myvolume2" )
161
+ assert .Equal (t , mounts [2 ].Target , "\\ \\ .\\ pipe\\ docker_engine" )
143
162
}
144
163
145
164
func TestGetDefaultNetworkMode (t * testing.T ) {
0 commit comments