X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/86660414472d4ff0d8267f9845a753497bd41692..9b0de8314d6297df506734844bb2b833ba7d022c:/lib/crunchrun/executor_test.go diff --git a/lib/crunchrun/executor_test.go b/lib/crunchrun/executor_test.go index ea6e610d8b..e757f579fe 100644 --- a/lib/crunchrun/executor_test.go +++ b/lib/crunchrun/executor_test.go @@ -8,12 +8,14 @@ import ( "bytes" "fmt" "io" + "io/ioutil" "net" "net/http" "os" "strings" "time" + "git.arvados.org/arvados.git/lib/diagnostics" "git.arvados.org/arvados.git/sdk/go/arvados" "git.arvados.org/arvados.git/sdk/go/arvadostest" "golang.org/x/net/context" @@ -63,6 +65,21 @@ func (s *executorSuite) TestExecTrivialContainer(c *C) { c.Check(s.stderr.String(), Equals, "") } +func (s *executorSuite) TestDiagnosticsImage(c *C) { + s.newExecutor(c) + imagefile := c.MkDir() + "/hello-world.tar" + err := ioutil.WriteFile(imagefile, diagnostics.HelloWorldDockerImage, 0777) + c.Assert(err, IsNil) + err = s.executor.LoadImage("", imagefile, arvados.Container{}, "", nil) + c.Assert(err, IsNil) + + c.Logf("Using container runtime: %s", s.executor.Runtime()) + s.spec.Image = "hello-world" + s.spec.Command = []string{"/hello"} + s.checkRun(c, 0) + c.Check(s.stdout.String(), Matches, `(?ms)\nHello from Docker!\n.*`) +} + func (s *executorSuite) TestExitStatus(c *C) { s.spec.Command = []string{"false"} s.checkRun(c, 1)