~ubuntu-branches/debian/sid/subversion/sid

« back to all changes in this revision

Viewing changes to win-tests.py

  • Committer: Package Import Robot
  • Author(s): James McCoy, Peter Samuelson, James McCoy
  • Date: 2014-01-12 19:48:33 UTC
  • mfrom: (0.2.10)
  • Revision ID: package-import@ubuntu.com-20140112194833-w3axfwksn296jn5x
Tags: 1.8.5-1
[ Peter Samuelson ]
* New upstream release.  (Closes: #725787) Rediff patches:
  - Remove apr-abi1 (applied upstream), rename apr-abi2 to apr-abi
  - Remove loosen-sqlite-version-check (shouldn't be needed)
  - Remove java-osgi-metadata (applied upstream)
  - svnmucc prompts for a changelog if none is provided. (Closes: #507430)
  - Remove fix-bdb-version-detection, upstream uses "apu-config --dbm-libs"
  - Remove ruby-test-wc (applied upstream)
  - Fix “svn diff -r N file” when file has svn:mime-type set.
    (Closes: #734163)
  - Support specifying an encoding for mod_dav_svn's environment in which
    hooks are run.  (Closes: #601544)
  - Fix ordering of “svnadmin dump” paths with certain APR versions.
    (Closes: #687291)
  - Provide a better error message when authentication fails with an
    svn+ssh:// URL.  (Closes: #273874)
  - Updated Polish translations.  (Closes: #690815)

[ James McCoy ]
* Remove all traces of libneon, replaced by libserf.
* patches/sqlite_3.8.x_workaround: Upstream fix for wc-queries-test test
  failurse.
* Run configure with --with-apache-libexecdir, which allows removing part of
  patches/rpath.
* Re-enable auth-test as upstream has fixed the problem of picking up
  libraries from the environment rather than the build tree.
  (Closes: #654172)
* Point LD_LIBRARY_PATH at the built auth libraries when running the svn
  command during the build.  (Closes: #678224)
* Add a NEWS entry describing how to configure mod_dav_svn to understand
  UTF-8.  (Closes: #566148)
* Remove ancient transitional package, libsvn-ruby.
* Enable compatibility with Sqlite3 versions back to Wheezy.
* Enable hardening flags.  (Closes: #734918)
* patches/build-fixes: Enable verbose build logs.
* Build against the default ruby version.  (Closes: #722393)

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
For a list of options, run this script with the --help option.
25
25
"""
26
26
 
27
 
# $HeadURL: http://svn.apache.org/repos/asf/subversion/branches/1.7.x/win-tests.py $
28
 
# $LastChangedRevision: 1145707 $
 
27
# $HeadURL: http://svn.apache.org/repos/asf/subversion/branches/1.8.x/win-tests.py $
 
28
# $LastChangedRevision: 1492044 $
29
29
 
30
30
import os, sys, subprocess
31
31
import filecmp
65
65
  print("  -t, --test=TEST        : Run the TEST test (all is default); use")
66
66
  print("                           TEST#n to run a particular test number,")
67
67
  print("                           multiples also accepted e.g. '2,4-7'")
 
68
  print("  --log-level=LEVEL      : Set log level to LEVEL (E.g. DEBUG)")
 
69
  print("  --log-to-stdout        : Write log results to stdout")
68
70
 
69
71
  print("  --svnserve-args=list   : comma-separated list of arguments for")
70
72
  print("                           svnserve")
76
78
  print("                           will be used, if not specified")
77
79
  print("  --httpd-daemon         : Run Apache httpd as daemon")
78
80
  print("  --httpd-service        : Run Apache httpd as Windows service (default)")
79
 
  print("  --http-library         : dav library to use, neon (default) or serf")
 
81
  print("  --httpd-no-log         : Disable httpd logging")
80
82
  print("  --http-short-circuit   : Use SVNPathAuthz short_circuit on HTTP server")
81
83
  print("  --disable-http-v2      : Do not advertise support for HTTPv2 on server")
82
84
  print("  --disable-bulk-updates : Disable bulk updates on HTTP server")
 
85
  print("  --ssl-cert             : Path to SSL server certificate to trust.")
83
86
  print("  --javahl               : Run the javahl tests instead of the normal tests")
84
87
  print("  --list                 : print test doc strings only")
85
88
  print("  --milestone-filter=RE  : RE is a regular expression pattern that (when")
93
96
  print("  -p, --parallel         : run multiple tests in parallel")
94
97
  print("  --server-minor-version : the minor version of the server being")
95
98
  print("                           tested")
96
 
  print(" --config-file           : Configuration file for tests")
97
 
  print(" --fsfs-sharding         : Specify shard size (for fsfs)")
98
 
  print(" --fsfs-packing          : Run 'svnadmin pack' automatically")
99
 
  print(" --log-to-stdout         : Write log results to stdout")
 
99
  print("  --config-file          : Configuration file for tests")
 
100
  print("  --fsfs-sharding        : Specify shard size (for fsfs)")
 
101
  print("  --fsfs-packing         : Run 'svnadmin pack' automatically")
100
102
 
101
103
  sys.exit(0)
102
104
 
126
128
                       ['release', 'debug', 'verbose', 'quiet', 'cleanup',
127
129
                        'test=', 'url=', 'svnserve-args=', 'fs-type=', 'asp.net-hack',
128
130
                        'httpd-dir=', 'httpd-port=', 'httpd-daemon',
129
 
                        'httpd-server', 'http-library=', 'http-short-circuit',
 
131
                        'httpd-server', 'http-short-circuit', 'httpd-no-log',
130
132
                        'disable-http-v2', 'disable-bulk-updates', 'help',
131
133
                        'fsfs-packing', 'fsfs-sharding=', 'javahl',
132
134
                        'list', 'enable-sasl', 'bin=', 'parallel',
133
 
                        'config-file=', 'server-minor-version=',
134
 
                        'log-to-stdout', 'mode-filter=', 'milestone-filter='])
 
135
                        'config-file=', 'server-minor-version=', 'log-level=',
 
136
                        'log-to-stdout', 'mode-filter=', 'milestone-filter=',
 
137
                        'ssl-cert='])
135
138
if len(args) > 1:
136
139
  print('Warning: non-option arguments after the first one will be ignored')
137
140
 
146
149
run_httpd = None
147
150
httpd_port = None
148
151
httpd_service = None
149
 
http_library = 'neon'
 
152
httpd_no_log = None
150
153
http_short_circuit = False
151
154
advertise_httpv2 = True
152
155
http_bulk_updates = True
163
166
log_to_stdout = None
164
167
mode_filter=None
165
168
tests_to_run = []
 
169
log_level = None
 
170
ssl_cert = None
166
171
 
167
172
for opt, val in opts:
168
173
  if opt in ('-h', '--help'):
197
202
    httpd_service = 0
198
203
  elif opt == '--httpd-service':
199
204
    httpd_service = 1
200
 
  elif opt == '--http-library':
201
 
    http_library = val
 
205
  elif opt == '--httpd-no-log':
 
206
    httpd_no_log = 1
202
207
  elif opt == '--http-short-circuit':
203
208
    http_short_circuit = True
204
209
  elif opt == '--disable-http-v2':
230
235
    config_file = val
231
236
  elif opt == '--log-to-stdout':
232
237
    log_to_stdout = 1
 
238
  elif opt == '--log-level':
 
239
    log_level = val
 
240
  elif opt == '--ssl-cert':
 
241
    ssl_cert = val
233
242
 
234
243
# Calculate the source and test directory names
235
244
abs_srcdir = os.path.abspath("")
302
311
def copy_execs(baton, dirname, names):
303
312
  copied_execs = baton
304
313
  for name in names:
305
 
    ext = os.path.splitext(name)[1]
306
 
    if ext != ".exe":
 
314
    if not name.endswith('.exe'):
307
315
      continue
308
316
    src = os.path.join(dirname, name)
309
317
    tgt = os.path.join(abs_builddir, dirname, name)
356
364
                                    'mod_dav_svn', 'mod_dav_svn.so')
357
365
    mod_authz_svn_path = os.path.join(abs_objdir, 'subversion',
358
366
                                      'mod_authz_svn', 'mod_authz_svn.so')
 
367
    mod_dontdothat_path = os.path.join(abs_objdir, 'tools', 'server-side',
 
368
                                        'mod_dontdothat', 'mod_dontdothat.so')
 
369
 
359
370
    copy_changed_file(mod_dav_svn_path, abs_objdir)
360
371
    copy_changed_file(mod_authz_svn_path, abs_objdir)
 
372
    copy_changed_file(mod_dontdothat_path, abs_objdir)
361
373
 
362
374
  os.environ['PATH'] = abs_objdir + os.pathsep + os.environ['PATH']
363
375
 
428
440
class Httpd:
429
441
  "Run httpd for DAV tests"
430
442
  def __init__(self, abs_httpd_dir, abs_objdir, abs_builddir, httpd_port,
431
 
               service, httpv2, short_circuit, bulk_updates):
 
443
               service, no_log, httpv2, short_circuit, bulk_updates):
432
444
    self.name = 'apache.exe'
433
445
    self.httpd_port = httpd_port
434
446
    self.httpd_dir = abs_httpd_dir
463
475
    self.authz_file = os.path.join(abs_builddir,
464
476
                                   CMDLINE_TEST_SCRIPT_NATIVE_PATH,
465
477
                                   'svn-test-work', 'authz')
 
478
    self.dontdothat_file = os.path.join(abs_builddir,
 
479
                                         CMDLINE_TEST_SCRIPT_NATIVE_PATH,
 
480
                                         'svn-test-work', 'dontdothat')
466
481
    self.httpd_config = os.path.join(self.root, 'httpd.conf')
467
482
    self.httpd_users = os.path.join(self.root, 'users')
468
483
    self.httpd_mime_types = os.path.join(self.root, 'mime.types')
480
495
 
481
496
    self._create_users_file()
482
497
    self._create_mime_types_file()
 
498
    self._create_dontdothat_file()
483
499
 
484
500
    # Determine version.
485
501
    if os.path.exists(os.path.join(self.httpd_dir,
505
521
    fp.write('ServerName   localhost\n')
506
522
    fp.write('PidFile      pid\n')
507
523
    fp.write('ErrorLog     log\n')
508
 
    fp.write('LogFormat    "%h %l %u %t \\"%r\\" %>s %b" common\n')
509
 
    fp.write('Customlog    log common\n')
510
 
    fp.write('LogLevel     Debug\n')
511
524
    fp.write('Listen       ' + str(self.httpd_port) + '\n')
512
525
 
 
526
    if not no_log:
 
527
      fp.write('LogFormat    "%h %l %u %t \\"%r\\" %>s %b" common\n')
 
528
      fp.write('Customlog    log common\n')
 
529
      fp.write('LogLevel     Debug\n')
 
530
    else:
 
531
      fp.write('LogLevel     Crit\n')
 
532
 
513
533
    # Write LoadModule for minimal system module
514
534
    fp.write(self._sys_module('dav_module', 'mod_dav.so'))
515
535
    if self.httpd_ver >= 2.3:
530
550
    fp.write(self._svn_module('dav_svn_module', 'mod_dav_svn.so'))
531
551
    fp.write(self._svn_module('authz_svn_module', 'mod_authz_svn.so'))
532
552
 
 
553
    # And for mod_dontdothat
 
554
    fp.write(self._svn_module('dontdothat_module', 'mod_dontdothat.so'))
 
555
 
 
556
    # Don't handle .htaccess, symlinks, etc.
 
557
    fp.write('<Directory />\n')
 
558
    fp.write('AllowOverride None\n')
 
559
    fp.write('Options None\n')
 
560
    fp.write('</Directory>\n\n')
 
561
 
533
562
    # Define two locations for repositories
534
563
    fp.write(self._svn_repo('repositories'))
535
564
    fp.write(self._svn_repo('local_tmp'))
558
587
  def _create_users_file(self):
559
588
    "Create users file"
560
589
    htpasswd = os.path.join(self.httpd_dir, 'bin', 'htpasswd.exe')
561
 
    os.spawnv(os.P_WAIT, htpasswd, ['htpasswd.exe', '-mbc', self.httpd_users,
 
590
    # Create the cheapest to compare password form for our testsuite
 
591
    os.spawnv(os.P_WAIT, htpasswd, ['htpasswd.exe', '-bcp', self.httpd_users,
562
592
                                    'jrandom', 'rayjandom'])
563
 
    os.spawnv(os.P_WAIT, htpasswd, ['htpasswd.exe', '-mb',  self.httpd_users,
 
593
    os.spawnv(os.P_WAIT, htpasswd, ['htpasswd.exe', '-bp',  self.httpd_users,
564
594
                                    'jconstant', 'rayjandom'])
565
595
 
566
596
  def _create_mime_types_file(self):
568
598
    fp = open(self.httpd_mime_types, 'w')
569
599
    fp.close()
570
600
 
 
601
  def _create_dontdothat_file(self):
 
602
    "Create empty mime.types file"
 
603
    # If the tests have not previously been run or were cleaned
 
604
    # up, then 'svn-test-work' does not exist yet.
 
605
    parent_dir = os.path.dirname(self.dontdothat_file)
 
606
    if not os.path.exists(parent_dir):
 
607
      os.makedirs(parent_dir)
 
608
 
 
609
    fp = open(self.dontdothat_file, 'w')
 
610
    fp.write('[recursive-actions]\n')
 
611
    fp.write('/ = deny\n')
 
612
    fp.close()
 
613
 
571
614
  def _sys_module(self, name, path):
572
615
    full_path = os.path.join(self.httpd_dir, 'modules', path)
573
616
    return 'LoadModule ' + name + " " + self._quote(full_path) + '\n'
581
624
                        CMDLINE_TEST_SCRIPT_NATIVE_PATH,
582
625
                        'svn-test-work', name)
583
626
    location = '/svn-test-work/' + name
 
627
    ddt_location = '/ddt-test-work/' + name
584
628
    return \
585
629
      '<Location ' + location + '>\n' \
586
630
      '  DAV             svn\n' \
593
637
      '  AuthName        "Subversion Repository"\n' \
594
638
      '  AuthUserFile    ' + self._quote(self.httpd_users) + '\n' \
595
639
      '  Require         valid-user\n' \
 
640
      '</Location>\n' \
 
641
      '<Location ' + ddt_location + '>\n' \
 
642
      '  DAV             svn\n' \
 
643
      '  SVNParentPath   ' + self._quote(path) + '\n' \
 
644
      '  SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
 
645
      '  SVNPathAuthz ' + self.path_authz_option + '\n' \
 
646
      '  SVNAllowBulkUpdates ' + self.bulkupdates_option + '\n' \
 
647
      '  AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
 
648
      '  AuthType        Basic\n' \
 
649
      '  AuthName        "Subversion Repository"\n' \
 
650
      '  AuthUserFile    ' + self._quote(self.httpd_users) + '\n' \
 
651
      '  Require         valid-user\n' \
 
652
      '  DontDoThatConfigFile ' + self._quote(self.dontdothat_file) + '\n' \
596
653
      '</Location>\n'
597
654
 
598
655
  def start(self):
655
712
    os.chdir(abs_objdir)
656
713
    baton = copied_execs
657
714
    for dirpath, dirs, files in os.walk('subversion'):
658
 
      copy_execs(baton, dirpath, dirs + files)
659
 
    for dirpath, dirs, files in os.walk('tools/client-side/svnmucc'):
660
 
      copy_execs(baton, dirpath, dirs + files)
 
715
      copy_execs(baton, dirpath, files)
 
716
    for dirpath, dirs, files in os.walk('tools/server-side'):
 
717
      copy_execs(baton, dirpath, files)
661
718
  except:
662
719
    os.chdir(old_cwd)
663
720
    raise
680
737
 
681
738
  if run_httpd:
682
739
    daemon = Httpd(abs_httpd_dir, abs_objdir, abs_builddir, httpd_port,
683
 
                   httpd_service, advertise_httpv2, http_short_circuit,
 
740
                   httpd_service, httpd_no_log,
 
741
                   advertise_httpv2, http_short_circuit,
684
742
                   http_bulk_updates)
685
743
 
686
744
  # Start service daemon, if any
731
789
  th = run_tests.TestHarness(abs_srcdir, abs_builddir,
732
790
                             log_file,
733
791
                             fail_log_file,
734
 
                             base_url, fs_type, http_library,
 
792
                             base_url, fs_type, 'serf',
735
793
                             server_minor_version, not quiet,
736
794
                             cleanup, enable_sasl, parallel, config_file,
737
795
                             fsfs_sharding, fsfs_packing,
738
796
                             list_tests, svn_bin, mode_filter,
739
 
                             milestone_filter)
 
797
                             milestone_filter,
 
798
                             set_log_level=log_level, ssl_cert=ssl_cert)
740
799
  old_cwd = os.getcwd()
741
800
  try:
742
801
    os.chdir(abs_builddir)