19094: Note docker/singularity/arv-mount versions in container log.
[arvados.git] / lib / crunchrun / executor_test.go
index 08c7140add8245a39f029328d43ad1ff64114155..3301a6e63be2d5a9210649268efbcf9b08eff204 100644 (file)
@@ -80,12 +80,29 @@ func (s *executorSuite) TearDownTest(c *C) {
 }
 
 func (s *executorSuite) TestExecTrivialContainer(c *C) {
+       c.Logf("Using container runtime: %s", s.executor.Runtime())
        s.spec.Command = []string{"echo", "ok"}
        s.checkRun(c, 0)
        c.Check(s.stdout.String(), Equals, "ok\n")
        c.Check(s.stderr.String(), Equals, "")
 }
 
+func (s *executorSuite) TestExitStatus(c *C) {
+       s.spec.Command = []string{"false"}
+       s.checkRun(c, 1)
+}
+
+func (s *executorSuite) TestSignalExitStatus(c *C) {
+       if _, isdocker := s.executor.(*dockerExecutor); isdocker {
+               // It's not quite this easy to make busybox kill
+               // itself in docker where it's pid 1.
+               c.Skip("kill -9 $$ doesn't work on busybox with pid=1 in docker")
+               return
+       }
+       s.spec.Command = []string{"sh", "-c", "kill -9 $$"}
+       s.checkRun(c, 0x80+9)
+}
+
 func (s *executorSuite) TestExecStop(c *C) {
        s.spec.Command = []string{"sh", "-c", "sleep 10; echo ok"}
        err := s.executor.Create(s.spec)