Germano Veit Michel <germ...@redhat.com> writes: > Hi guys, > > Finally got some time to prepare V3. > > First of all Dave's trick is really useful to test it: > > ./x86_64-softmmu/qemu-system-x86_64 -nographic -nodefaults -netdev > user,id=netuser -object filter-dump,id=dump,netdev=netuser,file=foo2 > -device e1000,netdev=netuser,mac=00:11:22:33:44:55 -monitor stdio > QEMU 2.8.91 monitor - type 'help' for more information > (qemu) announce-self > (qemu) announce-self > (qemu) qemu-system-x86_64: terminating on signal 2 > > tshark -r foo2 | grep RARP > 1 0.000000 Cimsys_33:44:55 → Broadcast RARP 60 Who is > 00:11:22:33:44:55? Tell 00:11:22:33:44:55 > 2 0.050017 Cimsys_33:44:55 → Broadcast RARP 60 Who is > 00:11:22:33:44:55? Tell 00:11:22:33:44:55 > 3 0.200077 Cimsys_33:44:55 → Broadcast RARP 60 Who is > 00:11:22:33:44:55? Tell 00:11:22:33:44:55 > 4 0.450112 Cimsys_33:44:55 → Broadcast RARP 60 Who is > 00:11:22:33:44:55? Tell 00:11:22:33:44:55 > 5 0.800090 Cimsys_33:44:55 → Broadcast RARP 60 Who is > 00:11:22:33:44:55? Tell 00:11:22:33:44:55 > 13 5.583887 Cimsys_33:44:55 → Broadcast RARP 60 Who is > 00:11:22:33:44:55? Tell 00:11:22:33:44:55 > 14 5.633079 Cimsys_33:44:55 → Broadcast RARP 60 Who is > 00:11:22:33:44:55? Tell 00:11:22:33:44:55 > 15 5.783152 Cimsys_33:44:55 → Broadcast RARP 60 Who is > 00:11:22:33:44:55? Tell 00:11:22:33:44:55 > 16 6.033130 Cimsys_33:44:55 → Broadcast RARP 60 Who is > 00:11:22:33:44:55? Tell 00:11:22:33:44:55 > 17 6.383144 Cimsys_33:44:55 → Broadcast RARP 60 Who is > 00:11:22:33:44:55? Tell 00:11:22:33:44:55 > > Now for qtest: > > It is compiling and running my test: > > [....] > CC tests/qmp-net-test.o > LINK tests/qmp-net-test > [....] > GTESTER check-qtest-x86_64 > > /bin/sh -c printf " %-7s %s\n" "GTESTER" "check-qtest-x86_64" && > QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img > MALLOC_PERTURB_=${MALLOC_PERTURB_:-$((RANDOM % 255 + 1))} gtester -k -q > -m=quick [.....] tests/qmp-net-test [....] > > Weird is... is the test qemu running without NICs?
Please show us test/qmp-net-test.c. > x86_64-softmmu/qemu-system-x86_64 -qtest unix:/tmp/qtest-17545.sock,nowait > -qtest-log /dev/null -qmp unix:/tmp/qtest-17545.qmp,nowait -machine > accel=qtest -display none -M q35,accel=tcg -chardev > file,id=serial0,path=/tmp/qtest-boot-serial-HYHJ2e -no-shutdown -serial > chardev:serial0 -device sga > > I was looking at this > http://events.linuxfoundation.org/sites/events/files/slides/Testing%20QEMU%20emulated%20devices%20using%20qtest.pdf > and it's pretty helpful. But I have no clues on how to actually check if > the RARP packets really go out on each NIC. Any idea on how to implement > this or is the smoke test enough? I'd try to use filter-dump to capture the traffic, then compare the actual captured traffic to the expected one.