Sat Jun 5 06:40:59 2021 UTC ()
Use the correct pathname when cleaning up the inner mount on test
failure.  Fixes the ATF crash reported in PR bin/56221, but not
the issue causing the test to fail in the first place.


(gson)
diff -r1.10 -r1.11 src/tests/fs/tmpfs/t_vnd.sh

cvs diff -r1.10 -r1.11 src/tests/fs/tmpfs/t_vnd.sh (expand / switch to unified diff)

--- src/tests/fs/tmpfs/t_vnd.sh 2017/03/23 08:18:17 1.10
+++ src/tests/fs/tmpfs/t_vnd.sh 2021/06/05 06:40:59 1.11
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: t_vnd.sh,v 1.10 2017/03/23 08:18:17 martin Exp $ 1# $NetBSD: t_vnd.sh,v 1.11 2021/06/05 06:40:59 gson Exp $
2# 2#
3# Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. 3# Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
4# All rights reserved. 4# All rights reserved.
5# Redistribution and use in source and binary forms, with or without 5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions 6# modification, are permitted provided that the following conditions
7# are met: 7# are met:
8# 1. Redistributions of source code must retain the above copyright 8# 1. Redistributions of source code must retain the above copyright
9# notice, this list of conditions and the following disclaimer. 9# notice, this list of conditions and the following disclaimer.
10# 2. Redistributions in binary form must reproduce the above copyright 10# 2. Redistributions in binary form must reproduce the above copyright
11# notice, this list of conditions and the following disclaimer in the 11# notice, this list of conditions and the following disclaimer in the
12# documentation and/or other materials provided with the distribution. 12# documentation and/or other materials provided with the distribution.
13# 13#
14# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 14# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
@@ -59,24 +59,24 @@ basic_body() { @@ -59,24 +59,24 @@ basic_body() {
59 [ $(md5 mnt/${f} | cut -d ' ' -f 4) = \ 59 [ $(md5 mnt/${f} | cut -d ' ' -f 4) = \
60 53d025127ae99ab79e8502aae2d9bea6 ] || \ 60 53d025127ae99ab79e8502aae2d9bea6 ] || \
61 atf_fail "Invalid checksum for file ${f}" 61 atf_fail "Invalid checksum for file ${f}"
62 done 62 done
63 63
64 atf_check -s eq:0 -o empty -e empty umount mnt 64 atf_check -s eq:0 -o empty -e empty umount mnt
65 atf_check -s eq:0 -o empty -e empty vndconfig -u ${vnddev} 65 atf_check -s eq:0 -o empty -e empty vndconfig -u ${vnddev}
66 66
67 test_unmount 67 test_unmount
68 touch done 68 touch done
69} 69}
70basic_cleanup() { 70basic_cleanup() {
71 if [ ! -f done ]; then 71 if [ ! -f done ]; then
72 umount mnt 2>/dev/null 1>&2 72 umount mntpt/mnt 2>/dev/null 1>&2
73 vndconfig -u ${vnddev} 2>/dev/null 1>&2 73 vndconfig -u ${vnddev} 2>/dev/null 1>&2
74 fi 74 fi
75} 75}
76 76
77atf_init_test_cases() { 77atf_init_test_cases() {
78 . $(atf_get_srcdir)/../h_funcs.subr 78 . $(atf_get_srcdir)/../h_funcs.subr
79 . $(atf_get_srcdir)/h_funcs.subr 79 . $(atf_get_srcdir)/h_funcs.subr
80 80
81 atf_add_test_case basic 81 atf_add_test_case basic
82} 82}