1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-08-05 08:10:15 +02:00

tests: nproc: support referencing of external command

* tests/nproc/nproc-quota.sh: Use command -v nproc instead of
$abs_top_builddir for external usage of tests.
Also quote "$nproc" usage, to support spaces in path.

Link: https://github.com/coreutils/coreutils/pull/310
This commit is contained in:
oech3
2026-07-03 10:00:30 +09:00
committed by Pádraig Brady
parent d73d2d1b31
commit a463a6e6ee
+3 -3
View File
@@ -44,10 +44,10 @@ ROOT=cgroup
echo 'max 100000' > $ROOT/sys/fs/cgroup/foo/cpu.max # ignored
} || framework_failure_
nproc=$abs_top_builddir/src/nproc$EXEEXT
cp --parents $(ldd $nproc | grep -o '/[^ ]*') $ROOT ||
nproc=$(command -v nproc)
cp --parents $(ldd "$nproc" | grep -o '/[^ ]*') $ROOT ||
skip_ 'Failed to copy nproc libs to chroot'
cp $nproc $ROOT || framework_failure_
cp "$nproc" $ROOT || framework_failure_
NPROC() {
IFS=': ' read key policy < $ROOT/proc/self/sched