From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>, passt-dev@passt.top
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH 2/2] test: Don't use "outer" passt for memory usage tests
Date: Tue, 1 Nov 2022 16:19:37 +1100 [thread overview]
Message-ID: <20221101051937.1294869-3-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20221101051937.1294869-1-david@gibson.dropbear.id.au>
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 <david@gibson.dropbear.id.au>
---
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
--
@@ -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
next prev parent reply other threads:[~2022-11-01 5:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-01 5:19 [PATCH 0/2] Refinements to memory usage tests David Gibson
2022-11-01 5:19 ` [PATCH 1/2] test: Correct passt binary path for " David Gibson
2022-11-01 5:19 ` David Gibson [this message]
2022-11-01 8:02 ` [PATCH 2/2] test: Don't use "outer" passt " Stefano Brivio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221101051937.1294869-3-david@gibson.dropbear.id.au \
--to=david@gibson.dropbear.id.au \
--cc=passt-dev@passt.top \
--cc=sbrivio@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).