kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Autotest PATCH] virt: Only update macaddr cache when capture dhcp ACK packet
@ 2011-09-29  9:57 Amos Kong
  2011-10-01  3:30 ` ethtool pradeep
  0 siblings, 1 reply; 3+ messages in thread
From: Amos Kong @ 2011-09-29  9:57 UTC (permalink / raw)
  To: lmr; +Cc: jasowang, kvm

Currently, tcpdump can capture both dhcp Offer and ACK packets,
macaddr cache will be updated in those to condition,
dhcp Offer packet doesn't mean the IP is already allocated to
dhcp client.

Signed-off-by: Amos Kong <akong@redhat.com>
---
 client/virt/virt_env_process.py |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/client/virt/virt_env_process.py b/client/virt/virt_env_process.py
index 51c7e8a..a7621bb 100644
--- a/client/virt/virt_env_process.py
+++ b/client/virt/virt_env_process.py
@@ -403,14 +403,20 @@ def _update_address_cache(address_cache, line):
             address_cache["last_seen"] = matches[0]
     if re.search("Client.Ethernet.Address", line, re.IGNORECASE):
         matches = re.findall(r"\w*:\w*:\w*:\w*:\w*:\w*", line)
-        if matches and address_cache.get("last_seen"):
-            mac_address = matches[0].lower()
+        if matches:
+            address_cache["last_mac"] = matches[0]
+    if re.search("DHCP-Message", line, re.IGNORECASE):
+        matches = re.findall(r"ACK", line)
+        if matches and address_cache.get("last_seen") and address_cache.get(
+                                                                 "last_mac"):
+            mac_address = address_cache.get("last_mac").lower()
             if time.time() - address_cache.get("time_%s" % mac_address, 0) > 5:
                 logging.debug("(address cache) Adding cache entry: %s ---> %s",
                               mac_address, address_cache.get("last_seen"))
             address_cache[mac_address] = address_cache.get("last_seen")
             address_cache["time_%s" % mac_address] = time.time()
             del address_cache["last_seen"]
+            del address_cache["last_mac"]
 
 
 def _take_screendumps(test, params, env):


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* ethtool
  2011-09-29  9:57 [Autotest PATCH] virt: Only update macaddr cache when capture dhcp ACK packet Amos Kong
@ 2011-10-01  3:30 ` pradeep
  2011-10-03  2:16   ` ethtool Lucas Meneghel Rodrigues
  0 siblings, 1 reply; 3+ messages in thread
From: pradeep @ 2011-10-01  3:30 UTC (permalink / raw)
  To: Amos Kong; +Cc: lmr, jasowang, kvm



Hello Amos, Lmr

Couple of networking tests like ethtool, file_transfer..etc are not
doing cleaning properly.  Huge files are not getting deleted after the
test. So guest running out of space for next tests. 

--Pradeep


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ethtool
  2011-10-01  3:30 ` ethtool pradeep
@ 2011-10-03  2:16   ` Lucas Meneghel Rodrigues
  0 siblings, 0 replies; 3+ messages in thread
From: Lucas Meneghel Rodrigues @ 2011-10-03  2:16 UTC (permalink / raw)
  To: pradeep, KVM mailing list, Amos Kong, Jason Wang

On 10/01/2011 12:30 AM, pradeep wrote:
>
>
> Hello Amos, Lmr
>
> Couple of networking tests like ethtool, file_transfer..etc are not
> doing cleaning properly.  Huge files are not getting deleted after the
> test. So guest running out of space for next tests.

I will investigate Pradeep, thanks for reporting the problems, recently 
I have made the files created by the file transfer test smaller, to 
resolve guest disk fillup problems.

https://github.com/dds/autotest/commit/a90d8905a960a39628977209e5f4531a4051b25f

I will review the tests to see if we are doing proper cleanup of the 
temporary files created.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-03  2:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-29  9:57 [Autotest PATCH] virt: Only update macaddr cache when capture dhcp ACK packet Amos Kong
2011-10-01  3:30 ` ethtool pradeep
2011-10-03  2:16   ` ethtool Lucas Meneghel Rodrigues

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