[PATCH] Fix samba.tests.registry

Andreas Schneider asn at samba.org
Wed Nov 22 17:12:05 UTC 2017


Hi,

when we don't build tdb but have it in the system, the test fails. The 
attached patch makes sure it works in both scenarios.

Review appricated. Push if OK.


Thanks,


	Andreas

-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org
-------------- next part --------------
>From cd015d4114bf63e8925d40211dd9d3d81bb4348e Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Wed, 22 Nov 2017 16:53:52 +0100
Subject: [PATCH] python:tests: Use bin/tdbdump only if built

Signed-off-by: Andreas Schneider <asn at samba.org>
---
 python/samba/tests/registry.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/python/samba/tests/registry.py b/python/samba/tests/registry.py
index 1a8a1266b82..f6af5f7bd15 100644
--- a/python/samba/tests/registry.py
+++ b/python/samba/tests/registry.py
@@ -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)
 
-- 
2.15.0



More information about the samba-technical mailing list