@@ -45,6 +45,10 @@ func TestParseV1V2_Version1_HappyPath(t *testing.T) {
45
45
"max-file" : aws .String ("50" ),
46
46
"max-size" : aws .String ("50k" ),
47
47
}
48
+ logging := & ecs.LogConfiguration {
49
+ LogDriver : logDriver ,
50
+ Options : logOpts ,
51
+ }
48
52
memory := int64 (953 ) // 1000000000 in Mib
49
53
mountPoints := []* ecs.MountPoint {
50
54
{
@@ -155,8 +159,7 @@ redis:
155
159
assert .Equal (t , hostname , web .Hostname , "Expected Hostname to match" )
156
160
assert .Equal (t , webImage , web .Image , "Expected Image to match" )
157
161
assert .Equal (t , links , web .Links , "Expected Links to match" )
158
- assert .Equal (t , logDriver , web .LogConfiguration .LogDriver , "Expected LogDriver to match" )
159
- assert .Equal (t , logOpts , web .LogConfiguration .Options , "Expected LogConfiguration options to match" )
162
+ assert .Equal (t , logging , web .LogConfiguration , "Expected LogConfiguration to match" )
160
163
assert .Equal (t , memory , web .Memory , "Expected memory to match" )
161
164
assert .Equal (t , mountPoints , web .MountPoints , "Expected MountPoints to match" )
162
165
assert .Equal (t , ports , web .PortMappings , "Expected PortMappings to match" )
@@ -174,12 +177,12 @@ func TestParseV1V2_Version2Files(t *testing.T) {
174
177
175
178
capAdd := []string {"ALL" }
176
179
capDrop := []string {"NET_ADMIN" , "SYS_ADMIN" }
177
- ports := [] * ecs. PortMapping {
178
- {
179
- ContainerPort : aws . Int64 ( 80 ),
180
- HostPort : aws . Int64 ( 80 ),
181
- Protocol : aws .String ("tcp " ),
182
- } ,
180
+ logOpts := map [ string ] * string {
181
+ "syslog-address" : aws . String ( "tcp://192.168.0.42:123" ),
182
+ }
183
+ logging := & ecs. LogConfiguration {
184
+ LogDriver : aws .String ("syslog " ),
185
+ Options : logOpts ,
183
186
}
184
187
memoryReservation := int64 (476 ) // 500000000 / miB
185
188
memory := int64 (512 )
@@ -200,6 +203,13 @@ func TestParseV1V2_Version2Files(t *testing.T) {
200
203
SourceVolume : aws .String ("volume-2" ),
201
204
},
202
205
}
206
+ ports := []* ecs.PortMapping {
207
+ {
208
+ ContainerPort : aws .Int64 (80 ),
209
+ HostPort : aws .Int64 (80 ),
210
+ Protocol : aws .String ("tcp" ),
211
+ },
212
+ }
203
213
shmSize := int64 (1024 ) // 1 gb = 1024 miB
204
214
tmpfs := []* ecs.Tmpfs {
205
215
{
@@ -230,6 +240,10 @@ services:
230
240
tmpfs:
231
241
- /run:size=1gb
232
242
- /tmp:size=65536k,ro,rw
243
+ logging:
244
+ driver: syslog
245
+ options:
246
+ syslog-address: "tcp://192.168.0.42:123"
233
247
mysql:
234
248
image: mysql
235
249
volumes:
@@ -266,6 +280,7 @@ volumes:
266
280
assert .Equal (t , wordpressImage , wordpress .Image , "Expected wordpress Image to match" )
267
281
assert .Equal (t , capAdd , wordpress .CapAdd , "Expected CapAdd to match" )
268
282
assert .Equal (t , capDrop , wordpress .CapDrop , "Expected CapDrop to match" )
283
+ assert .Equal (t , logging , wordpress .LogConfiguration , "Expected Log Configuration to match" )
269
284
270
285
assert .Equal (t , memoryReservation , wordpress .MemoryReservation , "Expected memoryReservation to match" )
271
286
assert .Equal (t , memory , wordpress .Memory , "Expected Memory to match" )
0 commit comments