Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Alexandr Morozov authored on 2014/06/17 16:49:07... | ... |
@@ -1358,3 +1358,26 @@ func TestBuildOnBuildForbiddenMaintainer(t *testing.T) { |
1358 | 1358 |
} |
1359 | 1359 |
logDone("build - onbuild forbidden maintainer") |
1360 | 1360 |
} |
1361 |
+ |
|
1362 |
+// gh #2446 |
|
1363 |
+func TestBuildAddToSymlinkDest(t *testing.T) { |
|
1364 |
+ name := "testbuildaddtosymlinkdest" |
|
1365 |
+ defer deleteImages(name) |
|
1366 |
+ ctx, err := fakeContext(`FROM busybox |
|
1367 |
+ RUN mkdir /foo |
|
1368 |
+ RUN ln -s /foo /bar |
|
1369 |
+ ADD foo /bar/ |
|
1370 |
+ RUN [ -f /bar/foo ] |
|
1371 |
+ RUN [ -f /foo/foo ]`, |
|
1372 |
+ map[string]string{ |
|
1373 |
+ "foo": "hello", |
|
1374 |
+ }) |
|
1375 |
+ if err != nil { |
|
1376 |
+ t.Fatal(err) |
|
1377 |
+ } |
|
1378 |
+ defer ctx.Close() |
|
1379 |
+ if _, err := buildImageFromContext(name, ctx, true); err != nil { |
|
1380 |
+ t.Fatal(err) |
|
1381 |
+ } |
|
1382 |
+ logDone("build - add to symlink destination") |
|
1383 |
+} |
... | ... |
@@ -412,21 +412,3 @@ func buildImage(context testContextTemplate, t *testing.T, eng *engine.Engine, u |
412 | 412 |
err = json.NewDecoder(buffer).Decode(image) |
413 | 413 |
return image, err |
414 | 414 |
} |
415 |
- |
|
416 |
-// gh #2446 |
|
417 |
-func TestBuildAddToSymlinkDest(t *testing.T) { |
|
418 |
- eng := NewTestEngine(t) |
|
419 |
- defer nuke(mkDaemonFromEngine(eng, t)) |
|
420 |
- |
|
421 |
- _, err := buildImage(testContextTemplate{` |
|
422 |
- from {IMAGE} |
|
423 |
- run mkdir /foo |
|
424 |
- run ln -s /foo /bar |
|
425 |
- add foo /bar/ |
|
426 |
- run stat /bar/foo |
|
427 |
- `, |
|
428 |
- [][2]string{{"foo", "HEYO"}}, nil}, t, eng, true) |
|
429 |
- if err != nil { |
|
430 |
- t.Fatal(err) |
|
431 |
- } |
|
432 |
-} |