From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 812995A026B for ; Tue, 1 Nov 2022 06:19:45 +0100 (CET) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4N1dcW4lYqz4xN3; Tue, 1 Nov 2022 16:19:39 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1667279979; bh=2Anr1vcsLxCZf4Dw7gEW6kQvybQc/rIZNvX38HZu/mM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C8rjcxnI82HtUr48Zl5AwNrCSFhBCxlsg00JPGvaSsCe4NIqmQAnUwbx+OS3sWSPX 9R39+uWTX8TDfGVguoEGju9cafCIYgR9FesaluhWF2VhqUn6Z/SHP5Pu+LIOO7QZae r1RzblyrgHlU6ve89utNBodFDRPoru+HUr7jP9gI= From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH 2/2] test: Don't use "outer" passt for memory usage tests Date: Tue, 1 Nov 2022 16:19:37 +1100 Message-Id: <20221101051937.1294869-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221101051937.1294869-1-david@gibson.dropbear.id.au> References: <20221101051937.1294869-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 7OJ7I5RG2S7RINVOYMDHNCQCFKJYF4XS X-Message-ID-Hash: 7OJ7I5RG2S7RINVOYMDHNCQCFKJYF4XS X-MailFrom: dgibson@gandalf.ozlabs.org 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 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: The memory usage tests check both userspace and kernel memory usage of passt. We run it inside a VM so that we can examine kernel memory usage without noise from whatever else is happening on the host system. Currently we also give that VM network connectivity to the outside world using another instance of passt on the host. The memory usage tests are purely local to the VM, so outside connectivity is neither needed nor desirable. Remove it and instead run the passt within the VM against a local dummy interface. Signed-off-by: David Gibson --- test/lib/layout_ugly | 9 --------- test/lib/setup_ugly | 21 ++------------------- test/passt.mem.mbuto | 3 ++- 3 files changed, 4 insertions(+), 29 deletions(-) diff --git a/test/lib/layout_ugly b/test/lib/layout_ugly index d62d337..22f6169 100644 --- a/test/lib/layout_ugly +++ b/test/lib/layout_ugly @@ -90,9 +90,7 @@ layout_memory() { cmd_write 0 clear tmux split-window -h -l '35%' -t passt_test - tmux split-window -v -l '15%' -t passt_test - PANE_PASST=2 PANE_GUEST=0 PANE_INFO=1 @@ -109,13 +107,6 @@ layout_memory() { tmux select-pane -t ${PANE_GUEST} -T "guest" fi - if context_exists passt; then - pane_watch_contexts ${PANE_PASST} passt passt - else - tmux pipe-pane -O -t ${PANE_PASST} "cat >> ${LOGDIR}/pane_passt.log" - tmux select-pane -t ${PANE_PASST} -T "passt" - fi - info_layout "memory usage" sleep 1 diff --git a/test/lib/setup_ugly b/test/lib/setup_ugly index f2e07ba..bcf07ef 100755 --- a/test/lib/setup_ugly +++ b/test/lib/setup_ugly @@ -29,25 +29,15 @@ setup_pasta_options() { # setup_memory() - Start qemu in guest pane, and passt in passt context setup_memory() { - context_setup_host passt - layout_memory - context_run passt "./passt -P ${STATESETUP}/passt.pid" - - # pidfile isn't created until passt is listening - wait_for [ -f "${STATESETUP}/passt.pid" ] - - pane_or_context_run guest './qrap 5 qemu-system-$(uname -m)' \ + pane_or_context_run guest 'qemu-system-$(uname -m)' \ ' -machine accel=kvm' \ ' -m '${VMEM}' -cpu host -smp '${VCPUS} \ ' -kernel ' "/boot/vmlinuz-$(uname -r)" \ ' -initrd '${INITRAMFS_MEM}' -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"' \ " -pidfile ${STATESETUP}/qemu.pid" } @@ -65,11 +55,4 @@ teardown_pasta_options() { # teardown_passt() - Kill qemu with ^C, remove passt PID file teardown_memory() { kill $(cat "${STATESETUP}/qemu.pid") - - rm "${STATESETUP}/passt.pid" - - tmux send-keys -t ${PANE_PASST} "C-c" - - teardown_context_watch ${PANE_PASST} passt - teardown_context_watch ${PANE_GUEST} qemu } diff --git a/test/passt.mem.mbuto b/test/passt.mem.mbuto index 537ff80..dc06015 100755 --- a/test/passt.mem.mbuto +++ b/test/passt.mem.mbuto @@ -14,7 +14,7 @@ PROGS="${PROGS:-ash,dash,bash chmod ip mount insmod mkdir ln cat chmod modprobe grep mknod sed chown sleep bc ls ps mount unshare chroot cp kill diff head tail sort tr tee cut nm which}" -KMODS="${KMODS:- virtio_net virtio_pci vmw_vsock_virtio_transport}" +KMODS="${KMODS:- dummy}" NODES="${NODES:-console kmsg null ptmx random urandom zero}" @@ -29,6 +29,7 @@ COPIES="${COPIES} ../passt.avx2,/bin/passt.avx2" FIXUP="${FIXUP}"' ln -s /bin /usr/bin chmod 777 /tmp +ip link add eth0 type dummy ip link set eth0 up ip address add 192.0.2.2/24 dev eth0 ip address add 2001:db8::2/64 dev eth0 -- 2.38.1