From 69a724b96885a04bc847f46994ba24ecc0bdf209 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 29 Oct 2026 21:30:38 +0100 Subject: [PATCH] tests: cp: ensure cp rejects --link combined with --symbolic-link Reported at https://github.com/uutils/coreutils/issues/15987 * tests/cp/link.sh: Add test cases. Link: https://github.com/coreutils/coreutils/pull/412 --- tests/cp/link.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/cp/link.sh b/tests/cp/link.sh index 8ca6bfc20..1ee6ce846 100755 --- a/tests/cp/link.sh +++ b/tests/cp/link.sh @@ -28,4 +28,10 @@ touch dest2 || framework_failure_ cp -f --link src dest || fail=1 cp -f --symbolic-link src dest2 || fail=1 +# --link and --symbolic-link are mutually exclusive. +returns_ 1 cp -s -l src new 2> err || fail=1 +test -e new && fail=1 +returns_ 1 cp --link --symbolic-link src new 2> err || fail=1 +test -e new && fail=1 + Exit $fail