<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 9/12/18 5:41 PM, Sergey Bronnikov
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAAH4fuwzMj5wufd2fyHLmbt+cDb0=fTHLYEK87NQJ9VHDBqrvg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr"><br>
        <br>
        <div class="gmail_quote">
          <div dir="ltr">ср, 12 сент. 2018 г. в 12:09, Xu Han <<a
              href="mailto:xuhan@redhat.com" moz-do-not-send="true">xuhan@redhat.com</a>>:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF">
              <p><br>
              </p>
              <div class="m_-6802739582567604629moz-cite-prefix">On
                9/12/18 7:58 AM, Cleber Rosa wrote:<br>
              </div>
              <blockquote type="cite">
                <pre class="m_-6802739582567604629moz-quote-pre">On 9/11/18 5:43 AM, Sergey Bronnikov wrote:
</pre>
                <blockquote type="cite">
                  <pre class="m_-6802739582567604629moz-quote-pre">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
</pre>
                </blockquote>
                <pre class="m_-6802739582567604629moz-quote-pre">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.</pre>
              </blockquote>
            </div>
            <div text="#000000" bgcolor="#FFFFFF">
              <p>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.<br>
              </p>
              <p>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.<br>
              </p>
            </div>
          </blockquote>
          <div>Please take into account that there are many projects
            (including mine) where Avocado-VT used not for testing QEMU
            but for testing software _inside_ QEMU.<br>
          </div>
        </div>
      </div>
    </blockquote>
    <p>Sergey,<br>
    </p>
    <p>OK, I see. So I'd suggest to make "-net dump" be the third
      sniffing method, and keep the previous two for QEMU testing.
      Thanks.<br>
    </p>
    <p><br>
    </p>
    <p>Cleber,</p>
    <p>Is there a better way in Avocado to do this kind of test rather
      than using Avocado-VT?<br>
    </p>
    <p><br>
    </p>
    Thanks,<br>
    Xu<br>
    <blockquote type="cite"
cite="mid:CAAH4fuwzMj5wufd2fyHLmbt+cDb0=fTHLYEK87NQJ9VHDBqrvg@mail.gmail.com">
      <div dir="ltr">
        <div class="gmail_quote">
          <div> </div>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF">
              <p> </p>
            </div>
            <div text="#000000" bgcolor="#FFFFFF">
              <blockquote type="cite">
                <pre class="m_-6802739582567604629moz-quote-pre">Xu has written the tshak backend, so I bet he knows more about it.</pre>
              </blockquote>
            </div>
            <div text="#000000" bgcolor="#FFFFFF">
              <p>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 <span
                  id="m_-6802739582567604629result_box"
                  class="m_-6802739582567604629short_text" lang="en"><span>the
                    right informaion (see <a
                      class="m_-6802739582567604629moz-txt-link-freetext"
href="https://github.com/avocado-framework/avocado-vt/pull/1463"
                      target="_blank" moz-do-not-send="true">https://github.com/avocado-framework/avocado-vt/pull/1463</a>).<br>
                  </span></span></p>
              <p>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.<br>
              </p>
            </div>
          </blockquote>
          <div>This method may not work when OS inside QEMU is under
            test.<br>
          </div>
          <div> </div>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF"> Thanks,<br>
              Xu </div>
            <div text="#000000" bgcolor="#FFFFFF">
              <p><br>
              </p>
              <blockquote type="cite">
                <pre class="m_-6802739582567604629moz-quote-pre">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:

<a class="m_-6802739582567604629moz-txt-link-freetext" href="https://avocado-framework.readthedocs.io/en/64.0/api/utils/avocado.utils.html#module-avocado.utils.cloudinit" target="_blank" moz-do-not-send="true">https://avocado-framework.readthedocs.io/en/64.0/api/utils/avocado.utils.html#module-avocado.utils.cloudinit</a>

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,

</pre>
              </blockquote>
            </div>
          </blockquote>
        </div>
      </div>
    </blockquote>
  </body>
</html>