[tracker/checkpoint: 5/16] functional-tests: When corrupting database file, also corrupt wal file



commit 2e3156ee0c7a41306c43f03d8bc4b63c5e1db9a5
Author: JÃrg Billeter <j bitron ch>
Date:   Fri Jun 24 15:45:21 2011 +0200

    functional-tests: When corrupting database file, also corrupt wal file
    
    In some circumstances, the database file will be silently fixed with the
    wal file. This needs to be prevented in the tests.

 tests/functional-tests/common/utils/system.py |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/tests/functional-tests/common/utils/system.py b/tests/functional-tests/common/utils/system.py
index 0486f86..3bbceed 100644
--- a/tests/functional-tests/common/utils/system.py
+++ b/tests/functional-tests/common/utils/system.py
@@ -388,11 +388,12 @@ class TrackerSystemAbstraction:
         f.close ()
 
     def tracker_store_corrupt_dbs (self):
-        db_path = os.path.join (TEST_ENV_DIRS ['XDG_CACHE_HOME'], "tracker", "meta.db")
-        f = open (db_path, "w")
-        for i in range (0, 100):
-            f.write ("Some stupid content... hohohoho, not a sqlite file anymore!\n")
-        f.close ()
+        for filename in ["meta.db", "meta.db-wal"]:
+            db_path = os.path.join (TEST_ENV_DIRS ['XDG_CACHE_HOME'], "tracker", filename)
+            f = open (db_path, "w")
+            for i in range (0, 100):
+                f.write ("Some stupid content... hohohoho, not a sqlite file anymore!\n")
+            f.close ()
 
     def tracker_store_remove_journal (self):
         db_location = os.path.join (TEST_ENV_DIRS ['XDG_DATA_HOME'], "tracker", "data")



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]