qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>,
	qemu devel <qemu-devel@nongnu.org>
Cc: zhanghailiang <zhang.zhanghailiang@huawei.com>,
	Li Zhijian <lizhijian@cn.fujitsu.com>,
	Gui jianfeng <guijianfeng@cn.fujitsu.com>,
	"eddie.dong" <eddie.dong@intel.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Yang Hongyang <hongyang.yang@easystack.cn>
Subject: Re: [Qemu-devel] [PATCH V3 2/2] tests/test-filter-mirror:add filter-mirror unit test
Date: Mon, 15 Feb 2016 13:54:06 +0800	[thread overview]
Message-ID: <56C167FE.3050803@redhat.com> (raw)
In-Reply-To: <1454571834-18021-3-git-send-email-zhangchen.fnst@cn.fujitsu.com>



On 02/04/2016 03:43 PM, Zhang Chen wrote:
> From: ZhangChen <zhangchen.fnst@cn.fujitsu.com>
>
> 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.

> 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.

>
> Signed-off-by: zhangchen <zhangchen.fnst@cn.fujitsu.com>
> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
>

[...]

  reply	other threads:[~2016-02-15  5:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-04  7:43 [Qemu-devel] [PATCH V3 0/2] net/filter-mirror:add filter-mirror and unit test Zhang Chen
2016-02-04  7:43 ` [Qemu-devel] [PATCH V3 1/2] net/filter-mirror:Add filter-mirror Zhang Chen
2016-02-04  9:00   ` Zhang Chen
2016-02-15  5:23     ` Jason Wang
2016-02-15  7:06       ` Zhang Chen
2016-02-17  3:53         ` Zhang Chen
2016-02-23  1:50           ` Jason Wang
2016-02-04  7:43 ` [Qemu-devel] [PATCH V3 2/2] tests/test-filter-mirror:add filter-mirror unit test Zhang Chen
2016-02-15  5:54   ` Jason Wang [this message]
2016-02-17  5:23     ` Zhang Chen

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=56C167FE.3050803@redhat.com \
    --to=jasowang@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eddie.dong@intel.com \
    --cc=guijianfeng@cn.fujitsu.com \
    --cc=hongyang.yang@easystack.cn \
    --cc=lizhijian@cn.fujitsu.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zhang.zhanghailiang@huawei.com \
    --cc=zhangchen.fnst@cn.fujitsu.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.
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 NNTP newsgroup(s).