[bind10-dev] src/bin/dbutil/tests fails if SHELL=/bin/csh
fujiwara at jprs.co.jp
fujiwara at jprs.co.jp
Thu Feb 7 05:21:51 UTC 2013
src/bin/dbutil/tests/dbutil_test.sh.in calls ../run_dbutil.sh using ${SHELL}.
${SHELL} ../run_dbutil.sh --upgrade --noconfirm $tempfile
${SHELL} is not controlled by BIND 10.
These '${SHELL}' should be removed or replaced by @@SHELL@@.
I prefer removing '${SHELL}' because configure sets execution bit of
src/bin/dbutil/run_dbutil.sh and the first line of it is "#!/bin/sh".
Most part of BIND 10 code assumes existence of /bin/sh. (and it is BSH.)
diffs are below:
diff --git a/src/bin/dbutil/tests/dbutil_test.sh.in b/src/bin/dbutil/tests/dbutil_test.sh.in
index 4bc9f85..241463a 100755
--- a/src/bin/dbutil/tests/dbutil_test.sh.in
+++ b/src/bin/dbutil/tests/dbutil_test.sh.in
@@ -161,7 +161,7 @@ get_schema() {
# @param $2 Expected backup file
upgrade_ok_test() {
copy_file $1 $tempfile
- ${SHELL} ../run_dbutil.sh --upgrade --noconfirm $tempfile
+ ../run_dbutil.sh --upgrade --noconfirm $tempfile
if [ $? -eq 0 ]
then
# Compare schema with the reference
@@ -199,7 +199,7 @@ upgrade_ok_test() {
# @param $2 Expected backup file
upgrade_fail_test() {
copy_file $1 $tempfile
- ${SHELL} ../run_dbutil.sh --upgrade --noconfirm $tempfile
+ ../run_dbutil.sh --upgrade --noconfirm $tempfile
failzero $?
check_backup $1 $backupfile
}
@@ -222,7 +222,7 @@ record_count_test() {
records_count=`sqlite3 $tempfile 'select count(*) from records'`
zones_count=`sqlite3 $tempfile 'select count(*) from zones'`
- ${SHELL} ../run_dbutil.sh --upgrade --noconfirm $tempfile
+ ../run_dbutil.sh --upgrade --noconfirm $tempfile
if [ $? -ne 0 ]
then
# Reason for failure should already have been output
@@ -268,12 +268,12 @@ record_count_test() {
# @param $2 Expected version string
check_version() {
copy_file $1 $verfile
- ${SHELL} ../run_dbutil.sh --check $verfile
+ ../run_dbutil.sh --check $verfile
if [ $? -gt 2 ]
then
fail "version check failed on database $1; return code $?"
else
- ${SHELL} ../run_dbutil.sh --check $verfile 2>&1 | grep "$2" > /dev/null
+ ../run_dbutil.sh --check $verfile 2>&1 | grep "$2" > /dev/null
if [ $? -ne 0 ]
then
fail "database $1 not at expected version $2 (output: $?)"
@@ -293,7 +293,7 @@ check_version() {
# @param $2 Backup file
check_version_fail() {
copy_file $1 $verfile
- ${SHELL} ../run_dbutil.sh --check $verfile
+ ../run_dbutil.sh --check $verfile
failzero $?
check_no_backup $tempfile $backupfile
}
@@ -310,12 +310,12 @@ sec=0
# Test: check that the utility fails if the database does not exist
sec=`expr $sec + 1`
echo $sec".1. Non-existent database - check"
-${SHELL} ../run_dbutil.sh --check $tempfile
+../run_dbutil.sh --check $tempfile
failzero $?
check_no_backup $tempfile $backupfile
echo $sec".2. Non-existent database - upgrade"
-${SHELL} ../run_dbutil.sh --upgrade --noconfirm $tempfile
+../run_dbutil.sh --upgrade --noconfirm $tempfile
failzero $?
check_no_backup $tempfile $backupfile
rm -f $tempfile $backupfile
@@ -330,7 +330,7 @@ rm -f $tempfile $backupfile
echo $sec".2. Database is an empty file - upgrade"
touch $tempfile
-${SHELL} ../run_dbutil.sh --upgrade --noconfirm $tempfile
+../run_dbutil.sh --upgrade --noconfirm $tempfile
failzero $?
# A backup is performed before anything else, so the backup should exist.
check_backup $tempfile $backupfile
@@ -344,7 +344,7 @@ rm -f $tempfile $backupfile
echo $sec".2. Database is not an SQLite file - upgrade"
echo "This is not an sqlite3 database" > $tempfile
-${SHELL} ../run_dbutil.sh --upgrade --noconfirm $tempfile
+../run_dbutil.sh --upgrade --noconfirm $tempfile
failzero $?
# ...and as before, a backup should have been created
check_backup $tempfile $backupfile
@@ -459,31 +459,31 @@ rm -f $tempfile $backupfile ${backupfile}-1 ${backupfile}-2
sec=`expr $sec + 1`
echo $sec".1 Command-line errors"
copy_file $testdata/old_v1.sqlite3 $tempfile
-${SHELL} ../run_dbutil.sh $tempfile
+../run_dbutil.sh $tempfile
failzero $?
-${SHELL} ../run_dbutil.sh --upgrade --check $tempfile
+../run_dbutil.sh --upgrade --check $tempfile
failzero $?
-${SHELL} ../run_dbutil.sh --noconfirm --check $tempfile
+../run_dbutil.sh --noconfirm --check $tempfile
failzero $?
-${SHELL} ../run_dbutil.sh --check
+../run_dbutil.sh --check
failzero $?
-${SHELL} ../run_dbutil.sh --upgrade --noconfirm
+../run_dbutil.sh --upgrade --noconfirm
failzero $?
-${SHELL} ../run_dbutil.sh --check $tempfile $backupfile
+../run_dbutil.sh --check $tempfile $backupfile
failzero $?
-${SHELL} ../run_dbutil.sh --upgrade --noconfirm $tempfile $backupfile
+../run_dbutil.sh --upgrade --noconfirm $tempfile $backupfile
failzero $?
rm -f $tempfile $backupfile
echo $sec".2 verbose flag"
copy_file $testdata/old_v1.sqlite3 $tempfile
-${SHELL} ../run_dbutil.sh --upgrade --noconfirm --verbose $tempfile
+../run_dbutil.sh --upgrade --noconfirm --verbose $tempfile
passzero $?
rm -f $tempfile $backupfile
echo $sec".3 Interactive prompt - yes"
copy_file $testdata/old_v1.sqlite3 $tempfile
-${SHELL} ../run_dbutil.sh --upgrade $tempfile << .
+../run_dbutil.sh --upgrade $tempfile << .
Yes
.
passzero $?
@@ -492,7 +492,7 @@ rm -f $tempfile $backupfile
echo $sec".4 Interactive prompt - no"
copy_file $testdata/old_v1.sqlite3 $tempfile
-${SHELL} ../run_dbutil.sh --upgrade $tempfile << .
+../run_dbutil.sh --upgrade $tempfile << .
no
.
passzero $?
@@ -502,7 +502,7 @@ rm -f $tempfile $backupfile
echo $sec".5 quiet flag"
copy_file $testdata/old_v1.sqlite3 $tempfile
-${SHELL} ../run_dbutil.sh --check --quiet $tempfile 2>&1 | grep .
+../run_dbutil.sh --check --quiet $tempfile 2>&1 | grep .
failzero $?
rm -f $tempfile $backupfile
# Current master (530f569e47b0) fails in src/lib/dns/tests before dbutil.
# terminate called after throwing an instance of 'isc::dns::InvalidRRType'
# what(): Unrecognized RR type string: MD
--
Kazunori Fujiwara, JPRS <fujiwara at jprs.co.jp>
More information about the bind10-dev
mailing list