3
# mmap-close.sh : Test for catching regressions when applications do this:
5
# open() -> mmap() -> *close()* -> dirty mapping -> munmap()
7
# Past regressions have been reported in these bugs:
9
# https://bugs.launchpad.net/bugs/870326
10
# https://bugs.launchpad.net/bugs/1047261
11
# Author: Tyler Hicks <tyhicks@canonical.com>
13
# Copyright (C) 2012 Canonical Ltd.
15
# This program is free software; you can redistribute it and/or
16
# modify it under the terms of the GNU General Public License
17
# as published by the Free Software Foundation version 2
20
# This program is distributed in the hope that it will be useful,
21
# but WITHOUT ANY WARRANTY; without even the implied warranty of
22
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
# GNU General Public License for more details.
25
# You should have received a copy of the GNU General Public License
26
# along with this program; if not, write to the Free Software
27
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
29
test_script_dir=$(dirname $0)
33
. ${test_script_dir}/../lib/etl_funcs.sh
37
etl_remove_test_dir $test_dir
43
trap test_cleanup 0 1 2 3 15
49
test_dir=$(etl_create_test_dir `basename $0`) || exit
50
test_file="${test_dir}/test_file"
52
${test_script_dir}/mmap-close/test $test_file || exit
54
md5sum1=$(md5sum $test_file) || exit
59
md5sum2=$(md5sum $test_file) || exit
61
if [ "$md5sum1" == "$md5sum2" ]; then