Page MenuHomeFreeBSD

D43052.id131392.diff
No OneTemporary

D43052.id131392.diff

diff --git a/bin/cp/tests/cp_test.sh b/bin/cp/tests/cp_test.sh
--- a/bin/cp/tests/cp_test.sh
+++ b/bin/cp/tests/cp_test.sh
@@ -293,6 +293,34 @@
atf_check -o inline:'Symbolic Link\n' stat -f %SHT baz
}
+atf_test_case hardlink
+hardlink_body()
+{
+ echo "foo" >foo
+ atf_check cp -l foo bar
+ atf_check -o inline:"foo\n" cat bar
+ atf_check_equal "$(stat -f%d,%i foo)" "$(stat -f%d,%i bar)"
+}
+
+atf_test_case hardlink_exists
+hardlink_exists_body()
+{
+ echo "foo" >foo
+ echo "bar" >bar
+ atf_check -s not-exit:0 -e match:exists cp -l foo bar
+ atf_check -o inline:"bar\n" cat bar
+}
+
+atf_test_case hardlink_exists_force
+hardlink_exists_force_body()
+{
+ echo "foo" >foo
+ echo "bar" >bar
+ atf_check cp -fl foo bar
+ atf_check -o inline:"foo\n" cat bar
+ atf_check_equal "$(stat -f%d,%i foo)" "$(stat -f%d,%i bar)"
+}
+
atf_init_test_cases()
{
atf_add_test_case basic
@@ -311,4 +339,7 @@
atf_add_test_case sparse_to_dev
atf_add_test_case sparse_trailing_hole
atf_add_test_case standalone_Pflag
+ atf_add_test_case hardlink
+ atf_add_test_case hardlink_exists
+ atf_add_test_case hardlink_exists_force
}

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 7, 2:59 AM (12 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26785030
Default Alt Text
D43052.id131392.diff (1 KB)

Event Timeline