svn commit: r313514 - stable/10/contrib/netbsd-tests/fs/tmpfs
Ngie Cooper
ngie at FreeBSD.org
Fri Feb 10 02:51:55 UTC 2017
Author: ngie
Date: Fri Feb 10 02:51:53 2017
New Revision: 313514
URL: https://svnweb.freebsd.org/changeset/base/313514
Log:
MFC r307190,r307196,r307204,r307205:
r307190:
Skip :uchg on FreeBSD
Unfortunately removing files with uchg set always succeeds with root on
FreeBSD. Unfortunately running the test as an unprivileged user isn't doable
because mounting tmpfs requires root
PR: 212861
r307196:
Port contrib/netbsd-tests/fs/tmpfs/h_tools.c to FreeBSD
- Add inttypes.h #include for PRId64 macro
- Use FreeBSD's copy of getfh(2), which doesn't include a `fh_size` parameter.
Use sizeof(fhandle_t) instead as the size of fhp is always fixed as
fhandle_t, unlike NetBSD's copy of fhp, which is void*.
r307204:
Expect :large to fail on FreeBSD
FreeBSD doesn't appear to validate large -o size values like
NetBSD does
PR: 212862
r307205:
Change atf_skip call to atf_expect_fail to make it clear that a failure is
expected
PR: 212861
Suggested by: jmmv
Modified:
stable/10/contrib/netbsd-tests/fs/tmpfs/h_tools.c
stable/10/contrib/netbsd-tests/fs/tmpfs/t_mount.sh
stable/10/contrib/netbsd-tests/fs/tmpfs/t_remove.sh
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/contrib/netbsd-tests/fs/tmpfs/h_tools.c
==============================================================================
--- stable/10/contrib/netbsd-tests/fs/tmpfs/h_tools.c Fri Feb 10 02:48:24 2017 (r313513)
+++ stable/10/contrib/netbsd-tests/fs/tmpfs/h_tools.c Fri Feb 10 02:51:53 2017 (r313514)
@@ -50,6 +50,10 @@
#include <string.h>
#include <unistd.h>
+#ifdef __FreeBSD__
+#include <inttypes.h>
+#endif
+
/* --------------------------------------------------------------------- */
static int getfh_main(int, char **);
@@ -70,7 +74,12 @@ getfh_main(int argc, char **argv)
if (argc < 2)
return EXIT_FAILURE;
+#ifdef __FreeBSD__
+ fh_size = sizeof(fhandle_t);
+#else
fh_size = 0;
+#endif
+
fh = NULL;
for (;;) {
if (fh_size) {
@@ -85,7 +94,11 @@ getfh_main(int argc, char **argv)
* but it may change if someone moves things around,
* so retry untill we have enough memory.
*/
+#ifdef __FreeBSD__
+ error = getfh(argv[1], fh);
+#else
error = getfh(argv[1], fh, &fh_size);
+#endif
if (error == 0) {
break;
} else {
Modified: stable/10/contrib/netbsd-tests/fs/tmpfs/t_mount.sh
==============================================================================
--- stable/10/contrib/netbsd-tests/fs/tmpfs/t_mount.sh Fri Feb 10 02:48:24 2017 (r313513)
+++ stable/10/contrib/netbsd-tests/fs/tmpfs/t_mount.sh Fri Feb 10 02:51:53 2017 (r313514)
@@ -93,7 +93,18 @@ negative_body() {
test_unmount
}
+# Begin FreeBSD
+if true; then
+atf_test_case large cleanup
+large_cleanup() {
+ umount -f tmp 2>/dev/null
+}
+else
+# End FreeBSD
atf_test_case large
+# Begin FreeBSD
+fi
+# End FreeBSD
large_head() {
atf_set "descr" "Tests that extremely long values passed to -s" \
"are handled correctly"
@@ -103,6 +114,10 @@ large_body() {
test_mount -o -s9223372036854775807
test_unmount
+ # Begin FreeBSD
+ atf_expect_fail "-o -s<large-size> succeeds unexpectedly on FreeBSD - bug 212862"
+ # End FreeBSD
+
mkdir tmp
atf_check -s eq:1 -o empty -e ignore \
mount -t tmpfs -o -s9223372036854775808 tmpfs tmp
Modified: stable/10/contrib/netbsd-tests/fs/tmpfs/t_remove.sh
==============================================================================
--- stable/10/contrib/netbsd-tests/fs/tmpfs/t_remove.sh Fri Feb 10 02:48:24 2017 (r313513)
+++ stable/10/contrib/netbsd-tests/fs/tmpfs/t_remove.sh Fri Feb 10 02:51:53 2017 (r313514)
@@ -46,13 +46,28 @@ single_body() {
test_unmount
}
+# Begin FreeBSD
+if true; then
+atf_test_case uchg cleanup
+uchg_cleanup() {
+ Mount_Point=$(pwd)/mntpt test_unmount || :
+}
+else
+# End FreeBSD
atf_test_case uchg
+# Begin FreeBSD
+fi
+# End FreeBSD
uchg_head() {
atf_set "descr" "Checks that files with the uchg flag set cannot" \
"be removed"
atf_set "require.user" "root"
}
uchg_body() {
+ # Begin FreeBSD
+ atf_expect_fail "this fails on FreeBSD with root - bug 212861"
+ # End FreeBSD
+
test_mount
atf_check -s eq:0 -o empty -e empty touch a
More information about the svn-src-stable
mailing list