Add a testcase for ln -sF

The testcase fails today, so mark it with atf_expect_fail: in
particular, the target (B) isn't being unlinked and the documentation
doesn't suggest special handling for directories. Thus, there's either
a doc or an implementation bug in ln(1) that needs to be resolved.

MFC after:	1 month
MFC with:	r319714, r319854, r319855
PR:		219943
Reviewed by:	ngie
Submitted by:	shivansh
Differential Revision:	D11159 (part of a larger diff)
Sponsored by:	Google, Inc (GSoC 2017)
This commit is contained in:
Enji Cooper 2017-06-12 16:38:37 +00:00
parent 07b984360c
commit ed66391a6e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=319856

View File

@ -150,6 +150,22 @@ snf_flag_dir_body()
atf_check -o inline:'B\n' readlink C
}
atf_test_case sF_flag
sF_flag_head()
{
atf_set "descr" "Verify that if the target file already exists " \
"and is a directory, then '-sF' option removes " \
"it so that the link may occur"
}
sF_flag_body()
{
atf_expect_fail "B isn't being unlinked (bug 219943)"
atf_check mkdir A B
atf_check ln -sF A B
atf_check -o inline:'Symbolic Link\n' stat -f %SHT B
}
atf_test_case sf_flag
sf_flag_head()
{
@ -220,6 +236,7 @@ atf_init_test_cases()
atf_add_test_case target_exists_symbolic
atf_add_test_case shf_flag_dir
atf_add_test_case snf_flag_dir
atf_add_test_case sF_flag
atf_add_test_case sf_flag
atf_add_test_case s_flag
atf_add_test_case s_flag_broken