Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F170048571
D50628.id156346.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
915 B
Referenced Files
None
Subscribers
None
D50628.id156346.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
@@ -573,22 +573,23 @@
atf_test_case to_root cleanup
to_root_head()
{
- atf_set "require.user" "root"
+ atf_set "require.user" "unprivileged"
}
to_root_body()
{
- dst="$(atf_get ident).$$"
+ dst="test.$(atf_get ident).$$"
echo "$dst" >dst
echo "foo" >"$dst"
- atf_check cp "$dst" /
- atf_check cmp -s "$dst" "/$dst"
- atf_check rm "/$dst"
- atf_check cp "$dst" //
- atf_check cmp -s "$dst" "/$dst"
+ atf_check -s not-exit:0 \
+ -e match:"^cp: /$dst: (Permission|Read-only)" \
+ cp "$dst" /
+ atf_check -s not-exit:0 \
+ -e match:"^cp: /$dst: (Permission|Read-only)" \
+ cp "$dst" //
}
to_root_cleanup()
{
- (dst=$(cat dst) && [ -n "/$dst" ] && [ -f "/$dst" ] && rm "/$dst") || true
+ (dst=$(cat dst) && rm "/$dst") 2>/dev/null || true
}
atf_init_test_cases()
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Sep 4, 8:57 AM (8 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38118775
Default Alt Text
D50628.id156346.diff (915 B)
Attached To
Mode
D50628: cp: Improve to_root test case.
Attached
Detach File
Event Timeline
Log In to Comment