Collect gitea sshd logs

Currently we don't have any logs from our gitea sshd processes because
sshd logs to syslog by default and /dev/log isn't in our containers. You
can ask sshd nicely to log to stderr instead with the -e flag which
docker will pick up and store for us.

Update the sshd command to include -e then use testinfra to check we
collect logs and they are accssible from docker.

Change-Id: Ib7d6d405554c3c30be410bc08c6fee7d4363b096
This commit is contained in:
Clark Boylan 2019-08-06 13:42:25 -07:00
parent 788d91df1f
commit 05e0ffdebc
2 changed files with 5 additions and 1 deletions

View File

@ -113,4 +113,4 @@ COPY sshd-entrypoint.sh /usr/bin/entrypoint
EXPOSE 22
VOLUME ["/data"]
ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/usr/sbin/sshd", "-D"]
CMD ["/usr/sbin/sshd", "-D", "-e"]

View File

@ -29,3 +29,7 @@ def test_ulimit(host):
expected = ("STACK max stack size "
"16777216 9223372036854775807 bytes")
assert expected in cmd.stdout.split('\n')
def test_sshd_logs(host):
cmd = host.run("docker logs giteadocker_gitea-ssh_1")
assert cmd.stdout != '' or cmd.stderr != ''