You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2015/08/06 16:01:40 UTC
svn commit: r1694500 [7/7] - in /subversion/branches/fsx-1.10: ./ build/
build/ac-macros/ build/generator/ build/generator/templates/
subversion/bindings/ctypes-python/csvn/ext/
subversion/bindings/javahl/native/ subversion/bindings/javahl/src/org/apac...
Modified: subversion/branches/fsx-1.10/subversion/tests/libsvn_repos/repos-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/tests/libsvn_repos/repos-test.c?rev=1694500&r1=1694499&r2=1694500&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/tests/libsvn_repos/repos-test.c (original)
+++ subversion/branches/fsx-1.10/subversion/tests/libsvn_repos/repos-test.c Thu Aug 6 14:01:38 2015
@@ -3612,6 +3612,241 @@ deprecated_access_context_api(const svn_
return SVN_NO_ERROR;
}
+static svn_error_t *
+mkdir_delete_copy(svn_repos_t *repos,
+ const char *src,
+ const char *dst,
+ apr_pool_t *pool)
+{
+ svn_fs_t *fs = svn_repos_fs(repos);
+ svn_revnum_t youngest_rev;
+ svn_fs_txn_t *txn;
+ svn_fs_root_t *txn_root, *rev_root;
+
+ SVN_ERR(svn_fs_youngest_rev(&youngest_rev, fs, pool));
+
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, youngest_rev, pool));
+ SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
+ SVN_ERR(svn_fs_make_dir(txn_root, "A/T", pool));
+ SVN_ERR(svn_repos_fs_commit_txn(NULL, repos, &youngest_rev, txn, pool));
+
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, youngest_rev, pool));
+ SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
+ SVN_ERR(svn_fs_delete(txn_root, "A/T", pool));
+ SVN_ERR(svn_repos_fs_commit_txn(NULL, repos, &youngest_rev, txn, pool));
+
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, youngest_rev, pool));
+ SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
+ SVN_ERR(svn_fs_revision_root(&rev_root, fs, youngest_rev - 1, pool));
+ SVN_ERR(svn_fs_copy(rev_root, src, txn_root, dst, pool));
+ SVN_ERR(svn_repos_fs_commit_txn(NULL, repos, &youngest_rev, txn, pool));
+
+ return SVN_NO_ERROR;
+}
+
+struct authz_read_baton_t {
+ apr_hash_t *paths;
+ apr_pool_t *pool;
+ const char *deny;
+};
+
+static svn_error_t *
+authz_read_func(svn_boolean_t *allowed,
+ svn_fs_root_t *root,
+ const char *path,
+ void *baton,
+ apr_pool_t *pool)
+{
+ struct authz_read_baton_t *b = baton;
+
+ if (b->deny && !strcmp(b->deny, path))
+ *allowed = FALSE;
+ else
+ *allowed = TRUE;
+
+ svn_hash_sets(b->paths, apr_pstrdup(b->pool, path), (void*)1);
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+verify_locations(apr_hash_t *actual,
+ apr_hash_t *expected,
+ apr_hash_t *checked,
+ apr_pool_t *pool)
+{
+ apr_hash_index_t *hi;
+
+ for (hi = apr_hash_first(pool, expected); hi; hi = apr_hash_next(hi))
+ {
+ const svn_revnum_t *rev = apr_hash_this_key(hi);
+ const char *path = apr_hash_get(actual, rev, sizeof(svn_revnum_t));
+
+ if (!path)
+ return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
+ "expected %s for %d found (null)",
+ (char*)apr_hash_this_val(hi), (int)*rev);
+ else if (strcmp(path, apr_hash_this_val(hi)))
+ return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
+ "expected %s for %d found %s",
+ (char*)apr_hash_this_val(hi), (int)*rev, path);
+
+ }
+
+ for (hi = apr_hash_first(pool, actual); hi; hi = apr_hash_next(hi))
+ {
+ const svn_revnum_t *rev = apr_hash_this_key(hi);
+ const char *path = apr_hash_get(expected, rev, sizeof(svn_revnum_t));
+
+ if (!path)
+ return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
+ "found %s for %d expected (null)",
+ (char*)apr_hash_this_val(hi), (int)*rev);
+ else if (strcmp(path, apr_hash_this_val(hi)))
+ return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
+ "found %s for %d expected %s",
+ (char*)apr_hash_this_val(hi), (int)*rev, path);
+
+ if (!svn_hash_gets(checked, path))
+ return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
+ "did not check %s", path);
+ }
+
+ return SVN_NO_ERROR;
+}
+
+static void
+set_expected(apr_hash_t *expected,
+ svn_revnum_t rev,
+ const char *path,
+ apr_pool_t *pool)
+{
+ svn_revnum_t *rp = apr_palloc(pool, sizeof(svn_revnum_t));
+ *rp = rev;
+ apr_hash_set(expected, rp, sizeof(svn_revnum_t), path);
+}
+
+static svn_error_t *
+trace_node_locations_authz(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ svn_repos_t *repos;
+ svn_fs_t *fs;
+ svn_revnum_t youngest_rev = 0;
+ svn_fs_txn_t *txn;
+ svn_fs_root_t *txn_root;
+ struct authz_read_baton_t arb;
+ apr_array_header_t *revs = apr_array_make(pool, 10, sizeof(svn_revnum_t));
+ apr_hash_t *locations;
+ apr_hash_t *expected = apr_hash_make(pool);
+ int i;
+
+ /* Create test repository. */
+ SVN_ERR(svn_test__create_repos(&repos, "test-repo-trace-node-locations-authz",
+ opts, pool));
+ fs = svn_repos_fs(repos);
+
+ /* r1 create A */
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, youngest_rev, pool));
+ SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
+ SVN_ERR(svn_fs_make_dir(txn_root, "A", pool));
+ SVN_ERR(svn_fs_make_file(txn_root, "A/f", pool));
+ SVN_ERR(svn_test__set_file_contents(txn_root, "A/f", "foobar", pool));
+ SVN_ERR(svn_repos_fs_commit_txn(NULL, repos, &youngest_rev, txn, pool));
+
+ /* r4 copy A to B */
+ SVN_ERR(mkdir_delete_copy(repos, "A", "B", pool));
+
+ /* r7 copy B to C */
+ SVN_ERR(mkdir_delete_copy(repos, "B", "C", pool));
+
+ /* r10 copy C to D */
+ SVN_ERR(mkdir_delete_copy(repos, "C", "D", pool));
+
+ SVN_ERR(svn_fs_youngest_rev(&youngest_rev, fs, pool));
+ SVN_ERR_ASSERT(youngest_rev == 10);
+
+ arb.paths = apr_hash_make(pool);
+ arb.pool = pool;
+ arb.deny = NULL;
+
+ apr_array_clear(revs);
+ for (i = 0; i <= youngest_rev; ++i)
+ APR_ARRAY_PUSH(revs, svn_revnum_t) = i;
+ set_expected(expected, 10, "/D/f", pool);
+ set_expected(expected, 8, "/C/f", pool);
+ set_expected(expected, 7, "/C/f", pool);
+ set_expected(expected, 5, "/B/f", pool);
+ set_expected(expected, 4, "/B/f", pool);
+ set_expected(expected, 2, "/A/f", pool);
+ set_expected(expected, 1, "/A/f", pool);
+ apr_hash_clear(arb.paths);
+ SVN_ERR(svn_repos_trace_node_locations(fs, &locations, "D/f", 10, revs,
+ authz_read_func, &arb, pool));
+ SVN_ERR(verify_locations(locations, expected, arb.paths, pool));
+
+ apr_array_clear(revs);
+ for (i = 1; i <= youngest_rev; ++i)
+ APR_ARRAY_PUSH(revs, svn_revnum_t) = i;
+ apr_hash_clear(arb.paths);
+ SVN_ERR(svn_repos_trace_node_locations(fs, &locations, "D/f", 10, revs,
+ authz_read_func, &arb, pool));
+ SVN_ERR(verify_locations(locations, expected, arb.paths, pool));
+
+ apr_array_clear(revs);
+ for (i = 2; i <= youngest_rev; ++i)
+ APR_ARRAY_PUSH(revs, svn_revnum_t) = i;
+ set_expected(expected, 1, NULL, pool);
+ apr_hash_clear(arb.paths);
+ SVN_ERR(svn_repos_trace_node_locations(fs, &locations, "D/f", 10, revs,
+ authz_read_func, &arb, pool));
+ SVN_ERR(verify_locations(locations, expected, arb.paths, pool));
+
+ apr_array_clear(revs);
+ for (i = 3; i <= youngest_rev; ++i)
+ APR_ARRAY_PUSH(revs, svn_revnum_t) = i;
+ set_expected(expected, 2, NULL, pool);
+ apr_hash_clear(arb.paths);
+ SVN_ERR(svn_repos_trace_node_locations(fs, &locations, "D/f", 10, revs,
+ authz_read_func, &arb, pool));
+ SVN_ERR(verify_locations(locations, expected, arb.paths, pool));
+
+ apr_array_clear(revs);
+ for (i = 6; i <= youngest_rev; ++i)
+ APR_ARRAY_PUSH(revs, svn_revnum_t) = i;
+ set_expected(expected, 5, NULL, pool);
+ set_expected(expected, 4, NULL, pool);
+ apr_hash_clear(arb.paths);
+ SVN_ERR(svn_repos_trace_node_locations(fs, &locations, "D/f", 10, revs,
+ authz_read_func, &arb, pool));
+ SVN_ERR(verify_locations(locations, expected, arb.paths, pool));
+
+ arb.deny = "/B/f";
+ apr_array_clear(revs);
+ for (i = 0; i <= youngest_rev; ++i)
+ APR_ARRAY_PUSH(revs, svn_revnum_t) = i;
+ apr_hash_clear(arb.paths);
+ SVN_ERR(svn_repos_trace_node_locations(fs, &locations, "D/f", 10, revs,
+ authz_read_func, &arb, pool));
+ SVN_ERR(verify_locations(locations, expected, arb.paths, pool));
+
+ apr_array_clear(revs);
+ for (i = 6; i <= youngest_rev; ++i)
+ APR_ARRAY_PUSH(revs, svn_revnum_t) = i;
+ apr_hash_clear(arb.paths);
+ SVN_ERR(svn_repos_trace_node_locations(fs, &locations, "D/f", 10, revs,
+ authz_read_func, &arb, pool));
+ SVN_ERR(verify_locations(locations, expected, arb.paths, pool));
+
+ APR_ARRAY_PUSH(revs, svn_revnum_t) = 0;
+ apr_hash_clear(arb.paths);
+ SVN_ERR(svn_repos_trace_node_locations(fs, &locations, "D/f", 10, revs,
+ authz_read_func, &arb, pool));
+ SVN_ERR(verify_locations(locations, expected, arb.paths, pool));
+
+ return SVN_NO_ERROR;
+}
+
/* The test table. */
static int max_threads = 4;
@@ -3667,6 +3902,8 @@ static struct svn_test_descriptor_t test
"test test_repos_fs_type"),
SVN_TEST_OPTS_PASS(deprecated_access_context_api,
"test deprecated access context api"),
+ SVN_TEST_OPTS_PASS(trace_node_locations_authz,
+ "authz for svn_repos_trace_node_locations"),
SVN_TEST_NULL
};
Modified: subversion/branches/fsx-1.10/subversion/tests/libsvn_subr/cache-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/tests/libsvn_subr/cache-test.c?rev=1694500&r1=1694499&r2=1694500&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/tests/libsvn_subr/cache-test.c (original)
+++ subversion/branches/fsx-1.10/subversion/tests/libsvn_subr/cache-test.c Thu Aug 6 14:01:38 2015
@@ -221,6 +221,7 @@ test_membuffer_cache_basic(apr_pool_t *p
"cache:",
SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY,
FALSE,
+ FALSE,
pool, pool));
return basic_cache_test(cache, FALSE, pool);
@@ -278,6 +279,7 @@ test_membuffer_serializer_error_handling
"cache:",
SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY,
FALSE,
+ FALSE,
pool, pool));
SVN_ERR(svn_cache__set(cache, "twenty", &twenty, pool));
@@ -307,6 +309,7 @@ test_membuffer_serializer_error_handling
"cache:",
SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY,
FALSE,
+ FALSE,
pool, pool));
/* Store one entry in cache. */
@@ -393,6 +396,7 @@ test_membuffer_cache_clearing(apr_pool_t
"cache:",
SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY,
FALSE,
+ FALSE,
pool, pool));
/* Initially, the cache is empty. */
@@ -440,6 +444,51 @@ test_membuffer_cache_clearing(apr_pool_t
return SVN_NO_ERROR;
}
+/* Implements svn_iter_apr_hash_cb_t. */
+static svn_error_t *
+null_cache_iter_func(void *baton,
+ const void *key,
+ apr_ssize_t klen,
+ void *val,
+ apr_pool_t *pool)
+{
+ /* shall never be called */
+ return svn_error_create(SVN_ERR_TEST_FAILED, NULL, "should not be called");
+}
+
+static svn_error_t *
+test_null_cache(apr_pool_t *pool)
+{
+ svn_boolean_t found, done;
+ int *data = NULL;
+ svn_cache__info_t info;
+
+ svn_cache__t *cache;
+ SVN_ERR(svn_cache__create_null(&cache, "test-dummy", pool));
+
+ /* Can't cache anything. */
+ SVN_TEST_ASSERT(svn_cache__is_cachable(cache, 0) == FALSE);
+ SVN_TEST_ASSERT(svn_cache__is_cachable(cache, 1) == FALSE);
+
+ /* No point in adding data. */
+ SVN_ERR(svn_cache__set(cache, "data", &data, pool));
+ SVN_ERR(svn_cache__get((void **)&data, &found, cache, "data", pool));
+ SVN_TEST_ASSERT(found == FALSE);
+
+ SVN_ERR(svn_cache__has_key(&found, cache, "data", pool));
+ SVN_TEST_ASSERT(found == FALSE);
+
+ /* Iteration "works" but is a no-op. */
+ SVN_ERR(svn_cache__iter(&done, cache, null_cache_iter_func, NULL, pool));
+ SVN_TEST_ASSERT(done);
+
+ /* It shall know its name. */
+ SVN_ERR(svn_cache__get_info(cache, &info, TRUE, pool));
+ SVN_TEST_STRING_ASSERT(info.id, "test-dummy");
+
+ return SVN_NO_ERROR;
+}
+
static svn_error_t *
test_membuffer_unaligned_string_keys(apr_pool_t *pool)
{
@@ -462,7 +511,7 @@ test_membuffer_unaligned_string_keys(apr
SVN_ERR(svn_cache__create_membuffer_cache(
&cache, membuffer, serialize_revnum, deserialize_revnum,
APR_HASH_KEY_STRING, unaligned_prefix,
- SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY, FALSE,
+ SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY, FALSE, FALSE,
pool, pool));
SVN_ERR(svn_cache__set(cache, unaligned_key, &fifty, pool));
@@ -513,7 +562,7 @@ test_membuffer_unaligned_fixed_keys(apr_
&cache, membuffer, serialize_revnum, deserialize_revnum,
8 /* klen*/,
unaligned_prefix,
- SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY, FALSE,
+ SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY, FALSE, FALSE,
pool, pool));
SVN_ERR(svn_cache__set(cache, unaligned_key, &fifty, pool));
@@ -541,6 +590,7 @@ test_membuffer_unaligned_fixed_keys(apr_
return SVN_NO_ERROR;
}
+
/* The test table. */
static int max_threads = 1;
@@ -560,6 +610,8 @@ static struct svn_test_descriptor_t test
"test for error handling in membuffer svn_cache"),
SVN_TEST_PASS2(test_membuffer_cache_clearing,
"test clearing a membuffer svn_cache"),
+ SVN_TEST_PASS2(test_null_cache,
+ "basic null svn_cache test"),
SVN_TEST_PASS2(test_membuffer_unaligned_string_keys,
"test membuffer cache with unaligned string keys"),
SVN_TEST_PASS2(test_membuffer_unaligned_fixed_keys,
Modified: subversion/branches/fsx-1.10/subversion/tests/libsvn_subr/config-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/tests/libsvn_subr/config-test.c?rev=1694500&r1=1694499&r2=1694500&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/tests/libsvn_subr/config-test.c (original)
+++ subversion/branches/fsx-1.10/subversion/tests/libsvn_subr/config-test.c Thu Aug 6 14:01:38 2015
@@ -367,6 +367,18 @@ test_expand(const svn_test_opts_t *opts,
of "c" was not created in a temporary pool when expanding "g". */
SVN_TEST_STRING_ASSERT(val, "bar");
+ /* Get expanded "j" and "k" which have cyclic definitions.
+ * They must return empty values. */
+ svn_config_get(cfg, &val, "section1", "j", NULL);
+ SVN_TEST_STRING_ASSERT(val, "");
+ svn_config_get(cfg, &val, "section1", "k", NULL);
+ SVN_TEST_STRING_ASSERT(val, "");
+
+ /* Get expanded "l" which depends on a cyclic definition.
+ * So, it also considered "undefined" and will be normalized to "". */
+ svn_config_get(cfg, &val, "section1", "l", NULL);
+ SVN_TEST_STRING_ASSERT(val, "");
+
return SVN_NO_ERROR;
}
Modified: subversion/branches/fsx-1.10/subversion/tests/libsvn_subr/config-test.cfg
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/tests/libsvn_subr/config-test.cfg?rev=1694500&r1=1694499&r2=1694500&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/tests/libsvn_subr/config-test.cfg (original)
+++ subversion/branches/fsx-1.10/subversion/tests/libsvn_subr/config-test.cfg Thu Aug 6 14:01:38 2015
@@ -40,6 +40,11 @@ g=lyrical %(c)sd
h= %(unterminated
# Multiple expansions
i=%(a)s %(b)s
+# Recursive two-level variable expansion with surrounding text
+j=some %(k)scle
+k=c%(j)sy
+# Depends on a cyclic definition
+l=depends on a %(j)scycle!
[UpperCaseSection]
a=Aa
Modified: subversion/branches/fsx-1.10/subversion/tests/libsvn_subr/dirent_uri-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/tests/libsvn_subr/dirent_uri-test.c?rev=1694500&r1=1694499&r2=1694500&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/tests/libsvn_subr/dirent_uri-test.c (original)
+++ subversion/branches/fsx-1.10/subversion/tests/libsvn_subr/dirent_uri-test.c Thu Aug 6 14:01:38 2015
@@ -904,16 +904,36 @@ static const testcase_canonicalize_t uri
{ "https://[::1]:443", "https://[::1]" },
{ "http://[FACE:B00C::]/s","http://[face:b00c::]/s" },
{ "svn+ssh://b@[1:2::3]/s","svn+ssh://b@[1:2::3]/s" },
+ { "file:///A%2f%2Fb%2fc", "file:///A/b/c"},
+ { "file:///A%2fb%2f%2Fc", "file:///A/b/c"},
#ifdef SVN_USE_DOS_PATHS
{ "file:///c:/temp/repos", "file:///C:/temp/repos" },
{ "file:///c:/temp/REPOS", "file:///C:/temp/REPOS" },
{ "file:///C:/temp/REPOS", "file:///C:/temp/REPOS" },
{ "file:///c:/", "file:///C:" },
+ { "file:///c:%2ftemp", "file:///C:/temp"},
+ { "file:///C:hi", "file:///C:hi" },
+ { "file:///c:hi", "file:///C:hi" },
+ { "file:///C:hi/Q", "file:///C:hi/Q" },
+ { "file:///c:hi/q", "file:///C:hi/q" },
+ { "file:///c:hi%2fD", "file:///C:hi/D" },
+ { "file:///c:hi%25/A", "file:///C:hi%25/A"},
+ { "file:///c:hi%2E/A", "file:///C:hi./A"},
+ { "file:///c:hi%/A", "file:///C:hi%25/A"},
#else /* !SVN_USE_DOS_PATHS */
{ "file:///c:/temp/repos", "file:///c:/temp/repos" },
{ "file:///c:/temp/REPOS", "file:///c:/temp/REPOS" },
{ "file:///C:/temp/REPOS", "file:///C:/temp/REPOS" },
{ "file:///c:/", "file:///c:" },
+ { "file:///c:%2ftemp", "file:///c:/temp"},
+ { "file:///C:hi", "file:///C:hi" },
+ { "file:///c:hi", "file:///c:hi" },
+ { "file:///C:hi/Q", "file:///C:hi/Q" },
+ { "file:///c:hi/q", "file:///c:hi/q" },
+ { "file:///c:hi%2fD", "file:///c:hi/D" },
+ { "file:///c:hi%25/A", "file:///c:hi%25/A" },
+ { "file:///c:hi%2E/A", "file:///c:hi./A"},
+ { "file:///c:hi%/A", "file:///c:hi%25/A"},
#endif /* SVN_USE_DOS_PATHS */
/* Hostnames that look like non-canonical paths */
{ "file://./foo", "file://./foo" },
@@ -2332,6 +2352,25 @@ test_dirent_from_file_url(apr_pool_t *po
{ "file:///A%7C", "A:/" },
{ "file:///A%7C/dir", "A:/dir" },
{ "file:///A%7Cdir", "A:dir" },
+ { "file:///A%7C%5Cdir", "A:/dir" },
+ { "file:///A%7C%5Cdir%5Cfile", "A:/dir\\file" },
+ { "file:///A:%5Cdir", "A:/dir" },
+ { "file:///A:%5Cdir%5Cfile", "A:/dir\\file" },
+ { "file://localhost/A:%5Cfile","A:/file"},
+ { "file://localhost/A:file", "A:file"}
+#else
+ { "file:///A:", "/A:" },
+ { "file:///A:/dir", "/A:/dir" },
+ { "file:///A:dir", "/A:dir" },
+ { "file:///A%7C", "/A|" },
+ { "file:///A%7C/dir", "/A|/dir" },
+ { "file:///A%7Cdir", "/A|dir" },
+ { "file:///A%7C%5Cdir", "/A|\\dir" },
+ { "file:///A%7C%5Cdir%5Cfile", "/A|\\dir\\file" },
+ { "file:///A:%5Cdir", "/A:\\dir" },
+ { "file:///A:%5Cdir%5Cfile", "/A:\\dir\\file" },
+ { "file://localhost/A:%5Cfile","/A:\\file" },
+ { "file://localhost/A:file", "/A:file" }
#endif
};
int i;
@@ -2347,6 +2386,11 @@ test_dirent_from_file_url(apr_pool_t *po
"svn_uri_get_dirent_from_file_url(\"%s\") "
"returned \"%s\" expected \"%s\"",
tests[i].url, result, tests[i].result);
+ if (!svn_dirent_is_canonical(result, pool))
+ return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
+ "svn_uri_get_dirent_from_file_url(\"%s\") "
+ "returned \"%s\", which is not canonical.",
+ tests[i].url, result);
}
return SVN_NO_ERROR;
Modified: subversion/branches/fsx-1.10/tools/dev/scramble-tree.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/tools/dev/scramble-tree.py?rev=1694500&r1=1694499&r2=1694500&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/tools/dev/scramble-tree.py (original)
+++ subversion/branches/fsx-1.10/tools/dev/scramble-tree.py Thu Aug 6 14:01:38 2015
@@ -60,12 +60,7 @@ try:
except AttributeError:
my_getopt = getopt.getopt
import random
-try:
- # Python >=2.5
- from hashlib import md5 as hashlib_md5
-except ImportError:
- # Python <2.5
- from md5 import md5 as hashlib_md5
+from hashlib import md5 as hashlib_md5
import base64
Modified: subversion/branches/fsx-1.10/tools/dist/rat-excludes
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/tools/dist/rat-excludes?rev=1694500&r1=1694499&r2=1694500&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/tools/dist/rat-excludes (original)
+++ subversion/branches/fsx-1.10/tools/dist/rat-excludes Thu Aug 6 14:01:38 2015
@@ -32,7 +32,7 @@ subversion/bindings/ctypes-python/csvn/e
subversion/tests/cmdline/svntest/err.py
tools/buildbot/master/public_html/buildbot.css
tools/dist/rat-excludes
-tools/dist/_gnupg.py
+tools/dist/security/_gnupg.py
tools/dist/templates/*.ezt
tools/dev/iz/defect.dem
tools/dev/iz/ff2csv.command
Modified: subversion/branches/fsx-1.10/tools/dist/release.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/tools/dist/release.py?rev=1694500&r1=1694499&r2=1694500&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/tools/dist/release.py (original)
+++ subversion/branches/fsx-1.10/tools/dist/release.py Thu Aug 6 14:01:38 2015
@@ -34,9 +34,6 @@
# It'd be kind of nice to use the Subversion python bindings in this script,
# but people.apache.org doesn't currently have them installed
-# Futures (Python 2.5 compatibility)
-from __future__ import with_statement
-
# Stuff we need
import os
import re
@@ -86,12 +83,12 @@ except AttributeError:
tool_versions = {
'trunk' : {
'autoconf' : '2.69',
- 'libtool' : '2.4.3',
+ 'libtool' : '2.4.6',
'swig' : '2.0.12',
},
'1.9' : {
'autoconf' : '2.69',
- 'libtool' : '2.4.3',
+ 'libtool' : '2.4.6',
'swig' : '2.0.12'
},
'1.8' : {
@@ -356,6 +353,13 @@ class LibtoolDep(RollDep):
# system libtool (I'm looking at you, Debian).
return False
+ def build(self):
+ RollDep.build(self)
+ # autogen.sh looks for glibtoolize before libtoolize
+ bin_dir = os.path.join(get_prefix(self._base_dir), "bin")
+ os.symlink("libtoolize", os.path.join(bin_dir, "glibtoolize"))
+ os.symlink("libtool", os.path.join(bin_dir, "glibtool"))
+
class SwigDep(RollDep):
def __init__(self, base_dir, use_existing, verbose, swig_ver, sf_mirror):
@@ -799,7 +803,7 @@ def get_siginfo(args, quiet=False):
try:
import gnupg
except ImportError:
- import _gnupg as gnupg
+ import security._gnupg as gnupg
gpg = gnupg.GPG()
target = get_target(args)
Modified: subversion/branches/fsx-1.10/win-tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/win-tests.py?rev=1694500&r1=1694499&r2=1694500&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/win-tests.py (original)
+++ subversion/branches/fsx-1.10/win-tests.py Thu Aug 6 14:01:38 2015
@@ -490,6 +490,7 @@ class Httpd:
self.httpd_config = os.path.join(self.root, 'httpd.conf')
self.httpd_users = os.path.join(self.root, 'users')
self.httpd_mime_types = os.path.join(self.root, 'mime.types')
+ self.httpd_groups = os.path.join(self.root, 'groups')
self.abs_builddir = abs_builddir
self.abs_objdir = abs_objdir
self.service_name = 'svn-test-httpd-' + str(httpd_port)
@@ -503,6 +504,7 @@ class Httpd:
create_target_dir(self.root_dir)
self._create_users_file()
+ self._create_groups_file()
self._create_mime_types_file()
self._create_dontdothat_file()
@@ -543,6 +545,8 @@ class Httpd:
if self.httpd_ver >= 2.2:
fp.write(self._sys_module('auth_basic_module', 'mod_auth_basic.so'))
fp.write(self._sys_module('authn_file_module', 'mod_authn_file.so'))
+ fp.write(self._sys_module('authz_groupfile_module', 'mod_authz_groupfile.so'))
+ fp.write(self._sys_module('authz_host_module', 'mod_authz_host.so'))
else:
fp.write(self._sys_module('auth_module', 'mod_auth.so'))
fp.write(self._sys_module('alias_module', 'mod_alias.so'))
@@ -565,6 +569,7 @@ class Httpd:
# Define two locations for repositories
fp.write(self._svn_repo('repositories'))
fp.write(self._svn_repo('local_tmp'))
+ fp.write(self._svn_authz_repo())
# And two redirects for the redirect tests
fp.write('RedirectMatch permanent ^/svn-test-work/repositories/'
@@ -597,6 +602,17 @@ class Httpd:
'jconstant', 'rayjandom'])
os.spawnv(os.P_WAIT, htpasswd, ['htpasswd.exe', '-bp', self.httpd_users,
'__dumpster__', '__loadster__'])
+ os.spawnv(os.P_WAIT, htpasswd, ['htpasswd.exe', '-bp', self.httpd_users,
+ 'JRANDOM', 'rayjandom'])
+ os.spawnv(os.P_WAIT, htpasswd, ['htpasswd.exe', '-bp', self.httpd_users,
+ 'JCONSTANT', 'rayjandom'])
+
+ def _create_groups_file(self):
+ "Create groups for mod_authz_svn tests"
+ fp = open(self.httpd_groups, 'w')
+ fp.write('random: jrandom\n')
+ fp.write('constant: jconstant\n')
+ fp.close()
def _create_mime_types_file(self):
"Create empty mime.types file"
@@ -657,6 +673,153 @@ class Httpd:
' DontDoThatConfigFile ' + self._quote(self.dontdothat_file) + '\n' \
'</Location>\n'
+ def _svn_authz_repo(self):
+ local_tmp = os.path.join(self.abs_builddir,
+ CMDLINE_TEST_SCRIPT_NATIVE_PATH,
+ 'svn-test-work', 'local_tmp')
+ return \
+ '<Location /authz-test-work/anon>' + '\n' \
+ ' DAV svn' + '\n' \
+ ' SVNParentPath ' + local_tmp + '\n' \
+ ' AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
+ ' SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
+ ' SVNListParentPath On' + '\n' \
+ ' <IfModule mod_authz_core.c>' + '\n' \
+ ' Require all granted' + '\n' \
+ ' </IfModule>' + '\n' \
+ ' <IfModule !mod_authz_core.c>' + '\n' \
+ ' Allow from all' + '\n' \
+ ' </IfModule>' + '\n' \
+ ' SVNPathAuthz ' + self.path_authz_option + '\n' \
+ '</Location>' + '\n' \
+ '<Location /authz-test-work/mixed>' + '\n' \
+ ' DAV svn' + '\n' \
+ ' SVNParentPath ' + local_tmp + '\n' \
+ ' AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
+ ' SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
+ ' SVNListParentPath On' + '\n' \
+ ' AuthType Basic' + '\n' \
+ ' AuthName "Subversion Repository"' + '\n' \
+ ' AuthUserFile ' + self._quote(self.httpd_users) + '\n' \
+ ' Require valid-user' + '\n' \
+ ' Satisfy Any' + '\n' \
+ ' SVNPathAuthz ' + self.path_authz_option + '\n' \
+ '</Location>' + '\n' \
+ '<Location /authz-test-work/mixed-noauthwhenanon>' + '\n' \
+ ' DAV svn' + '\n' \
+ ' SVNParentPath ' + local_tmp + '\n' \
+ ' AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
+ ' SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
+ ' SVNListParentPath On' + '\n' \
+ ' AuthType Basic' + '\n' \
+ ' AuthName "Subversion Repository"' + '\n' \
+ ' AuthUserFile ' + self._quote(self.httpd_users) + '\n' \
+ ' Require valid-user' + '\n' \
+ ' AuthzSVNNoAuthWhenAnonymousAllowed On' + '\n' \
+ ' SVNPathAuthz On' + '\n' \
+ '</Location>' + '\n' \
+ '<Location /authz-test-work/authn>' + '\n' \
+ ' DAV svn' + '\n' \
+ ' SVNParentPath ' + local_tmp + '\n' \
+ ' AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
+ ' SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
+ ' SVNListParentPath On' + '\n' \
+ ' AuthType Basic' + '\n' \
+ ' AuthName "Subversion Repository"' + '\n' \
+ ' AuthUserFile ' + self._quote(self.httpd_users) + '\n' \
+ ' Require valid-user' + '\n' \
+ ' SVNPathAuthz ' + self.path_authz_option + '\n' \
+ '</Location>' + '\n' \
+ '<Location /authz-test-work/authn-anonoff>' + '\n' \
+ ' DAV svn' + '\n' \
+ ' SVNParentPath ' + local_tmp + '\n' \
+ ' AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
+ ' SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
+ ' SVNListParentPath On' + '\n' \
+ ' AuthType Basic' + '\n' \
+ ' AuthName "Subversion Repository"' + '\n' \
+ ' AuthUserFile ' + self._quote(self.httpd_users) + '\n' \
+ ' Require valid-user' + '\n' \
+ ' AuthzSVNAnonymous Off' + '\n' \
+ ' SVNPathAuthz On' + '\n' \
+ '</Location>' + '\n' \
+ '<Location /authz-test-work/authn-lcuser>' + '\n' \
+ ' DAV svn' + '\n' \
+ ' SVNParentPath ' + local_tmp + '\n' \
+ ' AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
+ ' SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
+ ' SVNListParentPath On' + '\n' \
+ ' AuthType Basic' + '\n' \
+ ' AuthName "Subversion Repository"' + '\n' \
+ ' AuthUserFile ' + self._quote(self.httpd_users) + '\n' \
+ ' Require valid-user' + '\n' \
+ ' AuthzForceUsernameCase Lower' + '\n' \
+ ' SVNPathAuthz ' + self.path_authz_option + '\n' \
+ '</Location>' + '\n' \
+ '<Location /authz-test-work/authn-lcuser>' + '\n' \
+ ' DAV svn' + '\n' \
+ ' SVNParentPath ' + local_tmp + '\n' \
+ ' AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
+ ' SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
+ ' SVNListParentPath On' + '\n' \
+ ' AuthType Basic' + '\n' \
+ ' AuthName "Subversion Repository"' + '\n' \
+ ' AuthUserFile ' + self._quote(self.httpd_users) + '\n' \
+ ' Require valid-user' + '\n' \
+ ' AuthzForceUsernameCase Lower' + '\n' \
+ ' SVNPathAuthz ' + self.path_authz_option + '\n' \
+ '</Location>' + '\n' \
+ '<Location /authz-test-work/authn-group>' + '\n' \
+ ' DAV svn' + '\n' \
+ ' SVNParentPath ' + local_tmp + '\n' \
+ ' AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
+ ' SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
+ ' SVNListParentPath On' + '\n' \
+ ' AuthType Basic' + '\n' \
+ ' AuthName "Subversion Repository"' + '\n' \
+ ' AuthUserFile ' + self._quote(self.httpd_users) + '\n' \
+ ' AuthGroupFile ' + self._quote(self.httpd_groups) + '\n' \
+ ' Require group random' + '\n' \
+ ' AuthzSVNAuthoritative Off' + '\n' \
+ ' SVNPathAuthz On' + '\n' \
+ '</Location>' + '\n' \
+ '<IfModule mod_authz_core.c>' + '\n' \
+ '<Location /authz-test-work/sallrany>' + '\n' \
+ ' DAV svn' + '\n' \
+ ' SVNParentPath ' + local_tmp + '\n' \
+ ' AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
+ ' SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
+ ' SVNListParentPath On' + '\n' \
+ ' AuthType Basic' + '\n' \
+ ' AuthName "Subversion Repository"' + '\n' \
+ ' AuthUserFile ' + self._quote(self.httpd_users) + '\n' \
+ ' AuthzSendForbiddenOnFailure On' + '\n' \
+ ' Satisfy All' + '\n' \
+ ' <RequireAny>' + '\n' \
+ ' Require valid-user' + '\n' \
+ ' Require expr req(\'ALLOW\') == \'1\'' + '\n' \
+ ' </RequireAny>' + '\n' \
+ ' SVNPathAuthz ' + self.path_authz_option + '\n' \
+ '</Location>' + '\n' \
+ '<Location /authz-test-work/sallrall>'+ '\n' \
+ ' DAV svn' + '\n' \
+ ' SVNParentPath ' + local_tmp + '\n' \
+ ' AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
+ ' SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
+ ' SVNListParentPath On' + '\n' \
+ ' AuthType Basic' + '\n' \
+ ' AuthName "Subversion Repository"' + '\n' \
+ ' AuthUserFile ' + self._quote(self.httpd_users) + '\n' \
+ ' AuthzSendForbiddenOnFailure On' + '\n' \
+ ' Satisfy All' + '\n' \
+ ' <RequireAll>' + '\n' \
+ ' Require valid-user' + '\n' \
+ ' Require expr req(\'ALLOW\') == \'1\'' + '\n' \
+ ' </RequireAll>' + '\n' \
+ ' SVNPathAuthz ' + self.path_authz_option + '\n' \
+ '</Location>' + '\n' \
+ '</IfModule>' + '\n' \
+
def start(self):
if self.service:
self._start_service()
@@ -826,6 +989,10 @@ if not test_javahl and not test_swig:
log_file = os.path.join(abs_builddir, log)
fail_log_file = os.path.join(abs_builddir, faillog)
+ if run_httpd:
+ httpd_version = gen_obj._libraries['httpd'].version
+ else:
+ httpd_version = None
th = run_tests.TestHarness(abs_srcdir, abs_builddir,
log_file,
fail_log_file,
@@ -835,6 +1002,7 @@ if not test_javahl and not test_swig:
fsfs_sharding, fsfs_packing,
list_tests, svn_bin, mode_filter,
milestone_filter,
+ httpd_version=httpd_version,
set_log_level=log_level, ssl_cert=ssl_cert,
exclusive_wc_locks=exclusive_wc_locks,
memcached_server=memcached_server,