From b96b1a47286632fd1cb738cf5a9893cf72a70d30 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Fri, 7 Feb 2020 17:05:06 +0100 Subject: [PATCH] tests: ensure tests/cp/preserve-gid.sh works with single binary * tests/cp/preserve-gid.sh: If configured with --enable-single-binary copy the coreutils single binary, instead of the cp one-line launcher. Discussed at https://bugzilla.redhat.com/1800597 Fixes https://bugs.gnu.org/39485 --- tests/cp/preserve-gid.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/cp/preserve-gid.sh b/tests/cp/preserve-gid.sh index e48584c1e9..bba09df098 100755 --- a/tests/cp/preserve-gid.sh +++ b/tests/cp/preserve-gid.sh @@ -110,7 +110,14 @@ cleanup_() { rm -rf "$tmp_path"; } # is not readable by our nameless IDs. test -d /tmp && TMPDIR=/tmp tmp_path=$(mktemp -d) || fail_ "failed to create temporary directory" -cp "$abs_path_dir_/cp" "$tmp_path" +if test -x "$abs_path_dir_/coreutils" && + { test -l "$abs_path_dir_/cp" || + test $(wc -l < "$abs_path_dir_/cp") = 1; } then + # if configured with --enable-single-binary we need to use the single binary + cp "$abs_path_dir_/coreutils" "$tmp_path/cp" || framework_failure_ +else + cp "$abs_path_dir_/cp" "$tmp_path" +fi chmod -R a+rx "$tmp_path" t1() { -- 2.47.2