From patchwork Sun Jul 4 13:45:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 110150 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o64DjgoG006125 for ; Sun, 4 Jul 2010 13:45:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757644Ab0GDNpj (ORCPT ); Sun, 4 Jul 2010 09:45:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24231 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757561Ab0GDNpg (ORCPT ); Sun, 4 Jul 2010 09:45:36 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o64DjaPW029750 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 4 Jul 2010 09:45:36 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o64DjZZq019801; Sun, 4 Jul 2010 09:45:35 -0400 Received: from localhost.localdomain (dhcp-1-188.tlv.redhat.com [10.35.1.188]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o64DjSD2029134; Sun, 4 Jul 2010 09:45:33 -0400 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH 2/3] KVM test: use kvm_utils.find_command() where appropriate Date: Sun, 4 Jul 2010 16:45:16 +0300 Message-Id: <1278251117-31220-2-git-send-email-mgoldish@redhat.com> In-Reply-To: <1278251117-31220-1-git-send-email-mgoldish@redhat.com> References: <1278251117-31220-1-git-send-email-mgoldish@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 04 Jul 2010 13:45:42 +0000 (UTC) diff --git a/client/tests/kvm/kvm_preprocessing.py b/client/tests/kvm/kvm_preprocessing.py index ee279bd..2f6994a 100644 --- a/client/tests/kvm/kvm_preprocessing.py +++ b/client/tests/kvm/kvm_preprocessing.py @@ -208,8 +208,8 @@ def preprocess(test, params, env): env["tcpdump"].close() del env["tcpdump"] if "tcpdump" not in env and params.get("run_tcpdump", "yes") == "yes": - command = "/usr/sbin/tcpdump -npvi any 'dst port 68'" - logging.debug("Starting tcpdump (%s)...", command) + cmd = "%s -npvi any 'dst port 68'" % kvm_utils.find_command("tcpdump") + logging.debug("Starting tcpdump (%s)...", cmd) env["tcpdump"] = kvm_subprocess.kvm_tail( command=command, output_func=_update_address_cache, diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py index a57a334..4183f1c 100644 --- a/client/tests/kvm/kvm_utils.py +++ b/client/tests/kvm/kvm_utils.py @@ -250,19 +250,20 @@ def verify_ip_address_ownership(ip, macs, timeout=10.0): 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") + o = commands.getoutput("%s -n" % find_command("arp")) if regex.search(o): return True # Get the name of the bridge device for arping - o = commands.getoutput("/sbin/ip route get %s" % ip) + o = commands.getoutput("%s route get %s" % (find_command("ip"), ip)) dev = re.findall("dev\s+\S+", o, re.IGNORECASE) if not dev: return False dev = dev[0].split()[-1] # Send an ARP request - o = commands.getoutput("/sbin/arping -f -c 3 -I %s %s" % (dev, ip)) + o = commands.getoutput("%s -f -c 3 -I %s %s" % + (find_command("arping"), dev, ip)) return bool(regex.search(o))