diff --git a/.circleci/config.yml b/.circleci/config.yml index b1209dd1b..4bd4b79b8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,6 +36,7 @@ jobs: - run: ./build.sh ubuntu-systemd-xenial - run: ./build.sh no-entrypoint - run: ./build.sh ignore-signals + - run: ./build.sh pty ci-builder: docker: - image: docker:17.05.0-ce-git diff --git a/executor/mock/standalone/standalone_test.go b/executor/mock/standalone/standalone_test.go index a02391e78..3f0743cd4 100644 --- a/executor/mock/standalone/standalone_test.go +++ b/executor/mock/standalone/standalone_test.go @@ -61,6 +61,10 @@ var ( name: "titusoss/ignore-signals", tag: "20180501-1525157636", } + pty = testImage{ + name: "titusoss/pty", + tag: "20180507-1525733149", + } ) // This file still uses log as opposed to using the testing library's built-in logging framework. @@ -88,6 +92,7 @@ func TestStandalone(t *testing.T) { testMetadataProxyInjection, testMetdataProxyDefaultRoute, testTerminateTimeout, + testMakesPTY, } for _, fun := range testFunctions { fullName := runtime.FuncForPC(reflect.ValueOf(fun).Pointer()).Name() @@ -208,6 +213,18 @@ func testDefaultCapabilities(t *testing.T, jobID string) { } } +func testMakesPTY(t *testing.T, jobID string) { + ji := &mock.JobInput{ + ImageName: pty.name, + Version: pty.tag, + Entrypoint: "/bin/bash -c '/usr/bin/unbuffer /usr/bin/tty | grep /dev/pts'", + JobID: jobID, + } + if !mock.RunJobExpectingSuccess(ji, false) { + t.Fail() + } +} + func testStdoutGoesToLogFile(t *testing.T, jobID string) { message := fmt.Sprintf("Some message with ID=%s, and a suffix.", uuid.New()) cmd := fmt.Sprintf(`sh -c 'echo "%[1]s" && sleep 1 && grep "%[1]s" /logs/stdout'`, message) diff --git a/hack/test-images/pty/Dockerfile b/hack/test-images/pty/Dockerfile new file mode 100644 index 000000000..832bb29bf --- /dev/null +++ b/hack/test-images/pty/Dockerfile @@ -0,0 +1,2 @@ +FROM ubuntu:xenial +RUN apt-get update && apt-get install -y expect coreutils