From ec1de4b4b920959f73d5b5d23d3a2ba3d9f30889 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 5 Dec 2017 02:01:19 +0530 Subject: [PATCH] tests: ensure strace is available in the docker image.. ..and enable privileged=True since that's needed for ptrace() --- tests/build_docker_image.py | 2 ++ tests/testlib.py | 1 + 2 files changed, 3 insertions(+) diff --git a/tests/build_docker_image.py b/tests/build_docker_image.py index c64c985a..99a34ab0 100755 --- a/tests/build_docker_image.py +++ b/tests/build_docker_image.py @@ -40,6 +40,8 @@ RUN echo "export VISIBLE=now" >> /etc/profile EXPOSE 22 CMD ["/usr/sbin/sshd", "-D"] + +RUN apt-get install -y strace && apt-get clean && { echo '#!/bin/bash\nexec strace -ff -o /tmp/pywrap$$.trace python2.7 "$@"' > /usr/local/bin/pywrap; chmod +x /usr/local/bin/pywrap; } """ diff --git a/tests/testlib.py b/tests/testlib.py index 949b691c..a43c8b1d 100644 --- a/tests/testlib.py +++ b/tests/testlib.py @@ -134,6 +134,7 @@ class DockerizedSshDaemon(object): self.container = self.docker.containers.run( image='d2mw/mitogen-test', detach=True, + privileged=True, publish_all_ports=True, ) self.container.reload()