Browse Source

[324] re-increased the assumed latest version dbutil (to 2.0).

test cases that rely on the latest version and were temporarily disabled
were now re-enabled.
JINMEI Tatuya 13 years ago
parent
commit
01d11e9fe7
2 changed files with 22 additions and 30 deletions
  1. 1 4
      src/bin/dbutil/dbutil.py.in
  2. 21 26
      src/bin/dbutil/tests/dbutil_test.sh.in

+ 1 - 4
src/bin/dbutil/dbutil.py.in

@@ -378,10 +378,7 @@ def get_latest_version():
 
 
     This is the 'to' version held in the last element of the upgrades list
     This is the 'to' version held in the last element of the upgrades list
     """
     """
-    # Temporarily hardcoded to return 1 as the schema version, until
+    return UPGRADES[-1]['to']
-    # #324 is merged.
-    #return UPGRADES[-1]['to']
-    return (1, 0)
 
 
 
 
 def get_version(db):
 def get_version(db):

+ 21 - 26
src/bin/dbutil/tests/dbutil_test.sh.in

@@ -359,22 +359,19 @@ check_version $testdata/old_v1.sqlite3 "V1.0"
 check_no_backup $tempfile $backupfile
 check_no_backup $tempfile $backupfile
 rm -f $tempfile $backupfile
 rm -f $tempfile $backupfile
 
 
-# Temporarily disabled until #324 is merged
+echo "5.2. Database is an old V1 database - upgrade"
-#echo "5.2. Database is an old V1 database - upgrade"
+upgrade_ok_test $testdata/old_v1.sqlite3 $backupfile
-#upgrade_ok_test $testdata/old_v1.sqlite3 $backupfile
+rm -f $tempfile $backupfile
-#rm -f $tempfile $backupfile
 
 
 
 
-# Temporarily disabled until #324 is merged
+echo "6.1. Database is new V1 database - check"
-#echo "6.1. Database is new V1 database - check"
+check_version $testdata/new_v1.sqlite3 "V1.0"
-#check_version $testdata/new_v1.sqlite3 "V1.0"
+check_no_backup $tempfile $backupfile
-#check_no_backup $tempfile $backupfile
+rm -f $tempfile $backupfile
-#rm -f $tempfile $backupfile
 
 
-# Temporarily disabled until #324 is merged
+echo "6.2. Database is a new V1 database - upgrade"
-#echo "6.2. Database is a new V1 database - upgrade"
+upgrade_ok_test $testdata/new_v1.sqlite3 $backupfile
-#upgrade_ok_test $testdata/new_v1.sqlite3 $backupfile
+rm -f $tempfile $backupfile
-#rm -f $tempfile $backupfile
 
 
 
 
 echo "7.1. Database is V2.0 database - check"
 echo "7.1. Database is V2.0 database - check"
@@ -405,10 +402,9 @@ upgrade_fail_test $testdata/too_many_version.sqlite3 $backupfile
 rm -f $tempfile $backupfile
 rm -f $tempfile $backupfile
 
 
 
 
-# Temporarily disabled until #324 is merged
+echo "10.0. Upgrade corrupt database"
-#echo "10.0. Upgrade corrupt database"
+upgrade_fail_test $testdata/corrupt.sqlite3 $backupfile
-#upgrade_fail_test $testdata/corrupt.sqlite3 $backupfile
+rm -f $tempfile $backupfile
-#rm -f $tempfile $backupfile
 
 
 
 
 echo "11. Record count test"
 echo "11. Record count test"
@@ -447,15 +443,14 @@ copy_file $testdata/old_v1.sqlite3 $tempfile
 passzero $?
 passzero $?
 rm -f $tempfile $backupfile
 rm -f $tempfile $backupfile
 
 
-# Temporarily disabled until #324 is merged
+echo "13.3 Interactive prompt - yes"
-#echo "13.3 Interactive prompt - yes"
+copy_file $testdata/old_v1.sqlite3 $tempfile
-#copy_file $testdata/old_v1.sqlite3 $tempfile
+../run_dbutil.sh --upgrade $tempfile << .
-#../run_dbutil.sh --upgrade $tempfile << .
+Yes
-#Yes
+.
-#.
+passzero $?
-#passzero $?
+check_version $tempfile "V2.0"
-#check_version $tempfile "V2.0"
+rm -f $tempfile $backupfile
-#rm -f $tempfile $backupfile
 
 
 echo "13.4 Interactive prompt - no"
 echo "13.4 Interactive prompt - no"
 copy_file $testdata/old_v1.sqlite3 $tempfile
 copy_file $testdata/old_v1.sqlite3 $tempfile