Skip to content

e2e: Provide e2e tests using docker

Vgutierrez requested to merge T353279 into main

end to end tests leveraging docker-compose:

$ make e2e-tests 
docker-compose build
Building clamper
Sending build context to Docker daemon  624.6kB
Step 1/7 : FROM docker-registry.wikimedia.org/bookworm:latest
 ---> 9b2ac2ad6088
Step 2/7 : RUN apt-get update && apt-get install -y     ca-certificates     make     linux-libc-dev     gcc-multilib     clang     llvm     libbpf-dev     golang     iproute2
 ---> Using cache
 ---> 0384aad5f412
Step 3/7 : RUN mkdir /code
 ---> Using cache
 ---> 32d0d7228be6
Step 4/7 : COPY . /code
 ---> Using cache
 ---> a55618caeaed
Step 5/7 : WORKDIR /code
 ---> Using cache
 ---> 8536adf97449
Step 6/7 : RUN make
 ---> Using cache
 ---> 73d450898fc7
Step 7/7 : ENTRYPOINT ["/code/e2e/docker-entrypoint.sh"]
 ---> Using cache
 ---> f0f91612f6b5
Successfully built f0f91612f6b5
Successfully tagged tcp-mss-clamper_clamper:latest
Building client
Sending build context to Docker daemon  624.6kB
Step 1/7 : FROM docker-registry.wikimedia.org/bookworm:latest
 ---> 9b2ac2ad6088
Step 2/7 : RUN apt-get update && apt-get install -y     dnsutils     python3-scapy
 ---> Using cache
 ---> 4f9b03cef6a2
Step 3/7 : RUN mkdir /code
 ---> Using cache
 ---> 37eeb205d668
Step 4/7 : COPY . /code
 ---> Using cache
 ---> 8a328776d6d0
Step 5/7 : WORKDIR /code
 ---> Using cache
 ---> 12a0dc650be9
Step 6/7 : USER root
 ---> Using cache
 ---> 56e735ba9347
Step 7/7 : ENTRYPOINT ["/code/e2e/docker-client-entrypoint.sh"]
 ---> Using cache
 ---> 8d0d69730e0d
Successfully built 8d0d69730e0d
Successfully tagged tcp-mss-clamper_client:latest
docker-compose run client
Creating tcp-mss-clamper_clamper_1 ... done
Creating tcp-mss-clamper_client_run ... done
[*] MSS for 172.23.0.2:8888 = 1400
docker-compose rm --stop --force
Stopping tcp-mss-clamper_clamper_1 ... done
Going to remove tcp-mss-clamper_client_run_9ab7a0596faa, tcp-mss-clamper_clamper_1
Removing tcp-mss-clamper_client_run_9ab7a0596faa ... done
Removing tcp-mss-clamper_clamper_1               ... done

if the test fails docker-compose run client should return 1 and same for make, making it suitable for automated CI (assuming that it can run privileged containers)

Merge request reports