]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
add a test for large map files
authorEvan Hunt <each@isc.org>
Tue, 24 Aug 2021 20:10:13 +0000 (13:10 -0700)
committerEvan Hunt <each@isc.org>
Wed, 1 Sep 2021 15:17:32 +0000 (08:17 -0700)
- a test has been added to 'masterformat', but disabled by default,
  because it takes several minutes to run and uses a lot of disk.

bin/tests/system/masterformat/clean.sh
bin/tests/system/masterformat/tests.sh

index 80289e9267d872d1604e6c25f7b6dc548b366fe4..82502fc4302bcb9cb1b5bf24b8df0a80215229eb 100755 (executable)
@@ -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
index 0f569fd0593b7c6242564a9d4675edf1a35616ea..364a0d266d807c4b7a90cbcbed90c9ea0c4d2dac 100755 (executable)
@@ -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