From ecf8bd36d7fb4a278817a51e238b92ba07300ab8 Mon Sep 17 00:00:00 2001 From: Erez_Zadok Date: Sat, 14 Jul 2007 03:58:01 -0400 Subject: [PATCH] Improve the mmap test. 1. produce files that are larger than one page, so we test multi-page mmap reads and writes. 2. perform mmap reads and writes on BOTH the read-write and read-only branches. --- t-mmap.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/t-mmap.sh b/t-mmap.sh index 5ada47b..8632883 100755 --- a/t-mmap.sh +++ b/t-mmap.sh @@ -1,7 +1,7 @@ #!/bin/sh # TEST: Branches: b0,b1=ro and b0,b1 -# TEST: open(a), mmap) for reading, read, unmap, close -# TEST: open(b), mmap for writing/copyup, read, rewrite, unmap, close +# read-only TEST: open(f), mmap for reading, read, unmap, close +# readwrite TEST: open(f), mmap for writing/copyup, read, rewrite, unmap, close source scaffold @@ -9,8 +9,8 @@ function files { cat </dev/null + dd if=/dev/zero of=$LOWER_DIR1/b bs=4096 count=4 2>/dev/null ./progs/mapper -r $MOUNTPOINT/a > /dev/null + ./progs/mapper -r $MOUNTPOINT/b > /dev/null unmount_union echo -n "[ro] " ( afterfiles_ro ) | check_hierarchy $TOP_LOWER_DIR @@ -55,7 +58,10 @@ function test_ro { # read-write mmap test function test_rw { ( files ) | create_hierarchy + dd if=/dev/zero of=$LOWER_DIR0/a bs=4096 count=4 2>/dev/null + dd if=/dev/zero of=$LOWER_DIR1/b bs=4096 count=4 2>/dev/null mount_union "" $LOWER_DIR0 $LOWER_DIR1=ro + ./progs/mapper -w $MOUNTPOINT/a > /dev/null ./progs/mapper -w $MOUNTPOINT/b > /dev/null echo -n "[rw] " unmount_union -- 2.43.0