Skip to content

Commit 7b0f2a2

Browse files
committed
test: docker: add iperf3, trafgen and mausezahn to the test container
The QoS scheduling tests need traffic the tests do not have to write themselves: sustained UDP flows with a set rate and DSCP, counted at the receiver, and single frames with an exact VLAN tag and PCP. iperf3 comes from Alpine. Alpine has no netsniff-ng package on any branch, and mausezahn needs libcli, which only exists in edge/testing, so both are built from their release tarballs like mtools already is. netsniff-ng's configure is a bash script and its install rules need GNU install, hence bash and coreutils. Image version 2.12. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1 parent e131846 commit 7b0f2a2

3 files changed

Lines changed: 33 additions & 2 deletions

File tree

‎test/.env‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# shellcheck disable=SC2034,SC2154
33

44
# Current container image
5-
INFIX_TEST=ghcr.io/kernelkit/infix-test:2.11
5+
INFIX_TEST=ghcr.io/kernelkit/infix-test:2.12
66

77
ixdir=$(readlink -f "$testdir/..")
88
logdir=$(readlink -f "$testdir/.log")

‎test/docker/Dockerfile‎

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ FROM alpine:3.18.0
22

33
# NOTE: please add packages alphabetically!
44
RUN apk add --no-cache \
5+
bash \
6+
bison \
57
busybox-extras \
68
chrony \
9+
coreutils \
710
curl \
811
dhcp-server-vanilla \
912
dnsmasq \
@@ -12,21 +15,29 @@ RUN apk add --no-cache \
1215
ethtool \
1316
fakeroot \
1417
file \
18+
flex \
1519
font-dejavu \
1620
gcc \
1721
git \
1822
graphviz \
23+
iperf3 \
1924
iproute2 \
2025
iputils \
2126
jq \
2227
libc-dev \
28+
libnet-dev \
29+
libnetfilter_conntrack-dev \
30+
libnl3-dev \
31+
libpcap-dev \
2332
libyang-dev \
2433
linux-headers \
2534
make \
35+
ncurses-dev \
2636
nmap \
2737
openssh-client \
2838
openssl \
2939
pandoc-cli \
40+
pkgconf \
3041
python3-dev \
3142
qemu-img \
3243
qemu-system-x86_64 \
@@ -37,13 +48,29 @@ RUN apk add --no-cache \
3748
sshpass \
3849
tcpdump \
3950
tshark \
40-
weasyprint
51+
userspace-rcu-dev \
52+
weasyprint \
53+
zlib-dev
4154

4255
ARG MTOOL_VERSION="3.0"
4356
RUN wget https://github.com/troglobit/mtools/releases/download/v3.0/mtools-$MTOOL_VERSION.tar.gz -O /tmp/mtools-$MTOOL_VERSION.tar.gz
4457
RUN cd /tmp/ && tar zxvf mtools-$MTOOL_VERSION.tar.gz
4558
RUN cd /tmp/mtools-$MTOOL_VERSION && make && make install
4659

60+
# trafgen and mausezahn, traffic generators for the QoS tests. Alpine
61+
# has no netsniff-ng package, and mausezahn needs libcli, which is only
62+
# in edge/testing, so both are built from their release tarballs.
63+
ARG LIBCLI_VERSION="1.10.7"
64+
RUN wget https://github.com/dparrish/libcli/archive/refs/tags/V$LIBCLI_VERSION.tar.gz -O /tmp/libcli-$LIBCLI_VERSION.tar.gz
65+
RUN cd /tmp/ && tar zxf libcli-$LIBCLI_VERSION.tar.gz
66+
RUN cd /tmp/libcli-$LIBCLI_VERSION && make && make install PREFIX=/usr
67+
68+
ARG NETSNIFF_NG_VERSION="0.6.9"
69+
RUN wget https://github.com/netsniff-ng/netsniff-ng/archive/refs/tags/v$NETSNIFF_NG_VERSION.tar.gz -O /tmp/netsniff-ng-$NETSNIFF_NG_VERSION.tar.gz
70+
RUN cd /tmp/ && tar zxf netsniff-ng-$NETSNIFF_NG_VERSION.tar.gz
71+
RUN cd /tmp/netsniff-ng-$NETSNIFF_NG_VERSION && ./configure --disable-geoip && \
72+
make trafgen mausezahn && make trafgen_install mausezahn_install
73+
4774
# Alpine's QEMU package does not bundle this for some reason, copied
4875
# from Ubuntu
4976
COPY docker/qemu-ifup /etc

‎test/docker/pip-requirements.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ pydot==1.4.2
77
pyyaml==6.0.1
88
passlib==1.7.4
99
requests~=2.32.4
10+
# urllib3 2.8.0 normalises the zone id of an IPv6 link-local URL host as a
11+
# percent-escape, fe80::1%d2a becomes fe80::1%D2a, and the request fails
12+
# with a name resolution error. Stay on 2.7 until it is fixed upstream.
13+
urllib3~=2.7.0
1014
pynmea2==1.19.0
1115
# GHSA-cq46-m9x9-j8w2: scapy <=2.6.1 has pickle deserialization vuln in session
1216
# loading (-s flag). Low risk: test framework only uses packet crafting (Ether,

0 commit comments

Comments
 (0)