|
From: | Zhang Chen |
Subject: | Re: [Qemu-devel] [PATCH V3 2/2] tests/test-filter-mirror:add filter-mirror unit test |
Date: | Wed, 17 Feb 2016 13:23:58 +0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 |
On 02/15/2016 01:54 PM, Jason Wang wrote:
On 02/04/2016 03:43 PM, Zhang Chen wrote:From: ZhangChen <address@hidden> Using qtest qmp interface to implement following cases: 1) add/remove filter-mirror 2) add a filter-mirror then delete the netdev 3) add/remove more than one filter-mirrors 4) add more than one filter-mirrors and then delete the netdevThe steps here is rather similar to test-netfilter.c. Let's try to generalize them instead of duplicating codes.
We consider that netfilter need a common test case to test common function for all filter plugin. so we will remove it in this patch and write anther patch for netfilter common test in futrue. and now we will focus on filter-redirector, filter-rewriter and filter-compare.
5) add filter-mirror with: -object filter-mirror,id=qtest-f0,netdev=qtest-bn0,queue=tx,outdev=mirror0 then inject packet from the socket connected to qtest-bn0, filter-mirror will copy and mirror the packet to mirror0. we read packet from mirror0 and then compare to what we inject. del filter-mirror. we start qemu with: -netdev socket,id=qtest-bn0,listen=127.0.0.1:9005 -device e1000,netdev=qtest-bn0,id=qtest-e0 -chardev socket,id=mirror0,host=127.0.0.1,port=9003,server,nowait -chardev socket,id=mirror1,host=127.0.0.1,port=9004,server,nowaitHardcoded port is not good here since it may cause false positive (consider the tests may be trigged by lots of automated script both upstream and downstream). A better solution is using socketpair(2) and passing pre-created fd(s) to file chardev.
I will fix it in next patch Thanks zhangchen
Signed-off-by: zhangchen <address@hidden> Signed-off-by: Wen Congyang <address@hidden>[...] .
-- Thanks zhangchen
[Prev in Thread] | Current Thread | [Next in Thread] |