Add tests for libcurl-impersonate

Test that libcurl-impersonate produces the desired TLS signature when
the CURL_IMPERSONATE env var is set. A small C program called "minicurl"
is linked to libcurl, and libcurl-impersonate is loaded at runtime with
LD_PRELOAD.
This commit is contained in:
lwthiker
2022-02-27 23:21:00 +02:00
parent 8714c4631c
commit 6dad23b4b8
3 changed files with 228 additions and 6 deletions

View File

@@ -3,7 +3,7 @@ FROM python:3.10.1-slim-buster
WORKDIR /tests
RUN apt-get update && \
apt-get install -y tcpdump libbrotli1 libnss3
apt-get install -y tcpdump libbrotli1 libnss3 gcc libcurl4-openssl-dev
COPY requirements.txt requirements.txt
@@ -18,4 +18,9 @@ COPY --from=curl-impersonate-chrome /build/out/* /tests/chrome/
COPY . .
# Compile 'minicurl' which is used for testing libcurl-impersonate.
# 'minicurl' is compiled against the "regular" libcurl.
# libcurl-impersonate will replace it at runtime via LD_PRELOAD.
RUN gcc -Wall -Werror -o minicurl minicurl.c `curl-config --libs`
ENTRYPOINT ["pytest"]