passt: Relicense to GPL 2.0, or any later version
In practical terms, passt doesn't benefit from the additional
protection offered by the AGPL over the GPL, because it's not
suitable to be executed over a computer network.
Further, restricting the distribution under the version 3 of the GPL
wouldn't provide any practical advantage either, as long as the passt
codebase is concerned, and might cause unnecessary compatibility
dilemmas.
Change licensing terms to the GNU General Public License Version 2,
or any later version, with written permission from all current and
past contributors, namely: myself, David Gibson, Laine Stump, Andrea
Bolognani, Paul Holzinger, Richard W.M. Jones, Chris Kuhn, Florian
Weimer, Giuseppe Scrivano, Stefan Hajnoczi, and Vasiliy Ulyanov.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2023-04-05 20:11:44 +02:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
2022-07-06 09:28:59 +02:00
|
|
|
#
|
|
|
|
# Tests makefile
|
|
|
|
#
|
|
|
|
# Copyright Red Hat
|
|
|
|
# Author: David Gibson <david@gibson.dropbear.id.au>
|
|
|
|
|
2022-07-06 09:29:07 +02:00
|
|
|
WGET = wget -c
|
|
|
|
|
|
|
|
DEBIAN_IMGS = debian-8.11.0-openstack-amd64.qcow2 \
|
|
|
|
debian-9-nocloud-amd64-daily-20200210-166.qcow2 \
|
|
|
|
debian-10-nocloud-amd64.qcow2 \
|
|
|
|
debian-10-generic-arm64.qcow2 \
|
2023-02-14 00:37:12 +01:00
|
|
|
debian-10-generic-ppc64el-20220911-1135.qcow2 \
|
2022-07-06 09:29:07 +02:00
|
|
|
debian-11-nocloud-amd64.qcow2 \
|
|
|
|
debian-11-generic-arm64.qcow2 \
|
|
|
|
debian-11-generic-ppc64el.qcow2 \
|
|
|
|
debian-sid-nocloud-amd64-daily.qcow2 \
|
|
|
|
debian-sid-nocloud-arm64-daily.qcow2 \
|
|
|
|
debian-sid-nocloud-ppc64el-daily.qcow2
|
|
|
|
|
|
|
|
FEDORA_IMGS = Fedora-Cloud-Base-26-1.5.x86_64.qcow2 \
|
|
|
|
Fedora-Cloud-Base-27-1.6.x86_64.qcow2 \
|
|
|
|
Fedora-Cloud-Base-28-1.1.x86_64.qcow2 \
|
|
|
|
Fedora-Cloud-Base-28-1.1.aarch64.qcow2 \
|
|
|
|
Fedora-Cloud-Base-29-1.2.x86_64.qcow2 \
|
|
|
|
Fedora-Cloud-Base-29-1.2.aarch64.qcow2 \
|
|
|
|
Fedora-Cloud-Base-30-1.2.x86_64.qcow2 \
|
|
|
|
Fedora-Cloud-Base-30-1.2.aarch64.qcow2 \
|
|
|
|
Fedora-Cloud-Base-31-1.9.x86_64.qcow2 \
|
|
|
|
Fedora-Cloud-Base-31-1.9.aarch64.qcow2 \
|
|
|
|
Fedora-Cloud-Base-32-1.6.x86_64.qcow2 \
|
|
|
|
Fedora-Cloud-Base-32-1.6.aarch64.qcow2 \
|
|
|
|
Fedora-Cloud-Base-33-1.2.x86_64.qcow2 \
|
|
|
|
Fedora-Cloud-Base-33-1.2.aarch64.qcow2 \
|
|
|
|
Fedora-Cloud-Base-34-1.2.x86_64.qcow2 \
|
|
|
|
Fedora-Cloud-Base-34-1.2.aarch64.qcow2 \
|
|
|
|
Fedora-Cloud-Base-35-1.2.x86_64.qcow2 \
|
|
|
|
Fedora-Cloud-Base-35-1.2.aarch64.qcow2
|
|
|
|
|
|
|
|
OPENSUSE_IMGS = openSUSE-Leap-15.1-JeOS.x86_64-kvm-and-xen.qcow2 \
|
|
|
|
openSUSE-Leap-15.2-JeOS.x86_64-kvm-and-xen.qcow2 \
|
|
|
|
openSUSE-Leap-15.3-JeOS.x86_64-kvm-and-xen.qcow2 \
|
|
|
|
openSUSE-Tumbleweed-ARM-JeOS-efi.aarch64.raw.xz \
|
|
|
|
openSUSE-Tumbleweed-ARM-JeOS-efi.armv7l.raw.xz \
|
|
|
|
openSUSE-Tumbleweed-JeOS.x86_64-kvm-and-xen.qcow2
|
|
|
|
|
2022-07-06 09:29:08 +02:00
|
|
|
UBUNTU_OLD_IMGS = trusty-server-cloudimg-amd64-disk1.img \
|
2022-07-06 09:29:07 +02:00
|
|
|
trusty-server-cloudimg-i386-disk1.img \
|
2022-07-06 09:29:08 +02:00
|
|
|
trusty-server-cloudimg-ppc64el-disk1.img
|
|
|
|
UBUNTU_NEW_IMGS = xenial-server-cloudimg-powerpc-disk1.img \
|
2022-07-06 09:29:07 +02:00
|
|
|
jammy-server-cloudimg-s390x.img
|
2022-07-06 09:29:08 +02:00
|
|
|
UBUNTU_IMGS = $(UBUNTU_OLD_IMGS) $(UBUNTU_NEW_IMGS)
|
2022-07-06 09:29:07 +02:00
|
|
|
|
|
|
|
DOWNLOAD_ASSETS = mbuto \
|
|
|
|
$(DEBIAN_IMGS) $(FEDORA_IMGS) $(OPENSUSE_IMGS) $(UBUNTU_IMGS)
|
2022-09-26 12:43:40 +02:00
|
|
|
TESTDATA_ASSETS = small.bin big.bin medium.bin
|
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>
2022-10-31 12:20:59 +01:00
|
|
|
LOCAL_ASSETS = mbuto.img mbuto.mem.img QEMU_EFI.fd \
|
2022-07-06 09:29:08 +02:00
|
|
|
$(DEBIAN_IMGS:%=prepared-%) $(FEDORA_IMGS:%=prepared-%) \
|
2022-09-12 12:56:20 +02:00
|
|
|
$(UBUNTU_NEW_IMGS:%=prepared-%) \
|
2023-04-06 05:28:06 +02:00
|
|
|
nstool guest-key guest-key.pub \
|
2022-09-26 12:43:40 +02:00
|
|
|
$(TESTDATA_ASSETS)
|
2022-07-06 09:28:59 +02:00
|
|
|
|
|
|
|
ASSETS = $(DOWNLOAD_ASSETS) $(LOCAL_ASSETS)
|
|
|
|
|
2022-09-28 06:33:22 +02:00
|
|
|
CFLAGS = -Wall -Werror -Wextra -pedantic -std=c99
|
2022-09-12 12:56:20 +02:00
|
|
|
|
2022-07-06 09:28:59 +02:00
|
|
|
assets: $(ASSETS)
|
|
|
|
|
2024-03-21 05:57:39 +01:00
|
|
|
.PHONY: pull-%
|
|
|
|
pull-%: %
|
|
|
|
git -C $* pull
|
|
|
|
|
2022-07-06 09:29:00 +02:00
|
|
|
mbuto:
|
|
|
|
git clone git://mbuto.sh/mbuto
|
|
|
|
|
2024-03-21 05:57:39 +01:00
|
|
|
mbuto/mbuto: pull-mbuto
|
|
|
|
|
2022-09-12 12:56:22 +02:00
|
|
|
guest-key guest-key.pub:
|
|
|
|
ssh-keygen -f guest-key -N ''
|
|
|
|
|
2024-03-21 05:57:39 +01:00
|
|
|
mbuto.img: passt.mbuto mbuto/mbuto guest-key.pub $(TESTDATA_ASSETS)
|
2022-07-06 09:29:00 +02:00
|
|
|
./mbuto/mbuto -p ./$< -c lz4 -f $@
|
|
|
|
|
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>
2022-10-31 12:20:59 +01:00
|
|
|
mbuto.mem.img: passt.mem.mbuto mbuto ../passt.avx2
|
|
|
|
./mbuto/mbuto -p ./$< -c lz4 -f $@
|
|
|
|
|
2023-04-06 05:28:06 +02:00
|
|
|
nstool: nstool.c
|
2022-09-12 12:56:20 +02:00
|
|
|
$(CC) $(CFLAGS) -o $@ $^
|
|
|
|
|
2022-07-06 09:29:01 +02:00
|
|
|
QEMU_EFI.fd:
|
|
|
|
./find-arm64-firmware.sh $@
|
|
|
|
|
2022-07-06 09:29:08 +02:00
|
|
|
prepared-%.qcow2: %.qcow2 ./prepare-distro-img.sh
|
|
|
|
qemu-img create -f qcow2 -F qcow2 -b $< $@
|
|
|
|
./prepare-distro-img.sh $@
|
|
|
|
|
|
|
|
prepared-%.img: %.img ./prepare-distro-img.sh
|
|
|
|
qemu-img create -f qcow2 -F qcow2 -b $< $@
|
|
|
|
./prepare-distro-img.sh $(IMGTYPE) $@
|
|
|
|
|
2022-09-26 12:43:40 +02:00
|
|
|
small.bin:
|
|
|
|
dd if=/dev/urandom bs=2k count=1 of=$@
|
|
|
|
|
|
|
|
medium.bin:
|
|
|
|
dd if=/dev/urandom bs=1k count=5 of=$@
|
|
|
|
|
|
|
|
big.bin:
|
|
|
|
dd if=/dev/urandom bs=1M count=10 of=$@
|
|
|
|
|
2022-07-06 09:28:59 +02:00
|
|
|
check: assets
|
|
|
|
./run
|
|
|
|
|
|
|
|
debug: assets
|
|
|
|
DEBUG=1 ./run
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f perf.js *~
|
|
|
|
rm -f $(LOCAL_ASSETS)
|
|
|
|
rm -rf test_logs
|
2022-07-06 09:29:08 +02:00
|
|
|
rm -f prepared-*.qcow2 prepared-*.img
|
2022-07-06 09:28:59 +02:00
|
|
|
|
|
|
|
realclean: clean
|
|
|
|
rm -rf $(DOWNLOAD_ASSETS)
|
2022-07-06 09:29:07 +02:00
|
|
|
|
|
|
|
# Debian downloads
|
|
|
|
debian-8.11.0-openstack-%.qcow2:
|
|
|
|
$(WGET) -O $@ https://cloud.debian.org/images/cloud/OpenStack/archive/8.11.0/debian-8.11.0-openstack-$*.qcow2
|
|
|
|
|
|
|
|
debian-9-nocloud-%-daily-20200210-166.qcow2:
|
|
|
|
$(WGET) -O $@ https://cloud.debian.org/images/cloud/stretch/daily/20200210-166/debian-9-nocloud-$*-daily-20200210-166.qcow2
|
|
|
|
|
|
|
|
debian-10-nocloud-%.qcow2:
|
|
|
|
$(WGET) -O $@ https://cloud.debian.org/images/cloud/buster/latest/debian-10-nocloud-$*.qcow2
|
|
|
|
|
2023-02-14 00:37:12 +01:00
|
|
|
debian-10-generic-ppc64el-20220911-1135.qcow2:
|
|
|
|
$(WGET) -O $@ https://cloud.debian.org/images/cloud/buster/20220911-1135/debian-10-generic-ppc64el-20220911-1135.qcow2
|
|
|
|
|
2022-07-06 09:29:07 +02:00
|
|
|
debian-10-generic-%.qcow2:
|
|
|
|
$(WGET) -O $@ https://cloud.debian.org/images/cloud/buster/latest/debian-10-generic-$*.qcow2
|
|
|
|
|
|
|
|
debian-11-nocloud-%.qcow2:
|
|
|
|
$(WGET) -O $@ https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-nocloud-$*.qcow2
|
|
|
|
|
|
|
|
debian-11-generic-%.qcow2:
|
|
|
|
$(WGET) -O $@ https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-generic-$*.qcow2
|
|
|
|
|
|
|
|
debian-sid-nocloud-%-daily.qcow2:
|
|
|
|
$(WGET) -O $@ https://cloud.debian.org/images/cloud/sid/daily/latest/debian-sid-nocloud-$*-daily.qcow2
|
|
|
|
|
|
|
|
# Fedora downloads
|
|
|
|
Fedora-Cloud-Base-26-1.5.%.qcow2:
|
|
|
|
$(WGET) -O $@ http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/26/CloudImages/$*/images/Fedora-Cloud-Base-26-1.5.$*.qcow2
|
|
|
|
|
|
|
|
Fedora-Cloud-Base-27-1.6.%.qcow2:
|
|
|
|
$(WGET) -O $@ http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/27/CloudImages/$*/images/Fedora-Cloud-Base-27-1.6.$*.qcow2
|
|
|
|
|
|
|
|
Fedora-Cloud-Base-28-1.1.%.qcow2:
|
|
|
|
$(WGET) -O $@ http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/28/Cloud/$*/images/Fedora-Cloud-Base-28-1.1.$*.qcow2
|
|
|
|
|
|
|
|
Fedora-Cloud-Base-29-1.2.%.qcow2:
|
|
|
|
$(WGET) -O $@ http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/29/Cloud/$*/images/Fedora-Cloud-Base-29-1.2.$*.qcow2
|
|
|
|
|
|
|
|
Fedora-Cloud-Base-30-1.2.%.qcow2:
|
|
|
|
$(WGET) -O $@ http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/30/Cloud/$*/images/Fedora-Cloud-Base-30-1.2.$*.qcow2
|
|
|
|
|
|
|
|
Fedora-Cloud-Base-31-1.9.%.qcow2:
|
|
|
|
$(WGET) -O $@ http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/31/Cloud/$*/images/Fedora-Cloud-Base-31-1.9.$*.qcow2
|
|
|
|
|
|
|
|
Fedora-Cloud-Base-32-1.6.%.qcow2:
|
2023-02-14 00:37:13 +01:00
|
|
|
$(WGET) -O $@ https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/32/Cloud/$*/images/Fedora-Cloud-Base-32-1.6.$*.qcow2
|
2022-07-06 09:29:07 +02:00
|
|
|
|
|
|
|
Fedora-Cloud-Base-33-1.2.%.qcow2:
|
2023-02-14 00:37:13 +01:00
|
|
|
$(WGET) -O $@ https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/33/Cloud/$*/images/Fedora-Cloud-Base-33-1.2.$*.qcow2
|
2022-07-06 09:29:07 +02:00
|
|
|
|
|
|
|
Fedora-Cloud-Base-34-1.2.%.qcow2:
|
2023-02-14 00:37:13 +01:00
|
|
|
$(WGET) -O $@ https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/34/Cloud/$*/images/Fedora-Cloud-Base-34-1.2.$*.qcow2
|
2022-07-06 09:29:07 +02:00
|
|
|
|
|
|
|
Fedora-Cloud-Base-35-1.2.%.qcow2:
|
2023-02-14 00:37:13 +01:00
|
|
|
$(WGET) -O $@ https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/35/Cloud/$*/images/Fedora-Cloud-Base-35-1.2.$*.qcow2
|
2022-07-06 09:29:07 +02:00
|
|
|
|
|
|
|
# OpenSuSE downloads
|
|
|
|
openSUSE-Leap-15.1-JeOS.x86_64-kvm-and-xen.qcow2:
|
|
|
|
$(WGET) -O $@ https://download.opensuse.org/distribution/leap/15.1/jeos/openSUSE-Leap-15.1-JeOS.x86_64-kvm-and-xen.qcow2
|
|
|
|
|
|
|
|
openSUSE-Leap-15.2-JeOS.x86_64-kvm-and-xen.qcow2:
|
|
|
|
$(WGET) -O $@ https://download.opensuse.org/distribution/leap/15.2/appliances/openSUSE-Leap-15.2-JeOS.x86_64-kvm-and-xen.qcow2
|
|
|
|
|
|
|
|
openSUSE-Leap-15.3-JeOS.x86_64-kvm-and-xen.qcow2:
|
|
|
|
$(WGET) -O $@ https://download.opensuse.org/distribution/leap/15.3/appliances/openSUSE-Leap-15.3-JeOS.x86_64-kvm-and-xen.qcow2
|
|
|
|
|
|
|
|
openSUSE-Tumbleweed-ARM-JeOS-efi.aarch64.raw.xz:
|
|
|
|
$(WGET) -O $@ http://download.opensuse.org/ports/aarch64/tumbleweed/appliances/openSUSE-Tumbleweed-ARM-JeOS-efi.aarch64.raw.xz
|
|
|
|
|
|
|
|
openSUSE-Tumbleweed-ARM-JeOS-efi.armv7l.raw.xz:
|
|
|
|
$(WGET) -O $@ http://download.opensuse.org/ports/armv7hl/tumbleweed/appliances/openSUSE-Tumbleweed-ARM-JeOS-efi.armv7l.raw.xz
|
|
|
|
|
|
|
|
openSUSE-Tumbleweed-JeOS.x86_64-kvm-and-xen.qcow2:
|
|
|
|
$(WGET) -O $@ https://download.opensuse.org/tumbleweed/appliances/openSUSE-Tumbleweed-JeOS.x86_64-kvm-and-xen.qcow2
|
|
|
|
|
|
|
|
# Ubuntu downloads
|
|
|
|
trusty-server-cloudimg-%-disk1.img:
|
|
|
|
$(WGET) -O $@ https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-$*-disk1.img
|
|
|
|
|
|
|
|
xenial-server-cloudimg-powerpc-disk1.img:
|
|
|
|
$(WGET) -O $@ https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-powerpc-disk1.img
|
|
|
|
|
|
|
|
jammy-server-cloudimg-s390x.img:
|
|
|
|
$(WGET) -O $@ https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-s390x.img
|