Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109313224
D43052.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D43052.diff
View Options
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
@@ -71,6 +71,35 @@
check_size trunc 0
}
+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_check_not_equal "$(stat -f%d,%i foo)" "$(stat -f%d,%i 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_test_case matching_srctgt
matching_srctgt_body()
{
@@ -298,6 +327,9 @@
atf_add_test_case basic
atf_add_test_case basic_symlink
atf_add_test_case chrdev
+ atf_add_test_case hardlink
+ atf_add_test_case hardlink_exists
+ atf_add_test_case hardlink_exists_force
atf_add_test_case matching_srctgt
atf_add_test_case matching_srctgt_contained
atf_add_test_case matching_srctgt_link
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 4, 10:52 AM (4 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16452275
Default Alt Text
D43052.diff (1 KB)
Attached To
Mode
D43052: cp: Add tests for hard link case.
Attached
Detach File
Event Timeline
Log In to Comment