Commit a51b0404 authored by JINMEI Tatuya's avatar JINMEI Tatuya Committed by Jelte Jansen

[2380] removed loadzone/tests/error completely.

see the log for the previous commit for the rationale.
parent 2b23275b
......@@ -1178,7 +1178,6 @@ AC_CONFIG_FILES([Makefile
src/bin/loadzone/Makefile
src/bin/loadzone/tests/Makefile
src/bin/loadzone/tests/correct/Makefile
src/bin/loadzone/tests/error/Makefile
src/bin/msgq/Makefile
src/bin/msgq/tests/Makefile
src/bin/auth/Makefile
......@@ -1351,7 +1350,6 @@ AC_OUTPUT([doc/version.ent
src/bin/bindctl/tests/bindctl_test
src/bin/loadzone/run_loadzone.sh
src/bin/loadzone/tests/correct/correct_test.sh
src/bin/loadzone/tests/error/error_test.sh
src/bin/loadzone/b10-loadzone.py
src/bin/loadzone/loadzone.py
src/bin/usermgr/run_b10-cmdctl-usermgr.sh
......@@ -1420,7 +1418,6 @@ AC_OUTPUT([doc/version.ent
chmod +x src/bin/bindctl/run_bindctl.sh
chmod +x src/bin/loadzone/run_loadzone.sh
chmod +x src/bin/loadzone/tests/correct/correct_test.sh
chmod +x src/bin/loadzone/tests/error/error_test.sh
chmod +x src/bin/sysinfo/run_sysinfo.sh
chmod +x src/bin/usermgr/run_b10-cmdctl-usermgr.sh
chmod +x src/bin/msgq/run_msgq.sh
......
......@@ -55,7 +55,3 @@ EXTRA_DIST += tests/normal/sql1.example.com
EXTRA_DIST += tests/normal/sql1.example.com.signed
EXTRA_DIST += tests/normal/sql2.example.com
EXTRA_DIST += tests/normal/sql2.example.com.signed
pytest:
$(SHELL) tests/correct/correct_test.sh
$(SHELL) tests/error/error_test.sh
SUBDIRS = . correct error
SUBDIRS = . correct
PYCOVERAGE_RUN=@PYCOVERAGE_RUN@
PYTESTS = loadzone_test.py
......
EXTRA_DIST = error.known
EXTRA_DIST += formerr1.db
EXTRA_DIST += formerr2.db
EXTRA_DIST += formerr3.db
EXTRA_DIST += formerr4.db
EXTRA_DIST += formerr5.db
EXTRA_DIST += include.txt
EXTRA_DIST += keyerror1.db
EXTRA_DIST += keyerror2.db
EXTRA_DIST += keyerror3.db
#EXTRA_DIST += nofilenane.db
EXTRA_DIST += originerr1.db
EXTRA_DIST += originerr2.db
noinst_SCRIPTS = error_test.sh
# If necessary (rare cases), explicitly specify paths to dynamic libraries
# required by loadable python modules.
LIBRARY_PATH_PLACEHOLDER =
if SET_ENV_LIBRARY_PATH
LIBRARY_PATH_PLACEHOLDER += $(ENV_LIBRARY_PATH)=$(abs_top_builddir)/src/lib/cryptolink/.libs:$(abs_top_builddir)/src/lib/dns/.libs:$(abs_top_builddir)/src/lib/dns/python/.libs:$(abs_top_builddir)/src/lib/cc/.libs:$(abs_top_builddir)/src/lib/config/.libs:$(abs_top_builddir)/src/lib/log/.libs:$(abs_top_builddir)/src/lib/util/.libs:$(abs_top_builddir)/src/lib/exceptions/.libs:$(abs_top_builddir)/src/lib/util/io/.libs:$(abs_top_builddir)/src/lib/datasrc/.libs:$$$(ENV_LIBRARY_PATH)
endif
# TODO: use TESTS ?
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
echo Running test: error_test.sh
$(LIBRARY_PATH_PLACEHOLDER) $(SHELL) $(abs_builddir)/error_test.sh
Error reading zone file: Cannot parse RR, No $ORIGIN: @ IN SOA ns hostmaster 1 3600 1800 1814400 3600
Error reading zone file: $ORIGIN is not absolute in record: $ORIGIN com
Error reading zone file: Cannot parse RR: $TL 300
Error reading zone file: Cannot parse RR: $OIGIN com.
Error loading database: Error while loading com.: Cannot parse RR: $INLUDE file.txt
Error loading database: Error while loading com.: Invalid $include format
Error loading database: Error while loading com.: Cannot parse RR, No $ORIGIN: include.txt sub
Error reading zone file: Invalid TTL: ""
Error reading zone file: Invalid TTL: "M"
Error loading database: Error while loading com.: Cannot parse RR: b "no type error!"
Error reading zone file: Could not open bogusfile
#! /bin/sh
# Copyright (C) 2010 Internet Systems Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
PYTHON_EXEC=${PYTHON_EXEC:-@PYTHON@}
export PYTHON_EXEC
PYTHONPATH=@abs_top_builddir@/src/lib/python/isc/log_messages:@abs_top_srcdir@/src/lib/python:@abs_top_builddir@/src/lib/python
export PYTHONPATH
LOADZONE_PATH=@abs_top_builddir@/src/bin/loadzone
TEST_OUTPUT_PATH=@abs_top_builddir@/src/bin/loadzone/tests/error
TEST_FILE_PATH=@abs_top_srcdir@/src/bin/loadzone/tests/error
cd ${LOADZONE_PATH}/tests/error
export LOADZONE_PATH
status=0
echo "PYTHON PATH: $PYTHONPATH"
# This error cannot happen for the new loadzone as it requires the origin
# as a command line argument.
#echo "Test no \$ORIGIN error in zone file"
#${LOADZONE_PATH}/b10-loadzone -c '{"database_file": "'zone.sqlite3'"}' ${TEST_FILE_PATH}/originerr1.db 1> /dev/null 2> error.out
#${LOADZONE_PATH}/b10-loadzone -c '{"database_file": "'zone.sqlite3'"}' ${TEST_FILE_PATH}/originerr2.db 1> /dev/null 2>> error.out
echo "Test: key word TTL spell error"
${LOADZONE_PATH}/b10-loadzone -c '{"database_file": "'zone.sqlite3'"}' \
com. ${TEST_FILE_PATH}/keyerror1.db 1> /dev/null 2>> error.out
echo "Test: key word ORIGIN spell error"
${LOADZONE_PATH}/b10-loadzone -c '{"database_file": "'zone.sqlite3'"}' com. \
${TEST_FILE_PATH}/keyerror2.db 1> /dev/null 2>> error.out
echo "Test: key INCLUDE spell error"
${LOADZONE_PATH}/b10-loadzone -c '{"database_file": "'zone.sqlite3'"}' com. \
${TEST_FILE_PATH}/keyerror3.db 1> /dev/null 2>> error.out
echo "Test: include formal error, miss filename"
${LOADZONE_PATH}/b10-loadzone -c '{"database_file": "'zone.sqlite3'"}' com. \
${TEST_FILE_PATH}/formerr1.db 1> /dev/null 2>>error.out
echo "Test: include form error, domain is not absolute"
${LOADZONE_PATH}/b10-loadzone -c '{"database_file": "'zone.sqlite3'"}' com. \
${TEST_FILE_PATH}/formerr2.db 1> /dev/null 2>> error.out
echo "Test: TTL form error, no ttl value"
${LOADZONE_PATH}/b10-loadzone -c '{"database_file": "'zone.sqlite3'"}' com. \
${TEST_FILE_PATH}/formerr3.db 1> /dev/null 2>> error.out
echo "Test: TTL form error, ttl value error"
${LOADZONE_PATH}/b10-loadzone -c '{"database_file": "'zone.sqlite3'"}' com. ${TEST_FILE_PATH}/formerr4.db 1> /dev/null 2>> error.out
echo "Test: rr form error, no type"
${LOADZONE_PATH}/b10-loadzone -c '{"database_file": "'zone.sqlite3'"}' com. \
${TEST_FILE_PATH}/formerr5.db 1> /dev/null 2>> error.out
echo "Test: zone file is bogus"
# since bogusfile doesn't exist anyway, we *don't* specify the directory
${LOADZONE_PATH}/b10-loadzone -c '{"database_file": "'zone.sqlite3'"}' . \
bogusfile 1> /dev/null 2>> error.out
diff error.out ${TEST_FILE_PATH}/error.known || status=1
echo "Clean tmp file."
#rm -f error.out
rm -f zone.sqlite3
echo "I:exit status:$status"
echo "-----------------------------------------------------------------------------"
echo "Ran 11 test files"
echo ""
if [ "$status" -eq 1 ];then
echo "ERROR"
else
echo "OK"
fi
exit $status
$TTL 300
$ORIGIN com.
@ IN SOA ns hostmaster (
1 ; serial
3600
1800
1814400
3600
)
NS ns
ns A 127.0.0.1
$INCLUDE
a A 10.0.0.1
$TTL 300
com. IN SOA ns.com. hostmaster.com. (
1 ; serial
3600
1800
1814400
3600
)
NS ns.example.com.
ns.com. A 127.0.0.1
$INCLUDE include.txt sub
a.com. A 10.0.0.1
$TTL
$ORIGIN com.
@ IN SOA ns hostmaster (
1 ; serial
3600
1800
1814400
3600
)
NS ns
ns A 127.0.0.1
a A 10.0.0.1
$TTL M
$ORIGIN com.
@ IN SOA ns hostmaster (
1 ; serial
3600
1800
1814400
3600
)
NS ns
ns A 127.0.0.1
a A 10.0.0.1
$TTL 2M
$ORIGIN com.
@ IN SOA ns hostmaster (
1 ; serial
3600
1800
1814400
3600
)
NS ns
ns A 127.0.0.1 ; ip value
b "no type error!"
a A 10.0.0.1
$TL 300
@ORIGIN com.
@ IN SOA ns hostmaster (
1 ; serial
3600
1800
1814400
3600
)
NS ns
ns A 127.0.0.1
a A 10.0.0.1
$TTL 300
$OIGIN com.
@ IN SOA ns hostmaster (
1 ; serial
3600
1800
1814400
3600
)
NS ns
ns A 127.0.0.1
a A 10.0.0.1
$TTL 300
$ORIGIN com.
@ IN SOA ns hostmaster (
1 ; serial
3600
1800
1814400
3600
)
NS ns
ns A 127.0.0.1
$INLUDE file.txt
a A 10.0.0.1
$TTL 300
@ IN SOA ns hostmaster (
1 ; serial
3600
1800
1814400
3600
)
NS ns
ns A 127.0.0.1
a A 10.0.0.1
$TTL 300
$ORIGIN com
@ IN SOA ns hostmaster (
1 ; serial
3600
1800
1814400
3600
)
NS ns
ns A 127.0.0.1
a A 10.0.0.1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment