add a test for large map files

- a test has been added to 'masterformat', but disabled by default,
  because it takes several minutes to run and uses a lot of disk.
This commit is contained in:
Evan Hunt 2021-08-24 13:10:13 -07:00
parent e9d62d2442
commit 06b9fc8a7d
2 changed files with 21 additions and 1 deletions

View file

@ -26,7 +26,7 @@ rm -f ./ns2/formerly-text.db
rm -f ./ns2/db-*
rm -f ./ns2/large.bk
rm -f ./ns3/example.db.map ./ns3/dynamic.db.map
rm -f ./baseline.txt ./text.1 ./text.2 ./raw.1 ./raw.2 ./map.1 ./map.2 ./map.5 ./text.5 ./badmap
rm -f ./baseline.txt ./text.* ./raw.* ./map.* ./badmap
rm -f ./ns1/Ksigned.* ./ns1/dsset-signed. ./ns1/signed.db.signed
rm -f ./rndc.out
rm -f ./ns*/named.lock

View file

@ -331,5 +331,25 @@ n=$((n+1))
[ $ret -eq 0 ] || echo_i "failed"
status=$((status+ret))
# The following test is disabled by default because it is very slow.
# It fails on Windows, because a single read() call (specifically
# the one in isc_file_mmap()) cannot process more than INT_MAX (2^31)
# bytes of data.
if [ -n "${TEST_LARGE_MAP}" ]; then
echo_i "checking map file size > 2GB can be loaded ($n)"
ret=0
$PERL ../../startperf/mkzonefile.pl test 9000000 > text.$n
# convert to map
$CHECKZONE -D -f text -F map -o map.$n test text.$n > /dev/null || ret=1
# check map file size is over 2GB to ensure the test is valid
size=$(ls -l map.$n | awk '{print $5}')
[ "$size" -gt 2147483648 ] || ret=1
# convert back to text
$CHECKZONE -f map test map.$n > /dev/null || ret=1
n=$((n+1))
[ $ret -eq 0 ] || echo_i "failed"
status=$((status+ret))
fi
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1