Author: brane
Date: Tue Jan 27 12:25:27 2015
New Revision: 1655020
URL: http://svn.apache.org/r1655020
Log:
On the dump-load-cross-check branch: Make dump/load cross-checking optional
and turned off by default.
* Makefile.in (check): Add a new DUMP_LOAD_CROSS_CHECK flag.
* build/run_tests.py
(main): Handle new option --dump-load-cross-check.
(TestHarness.__init__): New optional argument dump_load_cross_check.
Store its boolified value in the TestHarness instance.
(TestHarness._run_py_test): Propagate the dump_load_cross_check
to svntest.main.options.
* subversion/tests/cmdline/svntest/main.py
(tests_verify_dump_load_cross_check): New predicate.
(_create_parser): Handle new option --dump-load-cross-check.
(TestSpawningThread.run_one): Propagate the dump_load_cross_check
option to the test case driver.
* subversion/tests/cmdline/svntest/sandbox.py
(Sandbox.verify): Run a dump/load cross-check only when it's
enabled in the test options. Report progress through
the logger instead of printing to stdout.
Modified:
subversion/branches/dump-load-cross-check/Makefile.in
subversion/branches/dump-load-cross-check/build/run_tests.py
subversion/branches/dump-load-cross-check/subversion/tests/cmdline/svntest/main.py
subversion/branches/dump-load-cross-check/subversion/tests/cmdline/svntest/sandbox.py
Modified: subversion/branches/dump-load-cross-check/Makefile.in
URL:
http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/Makefile.in?rev=1655020&r1=1655019&r2=1655020&view=diff
==============================================================================
--- subversion/branches/dump-load-cross-check/Makefile.in (original)
+++ subversion/branches/dump-load-cross-check/Makefile.in Tue Jan 27 12:25:27
2015
@@ -529,6 +529,9 @@ check: bin @TRANSFORM_LIBTOOL_SCRIPTS@ $
if test "$(SKIP_C_TESTS)" != ""; then \
flags="--skip-c-tests $$flags"; \
fi; \
+ if test "$(DUMP_LOAD_CROSS_CHECK)" != ""; then \
+ flags="--dump-load-cross-check $$flags"; \
+ fi; \
if test "$(FS_TYPE)" != ""; then \
flags="--fs-type $(FS_TYPE) $$flags"; \
fi; \
Modified: subversion/branches/dump-load-cross-check/build/run_tests.py
URL:
http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/build/run_tests.py?rev=1655020&r1=1655019&r2=1655020&view=diff
==============================================================================
--- subversion/branches/dump-load-cross-check/build/run_tests.py (original)
+++ subversion/branches/dump-load-cross-check/build/run_tests.py Tue Jan 27
12:25:27 2015
@@ -130,7 +130,8 @@ class TestHarness:
http_proxy=None, http_proxy_username=None,
http_proxy_password=None, httpd_version=None,
exclusive_wc_locks=None,
- memcached_server=None, skip_c_tests=None):
+ memcached_server=None, skip_c_tests=None,
+ dump_load_cross_check=None):
'''Construct a TestHarness instance.
ABS_SRCDIR and ABS_BUILDDIR are the source and build directories.
@@ -193,6 +194,7 @@ class TestHarness:
if not sys.stdout.isatty() or sys.platform == 'win32':
TextColors.disable()
self.skip_c_tests = (not not skip_c_tests)
+ self.dump_load_cross_check = (not not dump_load_cross_check)
# Parse out the FSFS version number
if self.fs_type is not None and self.fs_type.startswith('fsfs-v'):
@@ -536,6 +538,8 @@ class TestHarness:
svntest.main.options.exclusive_wc_locks = self.exclusive_wc_locks
if self.memcached_server is not None:
svntest.main.options.memcached_server = self.memcached_server
+ if self.dump_load_cross_check is not None:
+ svntest.main.options.dump_load_cross_check = self.dump_load_cross_check
svntest.main.options.srcdir = self.srcdir
@@ -699,6 +703,7 @@ def main():
opts, args = my_getopt(sys.argv[1:], 'u:f:vc',
['url=', 'fs-type=', 'verbose', 'cleanup',
'skip-c-tests', 'skip-C-tests',
+ 'dump-load-cross-check',
'http-library=', 'server-minor-version=',
'fsfs-packing', 'fsfs-sharding=',
'enable-sasl', 'parallel=', 'config-file=',
@@ -720,10 +725,10 @@ def main():
parallel, config_file, log_to_stdout, list_tests, mode_filter, \
milestone_filter, set_log_level, ssl_cert, http_proxy, \
http_proxy_username, http_proxy_password, httpd_version, \
- exclusive_wc_locks, memcached_server = \
+ exclusive_wc_locks, memcached_server, dump_load_cross_check = \
None, None, None, None, None, None, None, None, None, None, \
None, None, None, None, None, None, None, None, None, None, \
- None, None, None, None,
+ None, None, None, None, None
for opt, val in opts:
if opt in ['-u', '--url']:
base_url = val
@@ -743,6 +748,8 @@ def main():
cleanup = 1
elif opt in ['--skip-c-tests', '--skip-C-tests']:
skip_c_tests = 1
+ elif opt in ['--dump-load-cross-check']:
+ dump_load_cross_check = 1
elif opt in ['--enable-sasl']:
enable_sasl = 1
elif opt in ['--parallel']:
@@ -795,7 +802,8 @@ def main():
httpd_version=httpd_version,
exclusive_wc_locks=exclusive_wc_locks,
memcached_server=memcached_server,
- skip_c_tests=skip_c_tests)
+ skip_c_tests=skip_c_tests,
+ dump_load_cross_check=dump_load_cross_check)
failed = th.run(args[2:])
if failed:
Modified:
subversion/branches/dump-load-cross-check/subversion/tests/cmdline/svntest/main.py
URL:
http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/tests/cmdline/svntest/main.py?rev=1655020&r1=1655019&r2=1655020&view=diff
==============================================================================
---
subversion/branches/dump-load-cross-check/subversion/tests/cmdline/svntest/main.py
(original)
+++
subversion/branches/dump-load-cross-check/subversion/tests/cmdline/svntest/main.py
Tue Jan 27 12:25:27 2015
@@ -1379,6 +1379,9 @@ def make_log_msg():
def tests_use_prepacakaged_repository():
return options.fsfs_version is not None
+def tests_verify_dump_load_cross_check():
+ return options.dump_load_cross_check
+
def is_ra_type_dav():
return options.test_area_url.startswith('http')
@@ -1568,6 +1571,8 @@ class TestSpawningThread(threading.Threa
args.append('--fsfs-packing')
if options.fsfs_version:
args.append('--fsfs-version=' + str(options.fsfs_version))
+ if options.dump_load_cross_check:
+ args.append('--dump-load-cross-check')
result, stdout_lines, stderr_lines = spawn_process(command, 0, False, None,
*args)
@@ -1892,6 +1897,11 @@ def _create_parser():
help='Default shard size (for fsfs)')
parser.add_option('--fsfs-version', type='int', action='store',
help='FSFS version (fsfs)')
+ parser.add_option('--dump-load-cross-check', action='store_true',
+ help="After every test, run a series of dump and load " +
+ "tests with svnadmin, svnrdump and svndumpfilter " +
+ " on the testcase repositories to cross-check " +
+ " dump file compatibility.")
parser.add_option('--config-file', action='store',
help="Configuration file for tests.")
parser.add_option('--set-log-level', action='callback', type='str',
Modified:
subversion/branches/dump-load-cross-check/subversion/tests/cmdline/svntest/sandbox.py
URL:
http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/tests/cmdline/svntest/sandbox.py?rev=1655020&r1=1655019&r2=1655020&view=diff
==============================================================================
---
subversion/branches/dump-load-cross-check/subversion/tests/cmdline/svntest/sandbox.py
(original)
+++
subversion/branches/dump-load-cross-check/subversion/tests/cmdline/svntest/sandbox.py
Tue Jan 27 12:25:27 2015
@@ -472,16 +472,20 @@ class Sandbox:
"""Do additional testing that should hold for any sandbox, such as
verifying that the repository can be dumped.
"""
- if self.is_built() and not self.read_only:
- # verify that we can in fact dump the repo
- # (except for the few tests that deliberately corrupt the repo)
- os.chdir(self.was_cwd)
- if os.path.exists(self.repo_dir):
- print("Cross-checking dump/load...")
- self.verify_repo()
- else:
- print("NOT testing dump: is_built=%d, read_only=%d"
- % (self.is_built(), self.read_only))
+ if svntest.main.tests_verify_dump_load_cross_check():
+ if self.is_built() and not self.read_only:
+ # verify that we can in fact dump the repo
+ # (except for the few tests that deliberately corrupt the repo)
+ os.chdir(self.was_cwd)
+ if os.path.exists(self.repo_dir):
+ logger.info("VERIFY: running dump/load cross-check")
+ self.verify_repo()
+ else:
+ logger.info("VERIFY: WARNING: skipping dump/load cross-check:"
+ " is-built=%s, read-only=%s"
+ % (self.is_built() and "true" or "false",
+ self.read_only and "true" or "false"))
+ pass
def is_url(target):
return (target.startswith('^/')