From f18d9e147d4a242cdfb31a816d91d277b99badae Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 23 Mar 2012 23:46:02 +0100 Subject: selftest.py: Add selftest.target.samba with bindir_path function. --- selftest/target/samba.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 selftest/target/samba.py (limited to 'selftest/target') diff --git a/selftest/target/samba.py b/selftest/target/samba.py new file mode 100644 index 0000000000..5e652a3528 --- /dev/null +++ b/selftest/target/samba.py @@ -0,0 +1,24 @@ +#!/usr/bin/perl +# Bootstrap Samba and run a number of tests against it. +# Copyright (C) 2005-2012 Jelmer Vernooij +# Published under the GNU GPL, v3 or later. + +import os +import sys +import warnings + +from selftest.target import Target + +def bindir_path(binary_mapping, bindir, path): + """Find the executable to use. + + :param binary_mapping: Dictionary mapping binary names + :param bindir: Directory with binaries + :param path: Name of the executable to run + :return: Full path to the executable to run + """ + path = binary_mapping.get(path, path) + valpath = os.path.join(bindir, path) + if os.path.isfile(valpath): + return valpath + return path -- cgit