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

« back to all changes in this revision

Viewing changes to subversion/tests/cmdline/redirect_tests.py

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2015-08-07 21:32:47 UTC
  • mfrom: (0.2.15) (4.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20150807213247-ozyewtmgsr6tkewl
Tags: 1.9.0-1
* Upload to unstable
* New upstream release.
  + Security fixes
    - CVE-2015-3184: Mixed anonymous/authenticated path-based authz with
      httpd 2.4
    - CVE-2015-3187: svn_repos_trace_node_locations() reveals paths hidden
      by authz
* Add >= 2.7 requirement for python-all-dev Build-Depends, needed to run
  tests.
* Remove Build-Conflicts against ruby-test-unit.  (Closes: #791844)
* Remove patches/apache_module_dependency in favor of expressing the
  dependencies in authz_svn.load/dav_svn.load.
* Build-Depend on apache2-dev (>= 2.4.16) to ensure ap_some_authn_required()
  is available when building mod_authz_svn and Depend on apache2-bin (>=
  2.4.16) for runtime support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
154
154
                                             checkout_url, wc_dir)
155
155
  if err:
156
156
    raise svntest.Failure
157
 
  
 
157
 
158
158
  # Relocate (by cheating) the working copy to the redirect URL.  When
159
159
  # we then update, we'll expect to find ourselves automagically back
160
160
  # to the original URL.  (This is because we can't easily introduce a
178
178
  verify_url(wc_dir, checkout_url)
179
179
 
180
180
#----------------------------------------------------------------------
 
181
@SkipUnless(svntest.main.is_ra_type_dav)
 
182
def redirected_externals(sbox):
 
183
  "redirected externals"
 
184
 
 
185
  sbox.build()
 
186
 
 
187
  sbox.simple_propset('svn:externals',
 
188
                      '^/A/B/E/alpha fileX\n'
 
189
                      '^/A/B/F dirX',
 
190
                      'A/C')
 
191
  sbox.simple_commit()
 
192
  sbox.simple_update()
 
193
 
 
194
  wc_dir = sbox.add_wc_path("my")
 
195
  co_url = sbox.redirected_root_url()
 
196
  exit_code, out, err = svntest.main.run_svn(None, 'co', co_url, wc_dir)
 
197
  if err:
 
198
    raise svntest.Failure
 
199
  if not redirect_regex.match(out[0]):
 
200
    raise svntest.Failure
 
201
 
 
202
  verify_url(wc_dir, sbox.repo_url)
 
203
  verify_url(sbox.ospath('A/C/fileX'), sbox.repo_url + '/A/B/E/alpha',
 
204
             wc_path_is_file=True)
 
205
  verify_url(sbox.ospath('A/C/dirX'), sbox.repo_url + '/A/B/F')
 
206
 
 
207
#----------------------------------------------------------------------
 
208
@SkipUnless(svntest.main.is_ra_type_dav)
 
209
def redirected_copy(sbox):
 
210
  "redirected copy"
 
211
 
 
212
  sbox.build(create_wc=False)
 
213
 
 
214
  # E170011 = SVN_ERR_RA_SESSION_URL_MISMATCH
 
215
  expected_error = "svn: E170011: Repository moved permanently"
 
216
 
 
217
  # This tests the actual copy handling
 
218
  svntest.actions.run_and_verify_svn(None, expected_error,
 
219
                                     'cp', '-m', 'failed copy',
 
220
                                     sbox.redirected_root_url() + '/A',
 
221
                                     sbox.redirected_root_url() + '/A_copied')
 
222
 
 
223
  # This tests the cmdline handling of '^/copy-of-A'
 
224
  svntest.actions.run_and_verify_svn(None, expected_error,
 
225
                                     'cp', '-m', 'failed copy',
 
226
                                     sbox.redirected_root_url() + '/A',
 
227
                                     '^/copy-of-A')
 
228
 
 
229
  # E170011 = SVN_ERR_RA_SESSION_URL_MISMATCH
 
230
  expected_error = "svn: E170011: Repository moved temporarily"
 
231
 
 
232
  # This tests the actual copy handling
 
233
  svntest.actions.run_and_verify_svn(None, expected_error,
 
234
                                     'cp', '-m', 'failed copy',
 
235
                                     sbox.redirected_root_url(temporary=True) + '/A',
 
236
                                     sbox.redirected_root_url(temporary=True) + '/A_copied')
 
237
 
 
238
  # This tests the cmdline handling of '^/copy-of-A'
 
239
  svntest.actions.run_and_verify_svn(None, expected_error,
 
240
                                     'cp', '-m', 'failed copy',
 
241
                                     sbox.redirected_root_url(temporary=True) + '/A',
 
242
                                     '^/copy-of-A')
 
243
#----------------------------------------------------------------------
 
244
@SkipUnless(svntest.main.is_ra_type_dav)
 
245
def redirected_commands(sbox):
 
246
  "redirected commands"
 
247
 
 
248
  sbox.build(create_wc=False)
 
249
 
 
250
  svntest.actions.run_and_verify_svn(None, [],
 
251
                                     'log',
 
252
                                     sbox.redirected_root_url() + '/A')
 
253
 
 
254
  svntest.actions.run_and_verify_svn(None, [],
 
255
                                     'ls',
 
256
                                     sbox.redirected_root_url() + '/A')
 
257
 
 
258
  svntest.actions.run_and_verify_svn(None, [],
 
259
                                     'info',
 
260
                                     sbox.redirected_root_url() + '/A')
 
261
 
 
262
#----------------------------------------------------------------------
181
263
 
182
264
########################################################################
183
265
# Run the tests
188
270
              redirected_checkout,
189
271
              redirected_update,
190
272
              redirected_nonroot_update,
 
273
              redirected_externals,
 
274
              redirected_copy,
 
275
              redirected_commands,
191
276
             ]
192
277
 
193
278
if __name__ == '__main__':