From 6c3371d89a9e7d928b86e076f37a1ea6b5433d94 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 11 Jul 2000 02:40:58 +0000 Subject: [PATCH] Add test for leading zero in SOA serial --- bin/tests/master/dns_master_load_11_data | 12 ++++++++++++ bin/tests/master/master11.data | 6 ++++++ bin/tests/master/t_master.c | 17 ++++++++++++++++- 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 bin/tests/master/dns_master_load_11_data create mode 100644 bin/tests/master/master11.data diff --git a/bin/tests/master/dns_master_load_11_data b/bin/tests/master/dns_master_load_11_data new file mode 100644 index 0000000000..7b667b273b --- /dev/null +++ b/bin/tests/master/dns_master_load_11_data @@ -0,0 +1,12 @@ +# +# test data for dns_master_load test 11 +# +# format is: +# masterfile origin class expected_result +# where +# masterfile name is the name of a file containing master data +# origin is the origin +# class is the zone's class +# expected_result is a text representation of a dns_result_t +# +master11.data test in ISC_R_SUCCESS diff --git a/bin/tests/master/master11.data b/bin/tests/master/master11.data new file mode 100644 index 0000000000..0aaec25ecf --- /dev/null +++ b/bin/tests/master/master11.data @@ -0,0 +1,6 @@ +; +; The following serial number contains a leading 0 and a 9 so the +; we can catch cases where it is incorrectly treated as a octal +; number. +; +@ 300 IN SOA ns hostmaster 00090000 1200 3600 604800 300 diff --git a/bin/tests/master/t_master.c b/bin/tests/master/t_master.c index d5e59eb566..c63cd94558 100644 --- a/bin/tests/master/t_master.c +++ b/bin/tests/master/t_master.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: t_master.c,v 1.25 2000/07/09 12:48:43 marka Exp $ */ +/* $Id: t_master.c,v 1.26 2000/07/11 02:40:58 marka Exp $ */ #include @@ -302,6 +302,20 @@ t10() { t_result(result); } +static const char *a11 = + "dns_master_loadfile allow leading zeros in SOA"; + +static void +t11() { + int result; + + t_assert("dns_master_loadfile", 11, T_REQUIRED, a11); + result = test_master_x("dns_master_load_11_data"); + + t_result(result); +} + + testspec_t T_testlist[] = { { t1, "ISC_R_SUCCESS" }, { t2, "ISC_R_UNEXPECTEDEND" }, @@ -313,6 +327,7 @@ testspec_t T_testlist[] = { { t8, "$INCLUDE" }, { t9, "$INCLUDE w/ DNS_BADCLASS" }, { t10, "non empty blank lines" }, + { t11, "leading zeros in serial" }, { NULL, NULL } };