[Avocado-devel] Using network sniffer in avocado-vt

Xu Han xuhan at redhat.com
Wed Sep 12 09:08:58 UTC 2018


On 9/12/18 7:58 AM, Cleber Rosa wrote:
>
> On 9/11/18 5:43 AM, Sergey Bronnikov wrote:
>> Hello!
>>
>> avocado-vt uses network sniffer (tshark or tcpdump) for getting
>> IP address of running guest OS. QEMU has an option to dump network
>> traffic to a file. Using this option looks simpler than using of
>> external sniffer . I believe there were reasons to prefer sniffer
>> instead of qemu dump option. Can someone tell about them?
>>
>> Sergey
> Sergey,
>
> It'd be nice to try to rewrite the "sniffing" code in terms of "-object
> filter-dump" (AKA "-net dump").
>
> I see that there are some limitations in the QEMU builtin network dump,
> but we can always use such an implementation when appropriate.

It's a good idea to use '-net dump' functionality for getting IP 
addresses, parsing pcap format files is always be easy than parsing 
plain text generated by those sniffer tools.

However, my concern is that this method is a little bit aggressive, I'm 
not sure if enabling this function  for a guest would affect the other 
part of the network function. And please be noted that a well 
functioning QEMU is the guarantee for us to get the correct IP 
addresses, while the QEMU is the box that we are testing.

>
> Xu has written the tshak backend, so I bet he knows more about it.

Honestly speaking, I have no idea about why it used tcpdump not others.. 
The reason of adding the tshark(wireshark) support is, sometimes, 
tcpdump has the problem to get the right informaion (see 
https://github.com/avocado-framework/avocado-vt/pull/1463).

We can also get IP adresses by using the function provided by 
qemu-guest-agent, it can work with both dhcp and static network. But, 
for me, it is an "aggressive" way as well.


Thanks,
Xu


>
> FIY, we're trying a different approach of getting guest information on
> Avocado (not on Avocado-VT), by using the "cloudinit" feature when the
> guest has support for it:
>
> https://avocado-framework.readthedocs.io/en/64.0/api/utils/avocado.utils.html#module-avocado.utils.cloudinit
>
> It's simplistic at the moment, but it's possible to check for the
> instance id used, and get the IP address from the the "phone home" HTTP
> connection.
>
> Regards,
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/avocado-devel/attachments/20180912/d96c5607/attachment.htm>


More information about the Avocado-devel mailing list