mirror of
https://passt.top/passt
synced 2024-11-09 22:29:56 +00:00
ca2749e1bd
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>
397 lines
11 KiB
Plaintext
397 lines
11 KiB
Plaintext
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
#
|
|
# PASST - Plug A Simple Socket Transport
|
|
# for qemu/UNIX domain socket mode
|
|
#
|
|
# PASTA - Pack A Subtle Tap Abstraction
|
|
# for network namespace/tap device mode
|
|
#
|
|
# test/distro/fedora - Fedora builds, get packages via passt, test pasta
|
|
#
|
|
# Copyright (c) 2021 Red Hat GmbH
|
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
set PIDFILE __STATEDIR__/passt.pid
|
|
htools cat kill qemu-system-x86_64
|
|
|
|
# Quick pasta test: send message from init to ns, and from ns to init
|
|
def distro_quick_pasta_test
|
|
host (socat -u TCP6-LISTEN:10000,bind=[::1] OPEN:/tmp/init_msg,create,trunc; echo "from_init" | socat -u STDIN TCP6:[::1]:9999) &
|
|
hostb ./pasta
|
|
sleep 1
|
|
host PS1='$ '
|
|
host socat -u TCP6-LISTEN:9999,bind=[::1] OPEN:/tmp/ns_msg,create,trunc &
|
|
sleep 2
|
|
host echo "from_ns" | socat -u STDIN TCP6:[::1]:10000
|
|
sleep 2
|
|
host echo
|
|
sleep 1
|
|
hout NS_MSG cat /tmp/ns_msg
|
|
check [ __NS_MSG__ = "from_init" ]
|
|
hostb exit
|
|
host echo
|
|
hout INIT_MSG cat /tmp/init_msg
|
|
check [ __INIT_MSG__ = "from_ns" ]
|
|
endef
|
|
|
|
# Bracketed paste mode off, needed from Fedora 34
|
|
def distro_quick_pasta_test_fedora34
|
|
host bind 'set enable-bracketed-paste off'
|
|
host (socat -u TCP6-LISTEN:10000,bind=[::1] OPEN:/tmp/init_msg,create,trunc; echo "from_init" | socat -u STDIN TCP6:[::1]:9999) &
|
|
hostb ./pasta
|
|
sleep 1
|
|
host PS1='$ '
|
|
host bind 'set enable-bracketed-paste off'
|
|
host socat -u TCP6-LISTEN:9999,bind=[::1] OPEN:/tmp/ns_msg,create,trunc &
|
|
sleep 2
|
|
host echo "from_ns" | socat -u STDIN TCP6:[::1]:10000
|
|
sleep 2
|
|
host echo
|
|
hout NS_MSG cat /tmp/ns_msg
|
|
check [ __NS_MSG__ = "from_init" ]
|
|
hostb exit
|
|
host echo
|
|
hout INIT_MSG cat /tmp/init_msg
|
|
check [ __INIT_MSG__ = "from_ns" ]
|
|
endef
|
|
|
|
# Start passt, set common variables
|
|
hostb ./passt -s __STATEDIR__/passt.socket -P __PIDFILE__ &
|
|
sleep 1
|
|
host echo
|
|
|
|
test Fedora 26, x86_64
|
|
|
|
host qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-Fedora-Cloud-Base-26-1.5.x86_64.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -snapshot
|
|
host PS1='$ '
|
|
sleep 2
|
|
host yum -y install make gcc socat
|
|
|
|
host make clean
|
|
hout RET CFLAGS="-Werror" make; echo $?
|
|
check [ __RET__ -eq 0 ]
|
|
|
|
distro_quick_pasta_test
|
|
|
|
hint
|
|
sleep 1
|
|
|
|
# PIDFILE is cleaned up when the next test starts, read it now
|
|
hout PID cat __PIDFILE__
|
|
|
|
|
|
test Fedora 27, x86_64
|
|
|
|
host qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-Fedora-Cloud-Base-27-1.6.x86_64.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -snapshot
|
|
host PS1='$ '
|
|
sleep 2
|
|
host yum -y install make gcc socat
|
|
|
|
host make clean
|
|
hout RET CFLAGS="-Werror" make; echo $?
|
|
check [ __RET__ -eq 0 ]
|
|
|
|
distro_quick_pasta_test
|
|
|
|
hint
|
|
sleep 1
|
|
|
|
|
|
test Fedora 28, x86_64
|
|
|
|
host qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-Fedora-Cloud-Base-28-1.1.x86_64.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -snapshot
|
|
host PS1='$ '
|
|
sleep 2
|
|
host yum -y install make gcc socat
|
|
|
|
host make clean
|
|
hout RET CFLAGS="-Werror" make; echo $?
|
|
check [ __RET__ -eq 0 ]
|
|
|
|
distro_quick_pasta_test
|
|
|
|
hint
|
|
sleep 1
|
|
|
|
|
|
test Fedora 28, aarch64
|
|
|
|
host qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BASEPATH__/QEMU_EFI.fd -nodefaults -nographic -vga none -serial stdio __BASEPATH__/prepared-Fedora-Cloud-Base-28-1.1.aarch64.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -device virtio-rng-pci -snapshot
|
|
host PS1='$ '
|
|
sleep 2
|
|
host yum -y install make gcc socat
|
|
|
|
host make clean
|
|
hout RET CFLAGS="-Werror" make; echo $?
|
|
check [ __RET__ -eq 0 ]
|
|
|
|
distro_quick_pasta_test
|
|
|
|
hint
|
|
sleep 1
|
|
hostb reset
|
|
sleep 1
|
|
host echo
|
|
|
|
|
|
test Fedora 29, x86_64
|
|
|
|
host qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-Fedora-Cloud-Base-29-1.2.x86_64.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -snapshot
|
|
host PS1='$ '
|
|
sleep 2
|
|
host yum -y install make gcc socat
|
|
|
|
host make clean
|
|
hout RET CFLAGS="-Werror" make; echo $?
|
|
check [ __RET__ -eq 0 ]
|
|
|
|
distro_quick_pasta_test
|
|
|
|
hint
|
|
sleep 1
|
|
|
|
|
|
test Fedora 29, aarch64
|
|
|
|
host qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BASEPATH__/QEMU_EFI.fd -nodefaults -nographic -vga none -serial stdio __BASEPATH__/prepared-Fedora-Cloud-Base-29-1.2.aarch64.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -device virtio-rng-pci -snapshot
|
|
host PS1='$ '
|
|
sleep 2
|
|
host yum -y install make gcc socat
|
|
|
|
host make clean
|
|
hout RET CFLAGS="-Werror" make; echo $?
|
|
check [ __RET__ -eq 0 ]
|
|
|
|
distro_quick_pasta_test
|
|
|
|
hint
|
|
sleep 1
|
|
hostb reset
|
|
sleep 1
|
|
host echo
|
|
|
|
|
|
test Fedora 30, x86_64
|
|
|
|
host qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-Fedora-Cloud-Base-30-1.2.x86_64.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -snapshot
|
|
host PS1='$ '
|
|
sleep 2
|
|
host yum -y install make gcc socat
|
|
|
|
host make clean
|
|
hout RET CFLAGS="-Werror" make; echo $?
|
|
check [ __RET__ -eq 0 ]
|
|
|
|
distro_quick_pasta_test
|
|
|
|
hint
|
|
sleep 1
|
|
|
|
|
|
test Fedora 30, aarch64
|
|
|
|
host qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BASEPATH__/QEMU_EFI.fd -nodefaults -nographic -vga none -serial stdio __BASEPATH__/prepared-Fedora-Cloud-Base-30-1.2.aarch64.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -device virtio-rng-pci -snapshot
|
|
host PS1='$ '
|
|
sleep 2
|
|
host yum -y install make gcc socat
|
|
|
|
host make clean
|
|
hout RET CFLAGS="-Werror" make; echo $?
|
|
check [ __RET__ -eq 0 ]
|
|
|
|
distro_quick_pasta_test
|
|
|
|
hint
|
|
sleep 1
|
|
hostb reset
|
|
sleep 1
|
|
host echo
|
|
|
|
|
|
test Fedora 31, x86_64
|
|
|
|
host qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-Fedora-Cloud-Base-31-1.9.x86_64.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -snapshot
|
|
host PS1='$ '
|
|
sleep 2
|
|
host yum -y install make gcc socat
|
|
|
|
host make clean
|
|
hout RET CFLAGS="-Werror" make; echo $?
|
|
check [ __RET__ -eq 0 ]
|
|
|
|
distro_quick_pasta_test
|
|
|
|
hint
|
|
sleep 1
|
|
|
|
|
|
test Fedora 31, aarch64
|
|
|
|
host qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BASEPATH__/QEMU_EFI.fd -nodefaults -nographic -vga none -serial stdio __BASEPATH__/prepared-Fedora-Cloud-Base-31-1.9.aarch64.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -device virtio-rng-pci -snapshot
|
|
host PS1='$ '
|
|
sleep 2
|
|
host yum -y install make gcc socat
|
|
|
|
host make clean
|
|
hout RET CFLAGS="-Werror" make; echo $?
|
|
check [ __RET__ -eq 0 ]
|
|
|
|
distro_quick_pasta_test
|
|
|
|
hint
|
|
sleep 1
|
|
hostb reset
|
|
sleep 1
|
|
host echo
|
|
|
|
|
|
test Fedora 32, x86_64
|
|
|
|
host qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-Fedora-Cloud-Base-32-1.6.x86_64.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -snapshot
|
|
host PS1='$ '
|
|
sleep 2
|
|
host yum -y install make gcc socat
|
|
|
|
host make clean
|
|
hout RET CFLAGS="-Werror" make; echo $?
|
|
check [ __RET__ -eq 0 ]
|
|
|
|
distro_quick_pasta_test
|
|
|
|
hint
|
|
sleep 1
|
|
|
|
|
|
test Fedora 32, aarch64
|
|
|
|
host qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BASEPATH__/QEMU_EFI.fd -nodefaults -nographic -vga none -serial stdio __BASEPATH__/prepared-Fedora-Cloud-Base-32-1.6.aarch64.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -device virtio-rng-pci -snapshot
|
|
host PS1='$ '
|
|
sleep 2
|
|
host yum -y install make gcc socat
|
|
|
|
host make clean
|
|
hout RET CFLAGS="-Werror" make; echo $?
|
|
check [ __RET__ -eq 0 ]
|
|
|
|
distro_quick_pasta_test
|
|
|
|
hint
|
|
sleep 1
|
|
hostb reset
|
|
sleep 1
|
|
host echo
|
|
|
|
|
|
test Fedora 33, x86_64
|
|
|
|
host qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-Fedora-Cloud-Base-33-1.2.x86_64.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -snapshot
|
|
host PS1='$ '
|
|
sleep 2
|
|
host yum -y install make gcc socat
|
|
|
|
host make clean
|
|
hout RET CFLAGS="-Werror" make; echo $?
|
|
check [ __RET__ -eq 0 ]
|
|
|
|
distro_quick_pasta_test
|
|
|
|
hint
|
|
sleep 1
|
|
|
|
|
|
test Fedora 33, aarch64
|
|
|
|
host qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BASEPATH__/QEMU_EFI.fd -nodefaults -nographic -vga none -serial stdio __BASEPATH__/prepared-Fedora-Cloud-Base-33-1.2.aarch64.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -device virtio-rng-pci -snapshot
|
|
host PS1='$ '
|
|
sleep 2
|
|
host yum -y install make gcc socat
|
|
|
|
host make clean
|
|
hout RET CFLAGS="-Werror" make; echo $?
|
|
check [ __RET__ -eq 0 ]
|
|
|
|
distro_quick_pasta_test
|
|
|
|
hint
|
|
sleep 1
|
|
hostb reset
|
|
sleep 1
|
|
host echo
|
|
|
|
|
|
test Fedora 34, x86_64
|
|
|
|
host qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-Fedora-Cloud-Base-34-1.2.x86_64.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -snapshot
|
|
host PS1='$ '
|
|
sleep 2
|
|
host yum -y install make gcc socat
|
|
|
|
host make clean
|
|
hout RET CFLAGS="-Werror" make; echo $?
|
|
check [ __RET__ -eq 0 ]
|
|
|
|
distro_quick_pasta_test_fedora34
|
|
|
|
hint
|
|
sleep 1
|
|
|
|
|
|
test Fedora 34, aarch64
|
|
|
|
host qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BASEPATH__/QEMU_EFI.fd -nodefaults -nographic -vga none -serial stdio __BASEPATH__/prepared-Fedora-Cloud-Base-34-1.2.aarch64.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -device virtio-rng-pci -snapshot
|
|
host PS1='$ '
|
|
sleep 2
|
|
host yum -y install make gcc socat
|
|
|
|
host make clean
|
|
hout RET CFLAGS="-Werror" make; echo $?
|
|
check [ __RET__ -eq 0 ]
|
|
|
|
distro_quick_pasta_test_fedora34
|
|
|
|
hint
|
|
sleep 1
|
|
hostb reset
|
|
sleep 1
|
|
host echo
|
|
|
|
|
|
test Fedora 35, x86_64
|
|
|
|
host qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-Fedora-Cloud-Base-35-1.2.x86_64.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -snapshot
|
|
host PS1='$ '
|
|
sleep 2
|
|
host yum -y install make gcc socat
|
|
|
|
host make clean
|
|
hout RET CFLAGS="-Werror" make; echo $?
|
|
check [ __RET__ -eq 0 ]
|
|
|
|
distro_quick_pasta_test_fedora34
|
|
|
|
hint
|
|
sleep 1
|
|
|
|
|
|
test Fedora 35, aarch64
|
|
|
|
host qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BASEPATH__/QEMU_EFI.fd -nodefaults -nographic -vga none -serial stdio __BASEPATH__/prepared-Fedora-Cloud-Base-35-1.2.aarch64.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -device virtio-rng-pci -snapshot
|
|
host PS1='$ '
|
|
sleep 2
|
|
host yum -y install make gcc socat
|
|
|
|
host make clean
|
|
hout RET CFLAGS="-Werror" make; echo $?
|
|
check [ __RET__ -eq 0 ]
|
|
|
|
distro_quick_pasta_test_fedora34
|
|
|
|
hint
|
|
sleep 1
|
|
hostb reset
|
|
sleep 1
|
|
host echo
|
|
|
|
|
|
host kill __PID__
|