2012-06-24 03:25:49 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2017-03-09 08:01:10 +08:00
|
|
|
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
|
|
|
. ../test_common.sh
|
|
|
|
|
2012-06-24 03:25:49 +08:00
|
|
|
set -e
|
|
|
|
|
|
|
|
# Get the target OS and CPU
|
|
|
|
CPU=`uname -p`
|
|
|
|
OS=`uname`
|
|
|
|
|
|
|
|
#Constants
|
2019-04-20 10:32:26 +08:00
|
|
|
FILE1=tst_mmap1.nc
|
|
|
|
FILE3=tst_mmap3.nc
|
2012-06-24 03:25:49 +08:00
|
|
|
|
|
|
|
echo ""
|
2018-10-11 03:32:17 +08:00
|
|
|
echo "*** Testing create files with mmap"
|
2012-06-24 03:25:49 +08:00
|
|
|
|
2018-10-11 03:32:17 +08:00
|
|
|
echo "**** Test create mmap netCDF classic file without persistence"
|
2017-03-09 08:01:10 +08:00
|
|
|
${execdir}/tst_diskless mmap
|
2018-10-11 03:32:17 +08:00
|
|
|
echo "PASS: create mmap netCDF classic file without persistence"
|
2012-06-24 03:25:49 +08:00
|
|
|
|
|
|
|
echo ""
|
2018-10-11 03:32:17 +08:00
|
|
|
echo "**** Test create mmap netCDF classic file with persistence"
|
2012-06-24 03:25:49 +08:00
|
|
|
rm -f $FILE1
|
2019-04-20 10:32:26 +08:00
|
|
|
${execdir}/tst_diskless mmap persist file:tst_mmap1.nc
|
2012-06-24 03:25:49 +08:00
|
|
|
if test -f $FILE1 ; then
|
|
|
|
echo "**** $FILE1 created"
|
2017-04-04 11:39:44 +08:00
|
|
|
# ${NCDUMP} $FILE1
|
2018-10-11 03:32:17 +08:00
|
|
|
echo "PASS: create mmap netCDF classic file with persistence"
|
2012-06-24 03:25:49 +08:00
|
|
|
else
|
|
|
|
echo "#### $FILE1 not created"
|
2018-10-11 03:32:17 +08:00
|
|
|
echo "FAIL: create mmap netCDF classic file with persistence"
|
2012-06-24 03:25:49 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
rm -f tmp1.cdl tmp2.cdl tmp1.nc tmp2.nc
|
|
|
|
|
|
|
|
echo ""
|
2018-10-11 03:32:17 +08:00
|
|
|
echo "**** Testing open files with mmap"
|
2012-06-24 03:25:49 +08:00
|
|
|
|
|
|
|
# clear old files
|
2019-04-20 10:32:26 +08:00
|
|
|
rm -f tst_diskless3_mmap_create.cdl
|
|
|
|
rm -f tst_diskless3_mmap_open.cdl
|
2012-06-24 03:25:49 +08:00
|
|
|
|
|
|
|
echo ""
|
2019-04-20 10:32:26 +08:00
|
|
|
echo "**** create and modify file using mmap"
|
2012-06-24 03:25:49 +08:00
|
|
|
rm -f $FILE3
|
|
|
|
|
2019-04-20 10:32:26 +08:00
|
|
|
${execdir}/tst_diskless3 mmap persist create
|
|
|
|
${NCDUMP} $FILE3 >tst_diskless3_mmap_create.cdl
|
|
|
|
# compare
|
|
|
|
diff ${srcdir}/ref_tst_diskless3_create.cdl tst_diskless3_mmap_create.cdl
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "**** open and modify file using mmap"
|
|
|
|
${execdir}/tst_diskless3 mmap persist open
|
|
|
|
${NCDUMP} $FILE3 >tst_diskless3_mmap_open.cdl
|
2012-06-24 03:25:49 +08:00
|
|
|
# compare
|
2019-04-20 10:32:26 +08:00
|
|
|
diff ${srcdir}/ref_tst_diskless3_open.cdl tst_diskless3_mmap_open.cdl
|
2012-06-24 03:25:49 +08:00
|
|
|
|
|
|
|
# cleanup
|
2019-04-20 10:32:26 +08:00
|
|
|
rm -f $FILE1 $FILE3 tst_diskless3_mmap_create.cdl tst_diskless3_mmap_open.cdl
|
2012-06-24 03:25:49 +08:00
|
|
|
|
|
|
|
exit
|