From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id 04F915A026A; Fri, 4 Nov 2022 02:54:43 +0100 (CET) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH 1/3] test: Switch to qemu -netdev stream option instead of using qrap Date: Fri, 4 Nov 2022 02:54:40 +0100 Message-Id: <20221104015442.3831762-2-sbrivio@redhat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221104015442.3831762-1-sbrivio@redhat.com> References: <20221104015442.3831762-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: GGZCJNOQ5D6ZV7RZRHXKJ4RAUBRVDO5F X-Message-ID-Hash: GGZCJNOQ5D6ZV7RZRHXKJ4RAUBRVDO5F X-MailFrom: sbrivio@passt.top X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson , Laurent Vivier , Andrea Bolognani X-Mailman-Version: 3.3.3 Precedence: list List-Id: Development discussion and patches for passt Archived-At: <> Archived-At: List-Archive: <> List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: qemu commit 13c6be96618c ("net: stream: add unix socket") introduces support for native AF_UNIX support, finally making qrap useless. We can't quite drop that yet until a qemu release includes it, and then we'll need to wait a while for users to switch anyway, but at least for tests, we can use that support. Signed-off-by: Stefano Brivio --- test/README.md | 5 +++++ test/demo/passt | 9 +++----- test/distro/debian | 24 ++++++++++----------- test/distro/fedora | 38 ++++++++++++++++----------------- test/distro/opensuse | 14 ++++++------- test/distro/ubuntu | 12 +++++------ test/lib/setup | 50 ++++++++++++++++++++------------------------ 7 files changed, 75 insertions(+), 77 deletions(-) diff --git a/test/README.md b/test/README.md index 09ad05d..3b085bd 100644 --- a/test/README.md +++ b/test/README.md @@ -33,6 +33,11 @@ Example for Debian, and possibly most Debian-based distributions: netcat-openbsd fakeroot lz4 lm-sensors qemu-system-arm qemu-system-ppc qemu-system-misc qemu-system-x86 valgrind +NOTE: the tests need a qemu version >= 7.2, or one that contains commit +13c6be96618c ("net: stream: add unix socket"): this change introduces support +for UNIX domain sockets as network device back-end, which qemu uses to connect +to passt. + ### Other tools Test measuring request-response and connect-request-response latencies use diff --git a/test/demo/passt b/test/demo/passt index ce40e20..879169f 100644 --- a/test/demo/passt +++ b/test/demo/passt @@ -85,7 +85,7 @@ guest cd passt gout TARGET_PID pgrep -P $(cat pasta.pid) sleep 1 -passtb ./passt -f -t 10001,10003 +passtb ./passt -f -t 10001,10003 -s __STATEDIR__/passt.socket sleep 2 guest nsenter -t __TARGET_PID__ -U -n --preserve-credentials @@ -93,14 +93,11 @@ sleep 5 nl nl -say We're ready to start qemu with the qrap wrapper, +say We're ready to start qemu nl -say that we currently need to connect the netdev -nl -say back-end to passt's UNIX domain socket. sleep 2 hout VMLINUZ echo "/boot/vmlinuz-$(uname -r)" -guest ./qrap 5 qemu-system-x86_64 -enable-kvm -m 4096 -cpu host -smp 4 -kernel __VMLINUZ__ -initrd ../passt.img -nographic -serial stdio -nodefaults -append "console=ttyS0 virtio-net.napi_tx=1" -device virtio-net-pci,netdev=hostnet0,x-txburst=16384 -netdev socket,fd=5,id=hostnet0 +guest qemu-system-x86_64 -enable-kvm -m 4096 -cpu host -smp 4 -kernel __VMLINUZ__ -initrd ../passt.img -nographic -serial stdio -nodefaults -append "console=ttyS0" -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket sleep 10 nl diff --git a/test/distro/debian b/test/distro/debian index 4a19f95..5633c22 100644 --- a/test/distro/debian +++ b/test/distro/debian @@ -36,14 +36,14 @@ check [ __INIT_MSG__ = "from_ns" ] endef # Start passt, set common variables -hostb ./passt -P __PIDFILE__ & +hostb ./passt -s __STATEDIR__/passt.socket -P __PIDFILE__ & sleep 1 host echo test Debian GNU/Linux 8 (jessie), amd64 -host ./qrap 5 qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none -drive file=__BASEPATH__/prepared-debian-8.11.0-openstack-amd64.qcow2,if=virtio -net socket,fd=5 -net nic,model=virtio -snapshot +host qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none -drive file=__BASEPATH__/prepared-debian-8.11.0-openstack-amd64.qcow2,if=virtio -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 apt-get update @@ -64,7 +64,7 @@ hout PID cat __PIDFILE__ test Debian GNU/Linux 9 (stretch, oldoldstable), amd64 -host ./qrap 5 qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-9-nocloud-amd64-daily-20200210-166.qcow2 -net socket,fd=5 -net nic,model=virtio -snapshot +host qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-9-nocloud-amd64-daily-20200210-166.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 apt-get update @@ -82,7 +82,7 @@ sleep 1 test Debian GNU/Linux 10 (buster, oldstable), amd64 -host ./qrap 5 qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-10-nocloud-amd64.qcow2 -net socket,fd=5 -net nic,model=virtio -snapshot +host qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-10-nocloud-amd64.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 apt-get update @@ -100,7 +100,7 @@ sleep 1 test Debian GNU/Linux 10 (buster, oldstable), aarch64 -host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BASEPATH__/QEMU_EFI.fd -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-10-generic-arm64.qcow2 -net socket,fd=5 -net nic,model=virtio -snapshot +host qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BASEPATH__/QEMU_EFI.fd -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-10-generic-arm64.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 apt-get update @@ -118,7 +118,7 @@ sleep 1 test Debian GNU/Linux 10 (buster, oldstable), ppc64le -host ./qrap 5 qemu-system-ppc64 -m 2048 -smp 2 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-10-generic-ppc64el.qcow2 -net socket,fd=5 -net nic,model=virtio -snapshot +host qemu-system-ppc64 -m 2048 -smp 2 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-10-generic-ppc64el.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 apt-get update @@ -137,7 +137,7 @@ hostb reset test Debian GNU/Linux 11 (bullseye, stable), amd64 -host ./qrap 5 qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-11-nocloud-amd64.qcow2 -net socket,fd=5 -net nic,model=virtio -snapshot +host qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-11-nocloud-amd64.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -snapshot sleep 2 host apt-get update host apt-get -y install make gcc socat @@ -153,7 +153,7 @@ sleep 1 test Debian GNU/Linux 11 (bullseye, stable), aarch64 -host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BASEPATH__/QEMU_EFI.fd -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-11-generic-arm64.qcow2 -net socket,fd=5 -net nic,model=virtio -snapshot +host qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BASEPATH__/QEMU_EFI.fd -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-11-generic-arm64.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -snapshot sleep 2 host apt-get update host apt-get -y install make gcc socat @@ -169,7 +169,7 @@ sleep 1 test Debian GNU/Linux 11 (bullseye, stable), ppc64le -host ./qrap 5 qemu-system-ppc64 -m 2048 -smp 2 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-11-generic-ppc64el.qcow2 -net socket,fd=5 -net nic,model=virtio -snapshot +host qemu-system-ppc64 -m 2048 -smp 2 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-11-generic-ppc64el.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -snapshot sleep 2 host apt-get update host apt-get -y install make gcc socat @@ -193,7 +193,7 @@ hostb reset test Debian GNU/Linux sid (experimental), amd64 host qemu-img resize __BASEPATH__/prepared-debian-sid-nocloud-amd64-daily.qcow2 4G -host ./qrap 5 qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-sid-nocloud-amd64-daily.qcow2 -net socket,fd=5 -net nic,model=virtio -snapshot +host qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-sid-nocloud-amd64-daily.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -snapshot sleep 2 host growpart /dev/sda 1 host resize2fs -p /dev/sda1 @@ -213,7 +213,7 @@ sleep 1 test Debian GNU/Linux sid (experimental), aarch64 host qemu-img resize __BASEPATH__/prepared-debian-sid-nocloud-arm64-daily.qcow2 4G -host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BASEPATH__/QEMU_EFI.fd -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-sid-nocloud-arm64-daily.qcow2 -net socket,fd=5 -net nic,model=virtio -snapshot +host qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BASEPATH__/QEMU_EFI.fd -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-sid-nocloud-arm64-daily.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -snapshot sleep 2 host growpart /dev/vda 1 host resize2fs -p /dev/vda1 @@ -232,7 +232,7 @@ sleep 1 test Debian GNU/Linux sid (experimental), ppc64le -host ./qrap 5 qemu-system-ppc64 -m 2048 -smp 2 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-sid-nocloud-ppc64el-daily.qcow2 -net socket,fd=5 -net nic,model=virtio -snapshot +host qemu-system-ppc64 -m 2048 -smp 2 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __BASEPATH__/prepared-debian-sid-nocloud-ppc64el-daily.qcow2 -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -snapshot sleep 2 host export DEBIAN_FRONTEND=noninteractive host apt-get update diff --git a/test/distro/fedora b/test/distro/fedora index a8d3b51..73a53b5 100644 --- a/test/distro/fedora +++ b/test/distro/fedora @@ -56,13 +56,13 @@ check [ __INIT_MSG__ = "from_ns" ] endef # Start passt, set common variables -hostb ./passt -P __PIDFILE__ & +hostb ./passt -s __STATEDIR__/passt.socket -P __PIDFILE__ & sleep 1 host echo test Fedora 26, x86_64 -host ./qrap 5 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 -net socket,fd=5 -net nic,model=virtio -snapshot +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 @@ -82,7 +82,7 @@ hout PID cat __PIDFILE__ test Fedora 27, x86_64 -host ./qrap 5 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 -net socket,fd=5 -net nic,model=virtio -snapshot +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 @@ -99,7 +99,7 @@ sleep 1 test Fedora 28, x86_64 -host ./qrap 5 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 -net socket,fd=5 -net nic,model=virtio -snapshot +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 @@ -116,7 +116,7 @@ sleep 1 test Fedora 28, aarch64 -host ./qrap 5 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 -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci -snapshot +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 @@ -136,7 +136,7 @@ host echo test Fedora 29, x86_64 -host ./qrap 5 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 -net socket,fd=5 -net nic,model=virtio -snapshot +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 @@ -153,7 +153,7 @@ sleep 1 test Fedora 29, aarch64 -host ./qrap 5 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 -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci -snapshot +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 @@ -173,7 +173,7 @@ host echo test Fedora 30, x86_64 -host ./qrap 5 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 -net socket,fd=5 -net nic,model=virtio -snapshot +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 @@ -190,7 +190,7 @@ sleep 1 test Fedora 30, aarch64 -host ./qrap 5 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 -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci -snapshot +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 @@ -210,7 +210,7 @@ host echo test Fedora 31, x86_64 -host ./qrap 5 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 -net socket,fd=5 -net nic,model=virtio -snapshot +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 @@ -227,7 +227,7 @@ sleep 1 test Fedora 31, aarch64 -host ./qrap 5 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 -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci -snapshot +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 @@ -247,7 +247,7 @@ host echo test Fedora 32, x86_64 -host ./qrap 5 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 -net socket,fd=5 -net nic,model=virtio -snapshot +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 @@ -264,7 +264,7 @@ sleep 1 test Fedora 32, aarch64 -host ./qrap 5 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 -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci -snapshot +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 @@ -284,7 +284,7 @@ host echo test Fedora 33, x86_64 -host ./qrap 5 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 -net socket,fd=5 -net nic,model=virtio -snapshot +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 @@ -301,7 +301,7 @@ sleep 1 test Fedora 33, aarch64 -host ./qrap 5 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 -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci -snapshot +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 @@ -321,7 +321,7 @@ host echo test Fedora 34, x86_64 -host ./qrap 5 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 -net socket,fd=5 -net nic,model=virtio -snapshot +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 @@ -338,7 +338,7 @@ sleep 1 test Fedora 34, aarch64 -host ./qrap 5 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 -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci -snapshot +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 @@ -358,7 +358,7 @@ host echo test Fedora 35, x86_64 -host ./qrap 5 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 -net socket,fd=5 -net nic,model=virtio -snapshot +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 @@ -375,7 +375,7 @@ sleep 1 test Fedora 35, aarch64 -host ./qrap 5 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 -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci -snapshot +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 diff --git a/test/distro/opensuse b/test/distro/opensuse index 314870f..03d1406 100644 --- a/test/distro/opensuse +++ b/test/distro/opensuse @@ -35,7 +35,7 @@ check [ __INIT_MSG__ = "from_ns" ] endef # Start passt, set common variables -hostb ./passt -P __PIDFILE__ & +hostb ./passt -s __STATEDIR__/passt.socket -P __PIDFILE__ & sleep 1 host echo hout DNS6 sed -n 's/^nameserver \([^:]*:\)\([^%]*\).*/\1\2/p' /etc/resolv.conf | head -1 @@ -51,7 +51,7 @@ host guestfish --rw -a __IMG__ -i rm /etc/systemd/system/default.target.wants/je host virt-edit -a __IMG__ /etc/systemd/system/getty.target.wants/getty@tty1.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --timeout 5000 --autologin root -i -8 --keep-baud 115200,38400,9600 ttyS0 $TERM/g' host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/ -host ./qrap 5 qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio +host qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket host PS1='$ ' host ip link set eth0 up sleep 2 @@ -80,7 +80,7 @@ host guestfish --rw -a __IMG__ -i rm /etc/systemd/system/default.target.wants/je host virt-edit -a __IMG__ /etc/systemd/system/getty.target.wants/getty@tty1.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --timeout 5000 --autologin root -i -8 --keep-baud 115200,38400,9600 ttyS0 $TERM/g' host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/ -host ./qrap 5 qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio +host qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket host PS1='$ ' host ip link set eth0 up sleep 2 @@ -106,7 +106,7 @@ host guestfish --rw -a __IMG__ -i rm /etc/systemd/system/default.target.wants/je host virt-edit -a __IMG__ /etc/systemd/system/getty.target.wants/getty@tty1.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --timeout 5000 --autologin root -i -8 --keep-baud 115200,38400,9600 ttyS0 $TERM/g' host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/ -host ./qrap 5 qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio +host qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket # Multiple prompt logins might come up here sleep 10 host PS1='$ ' @@ -132,7 +132,7 @@ host xzcat __BASEPATH__/openSUSE-Tumbleweed-ARM-JeOS-efi.aarch64.raw.xz > __IMG_ host virt-edit -a __IMG__ -m /dev/sda3 /usr/lib/systemd/system/serial-getty@.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --timeout 5000 --autologin root -i -8 --keep-baud 115200,38400,9600 %I $TERM/g' host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/ -host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BASEPATH__/QEMU_EFI.fd -nodefaults -nographic -vga none -serial stdio __IMG__ -net socket,fd=5 -net nic,model=virtio +host qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BASEPATH__/QEMU_EFI.fd -nodefaults -nographic -vga none -serial stdio __IMG__ -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket host PS1='$ ' host ip link set enp0s1 up sleep 10 @@ -161,7 +161,7 @@ host guestfish -a __IMG__ -i download /boot/initrd __INITRD__ host virt-edit -a __IMG__ -m /dev/sda3 /usr/lib/systemd/system/serial-getty@.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --timeout 5000 --autologin root -i -8 --keep-baud 115200,38400,9600 %I $TERM/g' host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/ -host ./qrap 5 qemu-system-arm -M virt -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none -kernel __ZIMAGE__ -initrd __INITRD__ -append 'root=/dev/sda3' -drive if=none,file=__IMG__,format=raw,id=hd,media=disk -device virtio-scsi-device -device scsi-hd,drive=hd -netdev socket,fd=5,id=passt -device virtio-net-device,netdev=passt +host qemu-system-arm -M virt -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none -kernel __ZIMAGE__ -initrd __INITRD__ -append 'root=/dev/sda3' -drive if=none,file=__IMG__,format=raw,id=hd,media=disk -device virtio-scsi-device -device scsi-hd,drive=hd -netdev socket,fd=5,id=passt -device virtio-net-device,netdev=passt host PS1='$ ' host ip link set eth0 up sleep 10 @@ -188,7 +188,7 @@ host guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/serial-getty@.servi host virt-edit -a __IMG__ /etc/systemd/system/getty.target.wants/getty@tty1.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --timeout 5000 --autologin root -i -8 --keep-baud 115200,38400,9600 ttyS0 $TERM/g' host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/ -host ./qrap 5 qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio +host qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket host PS1='$ ' host ip link set ens2 up sleep 2 diff --git a/test/distro/ubuntu b/test/distro/ubuntu index 343fa03..2f0dbdc 100644 --- a/test/distro/ubuntu +++ b/test/distro/ubuntu @@ -60,7 +60,7 @@ host r=10; while [ \${r} -gt 0 ]; do host ubuntu.com && break; sleep 5; r=\$((r endef # Start passt, set common variables -hostb ./passt -P __PIDFILE__ & +hostb ./passt -s __STATEDIR__/passt.socket -P __PIDFILE__ & sleep 1 host echo hout GUEST_FILES ls -1 *.c *.h *.sh passt.1 qrap.1 Makefile README.md | tr '\n' ' '; echo @@ -80,7 +80,7 @@ host guestfish --rw -a __IMG__ -i rm /etc/init/cloud-init.conf host guestfish --rw -a __IMG__ -i rm /etc/init/cloud-log-shutdown.conf host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/ -host ./qrap 5 qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none -drive file=__IMG__,if=virtio -net socket,fd=5 -net nic,model=virtio +host qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none -drive file=__IMG__,if=virtio -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket host PS1='$ ' sleep 2 host apt-get update @@ -113,7 +113,7 @@ host guestfish --rw -a __IMG__ -i rm /etc/init/cloud-init.conf host guestfish --rw -a __IMG__ -i rm /etc/init/cloud-log-shutdown.conf host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/ -host ./qrap 5 qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none -drive file=__IMG__,if=virtio -net socket,fd=5 -net nic,model=virtio +host qemu-system-x86_64 -M pc,accel=kvm:tcg -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none -drive file=__IMG__,if=virtio -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket host PS1='$ ' sleep 2 host apt-get update @@ -143,7 +143,7 @@ host guestfish --rw -a __IMG__ -i rm /etc/init/cloud-init.conf host guestfish --rw -a __IMG__ -i rm /etc/init/cloud-log-shutdown.conf host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/ -host ./qrap 5 qemu-system-ppc64 -m 2048 -smp 2 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio +host qemu-system-ppc64 -m 2048 -smp 2 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket host PS1='$ ' sleep 2 host apt-get update @@ -164,7 +164,7 @@ host echo test Ubuntu 16.04 LTS (Xenial Xerus), ppc64 (be) -host ./qrap 5 qemu-system-ppc64 -m 1024 -M pseries -nographic -nodefaults -serial stdio -no-reboot -nographic -vga none -hda __BASEPATH__/prepared-xenial-server-cloudimg-powerpc-disk1.img -net socket,fd=5 -net nic,model=virtio -snapshot +host qemu-system-ppc64 -m 1024 -M pseries -nographic -nodefaults -serial stdio -no-reboot -nographic -vga none -hda __BASEPATH__/prepared-xenial-server-cloudimg-powerpc-disk1.img -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -snapshot host PS1='$ ' host dhclient -4 # Skip apt-get update here: some updates to xenial-updates around 2022-01-30 @@ -188,7 +188,7 @@ host echo test Ubuntu 22.04 (Jammy Jellyfish), s390x -host ./qrap 5 qemu-system-s390x -m 2048 -smp 2 -serial stdio -nodefaults -nographic __BASEPATH__/prepared-jammy-server-cloudimg-s390x.img -net socket,fd=5 -net nic,model=virtio -device virtio-rng-ccw -snapshot +host qemu-system-s390x -m 2048 -smp 2 -serial stdio -nodefaults -nographic __BASEPATH__/prepared-jammy-server-cloudimg-s390x.img -device virtio-net-pci,netdev=s0 -netdev stream,id=s0,server=off,addr.type=unix,addr.path=__STATEDIR__/passt.socket -device virtio-rng-ccw -snapshot host export DEBIAN_FRONTEND=noninteractive host service systemd-networkd stop diff --git a/test/lib/setup b/test/lib/setup index 07d5056..5f8ce26 100755 --- a/test/lib/setup +++ b/test/lib/setup @@ -48,22 +48,21 @@ setup_passt() { context_run passt "make clean" context_run passt "make valgrind" - context_run_bg passt "valgrind --max-stackframe=$((4 * 1024 * 1024)) --trace-children=yes --vgdb=no --error-exitcode=1 --suppressions=test/valgrind.supp ./passt ${__opts} -f -t 10001 -u 10001 -P ${STATESETUP}/passt.pid" + context_run_bg passt "valgrind --max-stackframe=$((4 * 1024 * 1024)) --trace-children=yes --vgdb=no --error-exitcode=1 --suppressions=test/valgrind.supp ./passt ${__opts} -s ${STATESETUP}/passt.socket -f -t 10001 -u 10001 -P ${STATESETUP}/passt.pid" # pidfile isn't created until passt is listening wait_for [ -f "${STATESETUP}/passt.pid" ] GUEST_CID=94557 - context_run_bg qemu './qrap 5 qemu-system-$(uname -m)' \ + context_run_bg qemu 'qemu-system-$(uname -m)' \ ' -machine accel=kvm' \ ' -m '${VMEM}' -cpu host -smp '${VCPUS} \ ' -kernel ' "/boot/vmlinuz-$(uname -r)" \ ' -initrd '${INITRAMFS}' -nographic -serial stdio' \ ' -nodefaults' \ - ' -append "console=ttyS0 mitigations=off apparmor=0 ' \ - 'virtio-net.napi_tx=1"' \ - " -device virtio-net-pci,netdev=hostnet0,x-txburst=16384" \ - " -netdev socket,fd=5,id=hostnet0" \ + ' -append "console=ttyS0 mitigations=off apparmor=0" ' \ + ' -device virtio-net-pci,netdev=s0 ' \ + " -netdev stream,id=s0,server=off,addr.type=unix,addr.path=${STATESETUP}/passt.socket " \ " -pidfile ${STATESETUP}/qemu.pid" \ " -device vhost-vsock-pci,guest-cid=$GUEST_CID" @@ -143,26 +142,25 @@ setup_passt_in_ns() { if [ ${VALGRIND} -eq 1 ]; then context_run passt "make clean" context_run passt "make valgrind" - context_run_bg passt "valgrind --max-stackframe=$((4 * 1024 * 1024)) --trace-children=yes --vgdb=no --error-exitcode=1 --suppressions=test/valgrind.supp ./passt -f ${__opts} -t 10001,10011,10021,10031 -u 10001,10011,10021,10031 -P ${STATESETUP}/passt.pid" + context_run_bg passt "valgrind --max-stackframe=$((4 * 1024 * 1024)) --trace-children=yes --vgdb=no --error-exitcode=1 --suppressions=test/valgrind.supp ./passt -f ${__opts} -s ${STATESETUP}/passt.socket -t 10001,10011,10021,10031 -u 10001,10011,10021,10031 -P ${STATESETUP}/passt.pid" else context_run passt "make clean" context_run passt "make" - context_run_bg passt "./passt -f ${__opts} -t 10001,10011,10021,10031 -u 10001,10011,10021,10031 -P ${STATESETUP}/passt.pid" + context_run_bg passt "./passt -f ${__opts} -s ${STATESETUP}/passt.socket -t 10001,10011,10021,10031 -u 10001,10011,10021,10031 -P ${STATESETUP}/passt.pid" fi wait_for [ -f "${STATESETUP}/passt.pid" ] GUEST_CID=94557 - context_run_bg qemu './qrap 5 qemu-system-$(uname -m)' \ + context_run_bg qemu 'qemu-system-$(uname -m)' \ ' -machine accel=kvm' \ ' -M accel=kvm:tcg' \ ' -m '${VMEM}' -cpu host -smp '${VCPUS} \ ' -kernel ' "/boot/vmlinuz-$(uname -r)" \ ' -initrd '${INITRAMFS}' -nographic -serial stdio' \ ' -nodefaults' \ - ' -append "console=ttyS0 mitigations=off apparmor=0 ' \ - 'virtio-net.napi_tx=1"' \ - " -device virtio-net-pci,netdev=hostnet0,x-txburst=524288" \ - " -netdev socket,fd=5,id=hostnet0" \ + ' -append "console=ttyS0 mitigations=off apparmor=0" ' \ + ' -device virtio-net-pci,netdev=s0 ' \ + " -netdev stream,id=s0,server=off,addr.type=unix,addr.path=${STATESETUP}/passt.socket " \ " -pidfile ${STATESETUP}/qemu.pid" \ " -device vhost-vsock-pci,guest-cid=$GUEST_CID" @@ -191,7 +189,7 @@ setup_two_guests() { [ ${PCAP} -eq 1 ] && __opts="${__opts} -p ${LOGDIR}/pasta_1.pcap" [ ${DEBUG} -eq 1 ] && __opts="${__opts} -d" [ ${TRACE} -eq 1 ] && __opts="${__opts} --trace" - context_run_bg pasta_1 "./pasta ${__opts} -P ${STATESETUP}/pasta_1.pid -t 10001,10002 -T 10003,10004 -u 10001,10002 -U 10003,10004 --config-net ${NSHOLDER} ${STATESETUP}/ns1.hold hold" + context_run_bg pasta_1 "./pasta ${__opts} --trace -l /tmp/pasta1.log -P ${STATESETUP}/pasta_1.pid -t 10001,10002 -T 10003,10004 -u 10001,10002 -U 10003,10004 --config-net ${NSHOLDER} ${STATESETUP}/ns1.hold hold" __ns1_pid=$(${NSHOLDER} ${STATESETUP}/ns1.hold pid) context_setup_nsenter passt_1 -U -n -p --preserve-credentials -t ${__ns1_pid} @@ -199,7 +197,7 @@ setup_two_guests() { [ ${PCAP} -eq 1 ] && __opts="${__opts} -p ${LOGDIR}/pasta_2.pcap" [ ${DEBUG} -eq 1 ] && __opts="${__opts} -d" [ ${TRACE} -eq 1 ] && __opts="${__opts} --trace" - context_run_bg pasta_2 "./pasta ${__opts} -P ${STATESETUP}/pasta_2.pid -t 10004,10005 -T 10003,10001 -u 10004,10005 -U 10003,10001 --config-net ${NSHOLDER} ${STATESETUP}/ns2.hold hold" + context_run_bg pasta_2 "./pasta ${__opts} --trace -l /tmp/pasta2.log -P ${STATESETUP}/pasta_2.pid -t 10004,10005 -T 10003,10001 -u 10004,10005 -U 10003,10001 --config-net ${NSHOLDER} ${STATESETUP}/ns2.hold hold" __ns2_pid=$(${NSHOLDER} ${STATESETUP}/ns2.hold pid) context_setup_nsenter passt_2 -U -n -p --preserve-credentials -t ${__ns2_pid} @@ -215,7 +213,7 @@ setup_two_guests() { [ ${DEBUG} -eq 1 ] && __opts="${__opts} -d" [ ${TRACE} -eq 1 ] && __opts="${__opts} --trace" - context_run_bg passt_1 "./passt -P ${STATESETUP}/passt_1.pid -f ${__opts} -t 10001 -u 10001" + context_run_bg passt_1 "./passt -s ${STATESETUP}/passt_1.socket -P ${STATESETUP}/passt_1.pid -f ${__opts} -t 10001 -u 10001" wait_for [ -f "${STATESETUP}/passt_1.pid" ] __opts= @@ -223,34 +221,32 @@ setup_two_guests() { [ ${DEBUG} -eq 1 ] && __opts="${__opts} -d" [ ${TRACE} -eq 1 ] && __opts="${__opts} --trace" - context_run_bg passt_2 "./passt -P ${STATESETUP}/passt_2.pid -f ${__opts} -t 10004 -u 10004" + context_run_bg passt_2 "./passt -s ${STATESETUP}/passt_2.socket -P ${STATESETUP}/passt_2.pid -f ${__opts} -t 10004 -u 10004" wait_for [ -f "${STATESETUP}/passt_2.pid" ] GUEST_1_CID=94557 - context_run_bg qemu_1 './qrap 5 qemu-system-$(uname -m)' \ + context_run_bg qemu_1 'qemu-system-$(uname -m)' \ ' -M accel=kvm:tcg' \ ' -m '${VMEM}' -cpu host -smp '${VCPUS} \ ' -kernel ' "/boot/vmlinuz-$(uname -r)" \ ' -initrd '${INITRAMFS}' -nographic -serial stdio' \ ' -nodefaults' \ - ' -append "console=ttyS0 mitigations=off apparmor=0 ' \ - 'virtio-net.napi_tx=1"' \ - " -device virtio-net-pci,netdev=hostnet0,x-txburst=16384" \ - " -netdev socket,fd=5,id=hostnet0" \ + ' -append "console=ttyS0 mitigations=off apparmor=0" ' \ + ' -device virtio-net-pci,netdev=s0 ' \ + " -netdev stream,id=s0,server=off,addr.type=unix,addr.path=${STATESETUP}/passt_1.socket " \ " -pidfile ${STATESETUP}/qemu_1.pid" \ " -device vhost-vsock-pci,guest-cid=$GUEST_1_CID" GUEST_2_CID=94558 - context_run_bg qemu_2 './qrap 5 qemu-system-$(uname -m)' \ + context_run_bg qemu_2 'qemu-system-$(uname -m)' \ ' -M accel=kvm:tcg' \ ' -m '${VMEM}' -cpu host -smp '${VCPUS} \ ' -kernel ' "/boot/vmlinuz-$(uname -r)" \ ' -initrd '${INITRAMFS}' -nographic -serial stdio' \ ' -nodefaults' \ - ' -append "console=ttyS0 mitigations=off apparmor=0 ' \ - 'virtio-net.napi_tx=1"' \ - " -device virtio-net-pci,netdev=hostnet0,x-txburst=16384" \ - " -netdev socket,fd=5,id=hostnet0" \ + ' -append "console=ttyS0 mitigations=off apparmor=0" ' \ + ' -device virtio-net-pci,netdev=s0 ' \ + " -netdev stream,id=s0,server=off,addr.type=unix,addr.path=${STATESETUP}/passt_2.socket " \ " -pidfile ${STATESETUP}/qemu_2.pid" \ " -device vhost-vsock-pci,guest-cid=$GUEST_2_CID" -- 2.35.1