diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2022-10-31 12:20:59 +0100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-11-04 12:01:27 +0100 |
commit | 40fc9e6e7b46819bfa275abf8e0f0e5b6ae7316b (patch) | |
tree | b03442286486117b67d986886377ab0f93152bc1 /test/Makefile | |
parent | ce2a0a5bb45b23a28ac9b125bd67a4678c009231 (diff) | |
download | passt-40fc9e6e7b46819bfa275abf8e0f0e5b6ae7316b.tar passt-40fc9e6e7b46819bfa275abf8e0f0e5b6ae7316b.tar.gz passt-40fc9e6e7b46819bfa275abf8e0f0e5b6ae7316b.tar.bz2 passt-40fc9e6e7b46819bfa275abf8e0f0e5b6ae7316b.tar.lz passt-40fc9e6e7b46819bfa275abf8e0f0e5b6ae7316b.tar.xz passt-40fc9e6e7b46819bfa275abf8e0f0e5b6ae7316b.tar.zst passt-40fc9e6e7b46819bfa275abf8e0f0e5b6ae7316b.zip |
test: Add memory/passt test cases
These show a summary of memory usage in kernel and userspace with
different port forwarding configurations, details of userspace usage
using 'nm' (passt only uses statically allocated memory), and details
of kernel memory from slab reporting facilities.
This adds a new test image, mbuto.mem.img, with harcoded IPv4 and
IPv6 addresses and routes, and just the tools we need to start and
stop passt, to report from /proc/slabinfo, /proc/meminfo, and to
print and parse symbol sizes using nm(1).
passt can't pivot_root() for sandboxing purposes on ramfs, so we need
to create another filesystem and chroot into it, first.
We don't want to use pane context functions, as we're checking memory
usage for sockets: resort to screen-scraping.
Configure a dummy interface to provide passt with an appearance of
working IPv4 and IPv6 connectivity, contributed by David.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'test/Makefile')
-rw-r--r-- | test/Makefile | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/Makefile b/test/Makefile index 91498ff..9f2bc42 100644 --- a/test/Makefile +++ b/test/Makefile @@ -55,7 +55,7 @@ UBUNTU_IMGS = $(UBUNTU_OLD_IMGS) $(UBUNTU_NEW_IMGS) DOWNLOAD_ASSETS = mbuto \ $(DEBIAN_IMGS) $(FEDORA_IMGS) $(OPENSUSE_IMGS) $(UBUNTU_IMGS) TESTDATA_ASSETS = small.bin big.bin medium.bin -LOCAL_ASSETS = mbuto.img QEMU_EFI.fd \ +LOCAL_ASSETS = mbuto.img mbuto.mem.img QEMU_EFI.fd \ $(DEBIAN_IMGS:%=prepared-%) $(FEDORA_IMGS:%=prepared-%) \ $(UBUNTU_NEW_IMGS:%=prepared-%) \ nsholder guest-key guest-key.pub \ @@ -76,6 +76,9 @@ guest-key guest-key.pub: mbuto.img: passt.mbuto mbuto guest-key.pub $(TESTDATA_ASSETS) ./mbuto/mbuto -p ./$< -c lz4 -f $@ +mbuto.mem.img: passt.mem.mbuto mbuto ../passt.avx2 + ./mbuto/mbuto -p ./$< -c lz4 -f $@ + nsholder: nsholder.c $(CC) $(CFLAGS) -o $@ $^ |