On 02/29/2016 08:23 PM, Zhang Chen wrote: > In this unit test,we will test the filter redirector function. > > Start qemu with: > > "-netdev tap,id=qtest-bn0 "
Please don't use tap since it needs - CAP_NET_ADMIN - if-up script Neither of above could not be true for a qtest environment. > "-device rtl8139,netdev=qtest-bn0,id=qtest-e0 " > "-chardev socket,id=redirector0,path=%s,server,nowait " > "-chardev socket,id=redirector1,path=%s,server,nowait " > "-object filter-redirector,id=qtest-f1,netdev=qtest-bn0," > "queue=tx,indev=redirector1 " > "-object filter-redirector,id=qtest-f0,netdev=qtest-bn0," > "queue=tx,outdev=redirector0 " > > We inject packet to -chardev redirector1,then filter-redirector > will pass it to filter, another filter-redirector get it and > redirect it to redirector0,we read packet from redirector0 > and compare to what we inject. Looks correct but I think queue='rx' should also be tested here. How about: - using backend - redirect tx traffic to a chardev, then inject packet from socket and read it from chardev - redirect from another chardev to rx traffic, then inject packet from chardev and read if from socket?