[SSSD] [PATCH] config API: prepend source dir search path for tests

Sumit Bose sbose at redhat.com
Fri Feb 28 09:25:25 UTC 2014


On Wed, Feb 26, 2014 at 11:45:58AM +0100, Sumit Bose wrote:
> Hi,
> 
> I came across this while testing some changes to the config API.
> 
> Additionally I realized that the config API opens every file in
> schemaplugindir (.../sssd.api.d) including hidden ones starting with a
> '.'. This might lead to test failures if backup copies or swap file of
> running editors are read. Since this is primarily an issue on developers
> systems I wonder if this should be fixed or not?
> 
> bye,
> Sumit

I found that this patch break 'make distcheck' because now 'make check'
really uses the files in the build directory and as a result *.pyc files
are created in the build directory which are currently not remove by
'make clean'.

This new version should fix this.

bye,
Sumit
-------------- next part --------------
From 5a5797fbe6cd0128e2e91ebe7cdd11b117c2f484 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Wed, 26 Feb 2014 11:35:24 +0100
Subject: [PATCH] config API: prepend source dir search path for tests

Instead of appending the search patch in the source directory should be
prepended. Otherwise the test might find files installed in the default
paths of the system first.

As a result the compiled python files in the build directory must be
remove in the clean target to make 'make distcheck' pass.
---
 Makefile.am                  | 2 ++
 src/config/SSSDConfigTest.py | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 31ac813..05653a2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2307,6 +2307,8 @@ if BUILD_PYTHON_BINDINGS
 		rm -f $(builddir)/src/config/SSSDConfig/sssd_upgrade_config.py ; \
 	fi
 
+	rm -f $(builddir)/src/config/SSSDConfig/*.pyc
+
 	cd $(builddir)/src/config; $(PYTHON) setup.py build --build-base $(abs_builddir)/src/config clean --all
 endif
 	for doc in $(SSSD_DOCS); do \
diff --git a/src/config/SSSDConfigTest.py b/src/config/SSSDConfigTest.py
index 182572f..bfec8d0 100755
--- a/src/config/SSSDConfigTest.py
+++ b/src/config/SSSDConfigTest.py
@@ -12,7 +12,7 @@ import sys
 
 srcdir = os.getenv('srcdir')
 if srcdir:
-    sys.path.append("./src/config")
+    sys.path.insert(0, "./src/config")
     srcdir = srcdir + "/src/config"
 else:
     srcdir = "."
-- 
1.8.3.1



More information about the sssd-devel mailing list