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 Don't put temporary files and ...



details:   https://anonhg.NetBSD.org/src/rev/a1b8ac9a19fc
branches:  trunk
changeset: 365879:a1b8ac9a19fc
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sat Apr 30 17:09:44 2022 +0000

description:
Don't put temporary files and directories into the atf_srcdir (that
might be read-only!).  Instead, put them in the test's working
directory what the atf framework will automatically clean up after
the test completes.

diffstat:

 tests/lib/libc/kevent_nullmnt/t_nullmnt.sh |  22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diffs (42 lines):

diff -r e1fffc2586cd -r a1b8ac9a19fc tests/lib/libc/kevent_nullmnt/t_nullmnt.sh
--- a/tests/lib/libc/kevent_nullmnt/t_nullmnt.sh        Sat Apr 30 15:45:41 2022 +0000
+++ b/tests/lib/libc/kevent_nullmnt/t_nullmnt.sh        Sat Apr 30 17:09:44 2022 +0000
@@ -6,27 +6,27 @@
 
 nullmnt_body()
 {    
-       srcdir=$(atf_get_srcdir)
-       helper=${srcdir}/h_nullmnt
+       curdir=$(pwd)
+       helper=$(atf_get_srcdir)/h_nullmnt
 
-       mkdir ${srcdir}/realdir
-       mkdir ${srcdir}/nulldir
-       mount -t null ${srcdir}/realdir ${srcdir}/nulldir
-       rm -f ${srcdir}/realdir/afile
-       touch ${srcdir}/realdir/afile
+       mkdir ${curdir}/realdir
+       mkdir ${curdir}/nulldir
+       mount -t null ${curdir}/realdir ${curdir}/nulldir
+       rm -f ${curdir}/realdir/afile
+       touch ${curdir}/realdir/afile
 
        atf_expect_fail "PR kern/56713"
 
        atf_check -e ignore -o ignore -s exit:0 \
-               ${helper} ${srcdir}/realdir/afile ${srcdir}/nulldir/afile
+               ${helper} ${curdir}/realdir/afile ${curdir}/nulldir/afile
 
 } 
 
 nullmnt_cleanup()
 {
-       srcdir=$(atf_get_srcdir)
-       umount ${srcdir}/nulldir
-       rm -rf ${srcdir}/realdir ${srcdir}/nulldir
+       curdir=$(pwd)
+       umount ${curdir}/nulldir
+       rm -rf ${curdir}/realdir ${curdir}/nulldir
 }
 
 atf_init_test_cases()



Home | Main Index | Thread Index | Old Index