Blame SOURCES/0039-intg-Remove-bashism-from-intgcheck-prepare.patch

ecf709
From c49fc8fded9ed87e37189bf877f04ef462974420 Mon Sep 17 00:00:00 2001
ecf709
From: Lukas Slebodnik <lslebodn@redhat.com>
ecf709
Date: Mon, 27 Mar 2017 14:44:29 +0200
ecf709
Subject: [PATCH 39/54] intg: Remove bashism from intgcheck-prepare
ecf709
ecf709
env variable UID is not defined in all shells (eg. dash)
ecf709
We also need to move invocation of "id -u" before nss_wraper
ecf709
is enabled otherwise we would get root instead of real user.
ecf709
ecf709
=================================== FAILURES ===================================
ecf709
________________________ test_kcm_mem_init_list_destroy ________________________
ecf709
Traceback (most recent call last):
ecf709
  File "/home/build/sssd/src/tests/intg/test_kcm.py", line 198, in test_kcm_mem_init_list_destroy
ecf709
    kcm_init_list_destroy(testenv)
ecf709
  File "/home/build/sssd/src/tests/intg/test_kcm.py", line 183, in kcm_init_list_destroy
ecf709
    exp_ccname = testenv.ccname()
ecf709
  File "/home/build/sssd/src/tests/intg/test_kcm.py", line 45, in ccname
ecf709
    my_uid = self.my_uid()
ecf709
  File "/home/build/sssd/src/tests/intg/test_kcm.py", line 41, in my_uid
ecf709
    return int(s_myuid)
ecf709
ValueError: invalid literal for int() with base 10: ''
ecf709
ecf709
And we already use different approach in top level Makefile.am
ecf709
3488)      $(INTGCHECK_CONFIGURE_FLAGS) \
ecf709
3489)      CFLAGS="$$CFLAGS $(AM_CFLAGS) -DKCM_PEER_UID=$$(id -u)"; \
ecf709
3490)  $(MAKE) $(AM_MAKEFLAGS) ; \
ecf709
ecf709
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
ecf709
---
ecf709
 src/tests/intg/Makefile.am | 2 +-
ecf709
 1 file changed, 1 insertion(+), 1 deletion(-)
ecf709
ecf709
diff --git a/src/tests/intg/Makefile.am b/src/tests/intg/Makefile.am
ecf709
index 8526beace09b15c99aa27ac98d5038d1980f6a71..8566106e9017a8d3c9e7a3898a3a886e2966e346 100644
ecf709
--- a/src/tests/intg/Makefile.am
ecf709
+++ b/src/tests/intg/Makefile.am
ecf709
@@ -76,6 +76,7 @@ intgcheck-installed: config.py passwd group
ecf709
 	PATH="$(abs_builddir):$(abs_srcdir):$$PATH" \
ecf709
 	PYTHONPATH="$(abs_builddir):$(abs_srcdir)" \
ecf709
 	LDB_MODULES_PATH="$(DESTDIR)$(ldblibdir)" \
ecf709
+	NON_WRAPPED_UID=$$(id -u) \
ecf709
 	LD_PRELOAD="$$nss_wrapper $$uid_wrapper" \
ecf709
 	NSS_WRAPPER_PASSWD="$(abs_builddir)/passwd" \
ecf709
 	NSS_WRAPPER_GROUP="$(abs_builddir)/group" \
ecf709
@@ -83,6 +84,5 @@ intgcheck-installed: config.py passwd group
ecf709
 	NSS_WRAPPER_MODULE_FN_PREFIX="sss" \
ecf709
 	UID_WRAPPER=1 \
ecf709
 	UID_WRAPPER_ROOT=1 \
ecf709
-	NON_WRAPPED_UID=$$(echo $$UID) \
ecf709
 	    fakeroot $(PYTHON2) $(PYTEST) -v --tb=native $(INTGCHECK_PYTEST_ARGS) .
ecf709
 	rm -f $(DESTDIR)$(logpath)/*
ecf709
-- 
ecf709
2.9.3
ecf709