2012-06-24 03:25:49 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2017-04-04 11:39:44 +08:00
|
|
|
|
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
|
|
|
|
FILE1=tst_diskless.nc
|
|
|
|
FILE2=tst_diskless2.nc
|
|
|
|
FILE3=tst_diskless3.nc
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "*** Testing in-memory (diskless) files with mmap"
|
|
|
|
|
|
|
|
echo "**** Test diskless+mmap netCDF classic file without persistence"
|
2017-03-09 08:01:10 +08:00
|
|
|
${execdir}/tst_diskless mmap
|
2012-06-24 03:25:49 +08:00
|
|
|
echo "PASS: diskless+mmap netCDF classic file without persistence"
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "**** Test diskless+mmap netCDF classic file with persistence"
|
|
|
|
rm -f $FILE1
|
2017-03-09 08:01:10 +08:00
|
|
|
${execdir}/tst_diskless mmap persist
|
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
|
2012-06-24 03:25:49 +08:00
|
|
|
echo "PASS: diskless+mmap netCDF classic file with persistence"
|
|
|
|
else
|
|
|
|
echo "#### $FILE1 not created"
|
|
|
|
echo "FAIL: diskless+mmap netCDF classic file with persistence"
|
|
|
|
fi
|
|
|
|
|
|
|
|
rm -f tmp1.cdl tmp2.cdl tmp1.nc tmp2.nc
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "**** Testing nc_open in-memory (diskless+mmap) files"
|
|
|
|
|
|
|
|
# clear old files
|
|
|
|
rm -f tst_diskless3_file.cdl tst_diskless3_memory.cdl
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "**** Create and modify file without using diskless+mmap"
|
|
|
|
rm -f $FILE3
|
2017-03-09 08:01:10 +08:00
|
|
|
${execdir}/tst_diskless3
|
|
|
|
${NCDUMP} $FILE3 >tst_diskless3_file.cdl
|
2012-06-24 03:25:49 +08:00
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "**** Create and modify file using diskless+mmap"
|
|
|
|
rm -f $FILE3
|
2017-03-09 08:01:10 +08:00
|
|
|
${execdir}/tst_diskless3 diskless mmap
|
|
|
|
${NCDUMP} $FILE3 >tst_diskless3_memory.cdl
|
2012-06-24 03:25:49 +08:00
|
|
|
|
|
|
|
# compare
|
|
|
|
diff tst_diskless3_file.cdl tst_diskless3_memory.cdl
|
|
|
|
|
|
|
|
# cleanup
|
|
|
|
rm -f $FILE3 tst_diskless3_file.cdl tst_diskless3_memory.cdl
|
|
|
|
|
|
|
|
exit
|