# HG changeset patch # User Goffi # Date 1606491065 -3600 # Node ID f023f06fa34465f550274b7aa7fdd3b0df443f7a # Parent 8c25489bb79c822a1e4e504a410b1e00d18ed38b docker (backend_e2e): added packages necessary to test Libervia + some debugging tools diff -r 8c25489bb79c -r f023f06fa344 docker/backend_e2e/Dockerfile --- a/docker/backend_e2e/Dockerfile Fri Nov 27 16:29:06 2020 +0100 +++ b/docker/backend_e2e/Dockerfile Fri Nov 27 16:31:05 2020 +0100 @@ -4,6 +4,23 @@ USER root +ARG DEBIAN_FRONTEND=noninteractive + +RUN mkdir -m 777 /reports && \ + apt-get install -y --no-install-recommends \ + # firefox is needed to test Libervia via selenium + firefox-esr \ + # VNC/X11 server for visual mode + window manager + # using openbox as it allows to resize easily when doing manual debugging/tests + # and it adapts correctly when doing driver.set_window_size + tigervnc-standalone-server openbox \ + # useful for remote debugging + telnet net-tools \ + # needed to make Firefox trust system certificates + # cf. https://askubuntu.com/a/1036637 + p11-kit && \ + ln -fs /usr/lib/x86_64-linux-gnu/pkcs11/p11-kit-trust.so /usr/lib/firefox-esr/libnssckbi.so + # we install pre-generated certificates so we can do tests with valid TLS COPY --chown=root:root certificates/minica.pem /usr/local/share/ca-certificates/minica.crt COPY --chown=root:tls-cert certificates/server1.test/cert.pem /usr/share/sat/certificates/server1.test.pem @@ -12,11 +29,40 @@ COPY --chown=root:root sat.conf /etc/sat.conf +RUN \ + # we install webdriver (needed to control Firefox from Selenium) + # note: this is not absolutely necessary as long as we use helium because it includes + # is own webdriver + python -c 'from urllib.request import urlretrieve;\ + urlretrieve(\ + "https://github.com/mozilla/geckodriver/releases/download/v0.28.0"\ + "/geckodriver-v0.28.0-linux64.tar.gz", "/usr/local/bin/geckodriver.tar.gz")' && \ + cd /usr/local/bin && tar zxf geckodriver.tar.gz && rm -f geckodriver.tar.gz + WORKDIR /home/sat USER sat -RUN pip install pytest sh +RUN \ + # pytest and its plugins + pip install pytest pytest-timeout \ + # needed to test jp + sh \ + # needed to test libervia + helium \ + # needed to check sent emails + aiosmtpd \ + # useful for debugging + pudb + RUN ./entrypoint.sh \ # we create the file sharing component which will autoconnect when backend is started jp profile create file_sharing -j files.server1.test -p "" --xmpp-password test_e2e -C file_sharing -A && \ sat stop + +ENV SAT_TEST_REPORT_DIR=/reports +ENV DISPLAY=:0 +USER root +RUN apt-get install -y openbox +USER sat +CMD /usr/bin/Xtigervnc -geometry 1024x768 -desktop "SàT e2e test" -rfbport 5900 -SecurityTypes None :0 & sleep 1 && openbox +EXPOSE 5900