You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2015/03/05 23:21:45 UTC
svn commit: r1664507 -
/subversion/trunk/subversion/tests/cmdline/upgrade_tests.py
Author: philip
Date: Thu Mar 5 22:21:45 2015
New Revision: 1664507
URL: http://svn.apache.org/r1664507
Log:
* subversion/tests/cmdline/upgrade_tests.py
(auto_analyze): New test for automatically adding stats table.
(test_list): Add new test.
Modified:
subversion/trunk/subversion/tests/cmdline/upgrade_tests.py
Modified: subversion/trunk/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/upgrade_tests.py?rev=1664507&r1=1664506&r2=1664507&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/upgrade_tests.py Thu Mar 5 22:21:45 2015
@@ -1438,6 +1438,37 @@ def upgrade_1_7_dir_external(sbox):
# svn: warning: W200033: sqlite[S5]: database is locked
svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
+def auto_analyze(sbox):
+ """automatic SQLite ANALYZE"""
+
+ sbox.build(read_only = True)
+
+ val = svntest.wc.sqlite_stmt(sbox.wc_dir, "drop table sqlite_stat1")
+ if val != []:
+ raise svntest.Failure("drop failed")
+
+ # Make working copy read-only (but not wc_dir itself as
+ # svntest.main.chmod_tree will not reset it.)
+ for path, subdirs, files in os.walk(sbox.wc_dir):
+ for d in subdirs:
+ os.chmod(os.path.join(path, d), 0555)
+ for f in files:
+ os.chmod(os.path.join(path, f), 0444)
+
+ state = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
+ svntest.actions.run_and_verify_status(sbox.wc_dir, state)
+
+ svntest.main.chmod_tree(sbox.wc_dir, 0666, 0022)
+
+ state = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
+ svntest.actions.run_and_verify_status(sbox.wc_dir, state)
+
+ val = svntest.wc.sqlite_stmt(sbox.wc_dir,
+ "select 1 from sqlite_master "
+ "where name = 'sqlite_stat1'")
+ if val != [(1,)]:
+ raise svntest.Failure("analyze failed")
+
########################################################################
# Run the tests
@@ -1494,6 +1525,7 @@ test_list = [ None,
iprops_upgrade1_6,
changelist_upgrade_1_6,
upgrade_1_7_dir_external,
+ auto_analyze,
]