From: Kamil Dudka Date: Fri, 7 Feb 2020 16:05:06 +0000 (+0100) Subject: tests: ensure tests/cp/preserve-gid.sh works with single binary X-Git-Tag: v8.32~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b96b1a47286632fd1cb738cf5a9893cf72a70d30;p=thirdparty%2Fcoreutils.git 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 --- 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() {