Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/kevent_nullmnt Update test so all four combin...



details:   https://anonhg.NetBSD.org/src/rev/bf1e460107cb
branches:  trunk
changeset: 366538:bf1e460107cb
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Mon May 30 03:33:07 2022 +0000

description:
Update test so all four combinations of update_{upper, lower} x
monitor_{upper, lower}} can be verified.  Currently update_upper
is expected to fail regardless of which file is being monitored.

PR kern/56713

diffstat:

 tests/lib/libc/kevent_nullmnt/t_nullmnt.sh |  97 +++++++++++++++++++++++------
 1 files changed, 76 insertions(+), 21 deletions(-)

diffs (115 lines):

diff -r e18e3309f29e -r bf1e460107cb tests/lib/libc/kevent_nullmnt/t_nullmnt.sh
--- a/tests/lib/libc/kevent_nullmnt/t_nullmnt.sh        Sun May 29 23:43:49 2022 +0000
+++ b/tests/lib/libc/kevent_nullmnt/t_nullmnt.sh        Mon May 30 03:33:07 2022 +0000
@@ -1,35 +1,90 @@
-atf_test_case nullmnt cleanup
-nullmnt_head()
-{ 
-       atf_set "descr" "ensure file events traverse null-mounts"
-}    
+# common test body
+#    $1 = pathname of file to monitor
+#    $2 = pathname of file to update/modify
 
-nullmnt_body()
+nullmnt_common()
 {    
        curdir=$(pwd)
        helper=$(atf_get_srcdir)/h_nullmnt
 
-       mkdir ${curdir}/realdir
-       mkdir ${curdir}/nulldir
-       mount -t null ${curdir}/realdir ${curdir}/nulldir
-       rm -f ${curdir}/realdir/afile
-       touch ${curdir}/realdir/afile
+       mkdir ${curdir}/lower_dir
+       mkdir ${curdir}/upper_dir
+       mount -t null ${curdir}/lower_dir ${curdir}/upper_dir
+       rm -f ${curdir}/lower_dir/afile
+       touch ${curdir}/lower_dir/afile
 
-       atf_expect_fail "PR kern/56713"
+       atf_check -e ignore -o ignore -s exit:0         \
+               ${helper} ${curdir}/${1} ${curdir}/${2}
+}
 
-       atf_check -e ignore -o ignore -s exit:0 \
-               ${helper} ${curdir}/realdir/afile ${curdir}/nulldir/afile
-
-} 
-
-nullmnt_cleanup()
+nullmnt_common_cleanup()
 {
        curdir=$(pwd)
-       umount ${curdir}/nulldir
-       rm -rf ${curdir}/realdir ${curdir}/nulldir
+       umount ${curdir}/upper_dir
+       rm -rf ${curdir}/lower_dir ${curdir}/upper_dir
+}
+
+atf_test_case nullmnt_upper_lower cleanup
+nullmnt_upper_lower_head()
+{
+       atf_set "descr" "ensure upper fs events seen on lower fs"
+}
+nullmnt_upper_lower_body()
+{
+       atf_expect_fail "PR kern/56713"
+       nullmnt_common lower_dir/afile upper_dir/afile
+} 
+nullmnt_upper_lower_cleanup()
+{
+       nullmnt_common_cleanup
+}
+
+atf_test_case nullmnt_upper_upper cleanup
+nullmnt_upper_upper_head()
+{
+       atf_set "descr" "ensure upper fs events seen on upper fs"
+}
+nullmnt_upper_upper_body()
+{
+       atf_expect_fail "PR kern/56713"
+       nullmnt_common upper_dir/afile upper_dir/afile
+} 
+nullmnt_upper_upper_cleanup()
+{
+       nullmnt_common_cleanup
+}
+atf_test_case nullmnt_lower_upper cleanup
+nullmnt_lower_upper_head()
+{
+       atf_set "descr" "ensure lower fs events seen on upper fs"
+}
+nullmnt_lower_upper_body()
+{
+       nullmnt_common upper_dir/afile lower_dir/afile
+} 
+nullmnt_lower_upper_cleanup()
+{
+       nullmnt_common_cleanup
+}
+
+atf_test_case nullmnt_lower_lower cleanup
+nullmnt_lower_lower_head()
+{
+       atf_set "descr" "ensure lower fs events seen on lower fs"
+}
+nullmnt_lower_lower_body()
+{
+       nullmnt_common lower_dir/afile lower_dir/afile
+} 
+nullmnt_lower_lower_cleanup
+{
+       nullmnt_common_cleanup()
 }
 
 atf_init_test_cases()
 {
-       atf_add_test_case nullmnt
+       atf_add_test_case nullmnt_upper_upper
+       atf_add_test_case nullmnt_upper_lower
+       atf_add_test_case nullmnt_lower_upper
+       atf_add_test_case nullmnt_lower_lower
 }



Home | Main Index | Thread Index | Old Index