17004: Move output_properties to progress_attrs
[arvados.git] / lib / crunchrun / executor_test.go
index 08c7140add8245a39f029328d43ad1ff64114155..99af0530ff35dd55e2163c8726e09699b06d5852 100644 (file)
@@ -86,6 +86,22 @@ func (s *executorSuite) TestExecTrivialContainer(c *C) {
        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)