From 51b93736d60f7ca1fa64484a96675ccd1cd083cf Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Sat, 29 Jun 2013 21:22:15 -0700 Subject: [PATCH] * Hack: change builder tests to always use the current unit test image, instead of hardcoding 'docker-ut' Upstream-commit: 273e0d42b7bd56f263d4d2d95fb27a692b875377 Component: engine --- components/engine/buildfile_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/components/engine/buildfile_test.go b/components/engine/buildfile_test.go index e64b108660..c2ae79f199 100644 --- a/components/engine/buildfile_test.go +++ b/components/engine/buildfile_test.go @@ -4,12 +4,13 @@ import ( "io/ioutil" "sync" "testing" + "fmt" ) // mkTestContext generates a build context from the contents of the provided dockerfile. // This context is suitable for use as an argument to BuildFile.Build() func mkTestContext(dockerfile string, files [][2]string, t *testing.T) Archive { - context, err := mkBuildContext(dockerfile, files) + context, err := mkBuildContext(fmt.Sprintf(dockerfile, unitTestImageId), files) if err != nil { t.Fatal(err) } @@ -29,7 +30,7 @@ type testContextTemplate struct { var testContexts []testContextTemplate = []testContextTemplate{ { ` -from docker-ut +from %s run sh -c 'echo root:testpass > /tmp/passwd' run mkdir -p /var/run/sshd run [ "$(cat /tmp/passwd)" = "root:testpass" ] @@ -40,7 +41,7 @@ run [ "$(ls -d /var/run/sshd)" = "/var/run/sshd" ] { ` -from docker-ut +from %s add foo /usr/lib/bla/bar run [ "$(cat /usr/lib/bla/bar)" = 'hello world!' ] `, @@ -49,7 +50,7 @@ run [ "$(cat /usr/lib/bla/bar)" = 'hello world!' ] { ` -from docker-ut +from %s add f / run [ "$(cat /f)" = "hello" ] add f /abc @@ -75,7 +76,7 @@ run [ "$(cat /somewheeeere/over/the/rainbooow/ga)" = "bu" ] { ` -from docker-ut +from %s env FOO BAR run [ "$FOO" = "BAR" ] `,