From: "Cao, Chen" Subject: [PATCH] KVM Test: Add re.IGNORECASE to re.compile to verify_ip_address_ in kvm_utils.py Date: Tue, 27 Oct 2009 12:03:36 +0800 Message-ID: <1256616216-7179-1-git-send-email-kcao@redhat.com> Cc: kvm@vger.kernel.org, "Cao, Chen" To: lmr@redhat.com, autotest@test.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:5669 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750816AbZJ0EEy (ORCPT ); Tue, 27 Oct 2009 00:04:54 -0400 Sender: kvm-owner@vger.kernel.org List-ID: Since the mac address is (changed to) lowercase and the output of 'arping' is in uppercase, we need re.IGNORECASE in the re.compile. (the re.IGNORECASE in the re.search function takes no effect on the compiled regex.) Signed-off-by: Cao, Chen --- client/tests/kvm/kvm_utils.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py index f72984a..934f223 100644 --- a/client/tests/kvm/kvm_utils.py +++ b/client/tests/kvm/kvm_utils.py @@ -190,7 +190,7 @@ def verify_ip_address_ownership(ip, macs, timeout=10.0): # Compile a regex that matches the given IP address and any of the given # MAC addresses mac_regex = "|".join("(%s)" % mac for mac in macs) - regex = re.compile(r"\b%s\b.*\b(%s)\b" % (ip, mac_regex)) + regex = re.compile(r"\b%s\b.*\b(%s)\b" % (ip, mac_regex), re.IGNORECASE) # Check the ARP cache o = commands.getoutput("/sbin/arp -n") -- 1.6.0.6