From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVuaj-0002dF-Hr for qemu-devel@nongnu.org; Wed, 17 Feb 2016 00:23:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVuag-0001ep-Bh for qemu-devel@nongnu.org; Wed, 17 Feb 2016 00:23:57 -0500 Received: from [59.151.112.132] (port=63412 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVuaf-0001dw-Qo for qemu-devel@nongnu.org; Wed, 17 Feb 2016 00:23:54 -0500 References: <1454571834-18021-1-git-send-email-zhangchen.fnst@cn.fujitsu.com> <1454571834-18021-3-git-send-email-zhangchen.fnst@cn.fujitsu.com> <56C167FE.3050803@redhat.com> From: Zhang Chen Message-ID: <56C403EE.5060604@cn.fujitsu.com> Date: Wed, 17 Feb 2016 13:23:58 +0800 MIME-Version: 1.0 In-Reply-To: <56C167FE.3050803@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V3 2/2] tests/test-filter-mirror:add filter-mirror unit test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang , qemu devel Cc: zhanghailiang , Li Zhijian , Gui jianfeng , "eddie.dong" , "Dr. David Alan Gilbert" , Yang Hongyang On 02/15/2016 01:54 PM, Jason Wang wrote: > > On 02/04/2016 03:43 PM, Zhang Chen wrote: >> From: ZhangChen >> >> 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 netdev > The 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,nowait > Hardcoded 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 >> Signed-off-by: Wen Congyang >> > [...] > > > . > -- Thanks zhangchen