correct_test.sh.in 3.25 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /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

21
PYTHONPATH=@abs_top_builddir@/src/lib/python/isc/log_messages:@abs_top_srcdir@/src/lib/python:@abs_top_builddir@/src/lib/python
22
23
export PYTHONPATH

24
25
26
27
LOADZONE_PATH=@abs_top_builddir@/src/bin/loadzone
TEST_FILE_PATH=@abs_top_srcdir@/src/bin/loadzone/tests/correct
TEST_OUTPUT_PATH=@abs_top_builddir@/src/bin/loadzone//tests/correct

28
29
status=0
echo "Loadzone include. from include.db file"
30
31
cd ${TEST_FILE_PATH}
${LOADZONE_PATH}/b10-loadzone -d ${TEST_OUTPUT_PATH}/zone.sqlite3 include.db >> /dev/null
32
33

echo "loadzone  ttl1. from ttl1.db file"
34
${LOADZONE_PATH}/b10-loadzone -d ${TEST_OUTPUT_PATH}/zone.sqlite3 ttl1.db >> /dev/null
35
36

echo "loadzone ttl2. from ttl2.db file"
37
${LOADZONE_PATH}/b10-loadzone -d ${TEST_OUTPUT_PATH}/zone.sqlite3 ttl2.db >> /dev/null
38
39

echo "loadzone mix1. from mix1.db"
40
${LOADZONE_PATH}/b10-loadzone -d ${TEST_OUTPUT_PATH}/zone.sqlite3 mix1.db >> /dev/null
41
42

echo "loadzone mix2. from mix2.db"
43
${LOADZONE_PATH}/b10-loadzone -d ${TEST_OUTPUT_PATH}/zone.sqlite3 mix2.db >> /dev/null
44
45

echo "loadzone ttlext. from ttlext.db"
46
${LOADZONE_PATH}/b10-loadzone -d ${TEST_OUTPUT_PATH}/zone.sqlite3 ttlext.db >> /dev/null
47
48

echo "loadzone example.com. from example.db"
49
${LOADZONE_PATH}/b10-loadzone -d ${TEST_OUTPUT_PATH}/zone.sqlite3 example.db >> /dev/null
50

51
52
53
echo "loadzone comment.example.com. from comment.db"
${LOADZONE_PATH}/b10-loadzone -d ${TEST_OUTPUT_PATH}/zone.sqlite3 comment.db >> /dev/null

54
55
56
57
58
59
60
echo "I:test master file \$INCLUDE semantics"
echo "I:test master file BIND 8 compatibility TTL and \$TTL semantics"
echo "I:test master file RFC1035 TTL and \$TTL semantics"
echo "I:test master file BIND8 compatibility and mixed \$INCLUDE with \$TTL semantics"
echo "I:test master file RFC1035 TTL and mixed \$INCLUDE with \$TTL semantics"
echo "I:test master file BIND9 extenstion of TTL"
echo "I:test master file RFC1035 missing CLASS, TTL, NAME semantics"
61
echo "I:test master file comments"
62

63
${PYTHON_EXEC} ${TEST_FILE_PATH}/get_zonedatas.py ${TEST_OUTPUT_PATH}/zone.sqlite3 > ${TEST_OUTPUT_PATH}/test.out
64
echo "Compare test results."
65
diff ${TEST_OUTPUT_PATH}/test.out ${TEST_FILE_PATH}/known.test.out || status=1
66
67

echo "Clean tmp files."
68
69
rm -f ${TEST_OUTPUT_PATH}/zone.sqlite3
rm -f ${TEST_OUTPUT_PATH}/test.out
70
71
72
73
74
75
76
77
78
79
echo "I:exit status: $status"
echo "------------------------------------------------------------------------------"
echo "Ran 7 test files"
echo ""
if [ "$status" -eq 1 ] ;then
    echo "ERROR"
else
    echo "OK"
fi
exit $status