KVM test: use kvm_utils.find_command() where appropriate
Instead of hardcoding binary paths, use kvm_utils.find_command().
This should make the KVM test a little more distro independent.
Changes from v1:
- Fix a mistake in kvm_preprocessing.py (used 'command' instead of 'cmd')
Signed-off-by: Michael Goldish <mgoldish@redhat.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@4708 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/tests/kvm/kvm_preprocessing.py b/client/tests/kvm/kvm_preprocessing.py
index ee279bd..9ae0e08 100644
--- a/client/tests/kvm/kvm_preprocessing.py
+++ b/client/tests/kvm/kvm_preprocessing.py
@@ -208,10 +208,10 @@
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,
+ command=cmd,
output_func=_update_address_cache,
output_params=(env["address_cache"],))
if kvm_utils.wait_for(lambda: not env["tcpdump"].is_alive(),