python:tests: Use bin/tdbdump only if built
authorAndreas Schneider <asn@samba.org>
Wed, 22 Nov 2017 15:53:52 +0000 (16:53 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 24 Nov 2017 00:13:14 +0000 (01:13 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/registry.py

index 1a8a1266b8231d7986386539a7f6fc3a6ca2ba58..f6af5f7bd15d093da75d518ae372c992a1b2f37c 100644 (file)
@@ -56,7 +56,11 @@ class HiveTests(samba.tests.TestCaseInTempDir):
         self.assertIsNone(self.hive.set_value('foo2', 1, 'bar2'))
         self.assertIsNone(self.hive.flush())
 
-        proc = Popen(['bin/tdbdump', self.hive_path], stdout=PIPE, stderr=PIPE)
+        tdbdump_tool = 'tdbdump'
+        if os.path.isfile('bin/tdbdump'):
+            tdbdump_tool = 'bin/tdbdump'
+
+        proc = Popen([tdbdump_tool, self.hive_path], stdout=PIPE, stderr=PIPE)
         tdb_dump, err = proc.communicate()
         self.assertTrue(b'DN=VALUE=FOO2,HIVE=NONE' in tdb_dump)