From: Tom Hromatka Date: Wed, 5 Apr 2023 15:38:55 +0000 (+0000) Subject: src: ftests: Better management of libcgroup idle thread X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d559d97a8dc576f9be5f6b1fce3cea153e1ab2e0;p=thirdparty%2Flibcgroup.git src: ftests: Better management of libcgroup idle thread Add the libcgroup_systemd_idle_thread to the EXTRA_DIST list. This makes it available during `make distcheck`. Modifying the PATH environment variable when running sudo is not allowed on some systems. Copy the libcgroup_systemd_idle_thread to /bin to overcome this. Signed-off-by: Tom Hromatka Reviewed-by: Kamalesh Babulal (cherry picked from commit 3f3e0dc1fdadfd9cd0de227c568fb90eea63d9a0) --- diff --git a/src/Makefile.am b/src/Makefile.am index 6ca91407..c871c1d5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,6 +7,7 @@ SUBDIRS = . daemon pam tools if ENABLE_PYTHON SUBDIRS += python endif +EXTRA_DIST = libcgroup_systemd_idle_thread # generate parse.h from parse.y AM_YFLAGS = -d diff --git a/tests/ftests/ftests-wrapper.sh b/tests/ftests/ftests-wrapper.sh index 95ec0cda..7a65de63 100755 --- a/tests/ftests/ftests-wrapper.sh +++ b/tests/ftests/ftests-wrapper.sh @@ -63,14 +63,19 @@ RET1=$? -n Libcg"$RANDOM" RET2=$? -pushd ../../src || cleanup $AUTOMAKE_HARD_ERROR -PATH="$PATH:$(pwd)" -export PATH -popd || cleanup $AUTOMAKE_HARD_ERROR +if [ -z "$srcdir" ]; then + # $srcdir is set by automake but will likely be empty when run by hand and + # that's fine + srcdir="" +else + srcdir=$srcdir"/" +fi -sudo PATH="$PATH" PYTHONPATH="$PYTHONPATH" ./ftests.py -l 10 -s "sudo" \ +sudo cp $srcdir../../src/libcgroup_systemd_idle_thread /bin +sudo PYTHONPATH="$PYTHONPATH" ./ftests.py -l 10 -s "sudo" \ -L "$START_DIR/ftests-nocontainer.py.sudo.log" --no-container -n Libcg"$RANDOM" RET3=$? +sudo rm /bin/libcgroup_systemd_idle_thread if [ "$START_DIR" != "$SCRIPT_DIR" ]; then rm -f "$START_DIR"/*.py