From 2ae8d34666a6dea4c1c77a1905c7b8cebd6a21f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Wed, 27 Mar 2024 11:03:56 +0100 Subject: [PATCH] ln: Add a test case for ln -sfF. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude, asomers Differential Revision: https://reviews.freebsd.org/D44513 --- bin/ln/tests/ln_test.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bin/ln/tests/ln_test.sh b/bin/ln/tests/ln_test.sh index 7daf5c5cdec0..8e5dcf81e61f 100644 --- a/bin/ln/tests/ln_test.sh +++ b/bin/ln/tests/ln_test.sh @@ -161,6 +161,22 @@ sf_flag_body() atf_check_symlink_to A B } +atf_test_case sfF_flag +sfF_flag_head() +{ + atf_set "descr" "Verify that if the target file already exists " \ + "and is a symlink, then '-sfF' option removes " \ + "it so that the link may occur" +} +sfF_flag_body() +{ + atf_check mkdir A B C + atf_check ln -sF A C + atf_check_symlink_to A C + atf_check ln -sfF B C + atf_check_symlink_to B C +} + atf_test_case s_flag s_flag_head() { @@ -209,6 +225,7 @@ atf_init_test_cases() atf_add_test_case snf_flag_dir atf_add_test_case sF_flag atf_add_test_case sf_flag + atf_add_test_case sfF_flag atf_add_test_case s_flag atf_add_test_case s_flag_broken atf_add_test_case sw_flag