From: Jeremy Allison Date: Tue, 21 Apr 2020 20:34:52 +0000 (-0700) Subject: s3: selftest: Remove test_vfs_widelinks. X-Git-Tag: ldb-2.2.0~892 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=045e8898ba727f0c7e9c39965c7d60d4692889aa;p=thirdparty%2Fsamba.git s3: selftest: Remove test_vfs_widelinks. All of the tests that were in there are now tested in samba3.smbtorture_s3.LOCAL-CANONICALIZE-PATH along with other paths. Clean revert of f7fe3474298 not possible due to changes in source3/selftest/tests.py Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/test_vfs_widelinks.c b/source3/modules/test_vfs_widelinks.c deleted file mode 100644 index c6055c8c17c..00000000000 --- a/source3/modules/test_vfs_widelinks.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * - * Unit test for widelinks path validator. - * - * Copyright (C) Jeremy Allison 2020 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ - -/* Needed for static build to complete... */ -#include "includes.h" -#include "smbd/smbd.h" -NTSTATUS vfs_widelinks_init(TALLOC_CTX *ctx); - -#include "vfs_widelinks.c" -#include - -struct str_test_values { - const char *src_str; - const char *dst_str; -} ; - -/* As many nasty edge cases as I can think of.. */ - -static struct str_test_values examples[] = { - { "/", "/" }, - { "/../../", "/" }, - { "/foo/../", "/" }, - { "/./././", "/" }, - { "/./././.", "/" }, - { "/.../././.", "/..." }, - { "/./././.foo", "/.foo" }, - { "/./././.foo.", "/.foo." }, - { "/./././foo.", "/foo." }, - { "/foo/bar/..", "/foo" }, - { "/foo/bar/../baz/", "/foo/baz" }, - { "////////////////", "/" }, - { "/////////./././././.", "/" }, - { "/./.././../.boo/../baz", "/baz" }, - { "/a/component/path", "/a/component/path" }, - { "/a/component/path/", "/a/component/path" }, - { "/a/component/path/..", "/a/component" }, - { "/a/component/../path/", "/a/path" }, - { "///a/./././///component/../////path/", "/a/path" } -}; - -/* - * Test our realpath resolution code. - */ -static void test_resolve_realpath_name(void **state) -{ - unsigned i; - TALLOC_CTX *frame = talloc_stackframe(); - - for (i = 0; i < ARRAY_SIZE(examples); i++) { - char *test_dst = resolve_realpath_name(frame, - examples[i].src_str); - if (test_dst == NULL) { - fail(); - } - assert_string_equal(test_dst, examples[i].dst_str); - TALLOC_FREE(test_dst); - } - TALLOC_FREE(frame); -} - -int main(int argc, char **argv) -{ - const struct CMUnitTest tests[] = { - cmocka_unit_test(test_resolve_realpath_name), - }; - - cmocka_set_message_output(CM_OUTPUT_SUBUNIT); - - return cmocka_run_group_tests(tests, NULL, NULL); -} diff --git a/source3/modules/wscript_build b/source3/modules/wscript_build index 1f2d2d3acb6..7f056f2b7f7 100644 --- a/source3/modules/wscript_build +++ b/source3/modules/wscript_build @@ -628,8 +628,3 @@ bld.SAMBA3_MODULE('vfs_widelinks', init_function='', internal_module=bld.SAMBA3_IS_STATIC_MODULE('vfs_widelinks'), enabled=bld.SAMBA3_IS_ENABLED_MODULE('vfs_widelinks')) - -bld.SAMBA3_BINARY('test_vfs_widelinks', - source='test_vfs_widelinks.c', - deps='smbd_base cmocka', - for_selftest=True) diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index a536a473cb5..8210e981c35 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -508,10 +508,6 @@ plantestsuite("samba3.test_nfs4_acl", "none", [os.path.join(bindir(), "test_nfs4_acls"), "$SMB_CONF_PATH"]) -plantestsuite("samba3.test_vfs_widelinks", "none", - [os.path.join(bindir(), "test_vfs_widelinks"), - "$SMB_CONF_PATH"]) - plantestsuite("samba3.test_vfs_full_audit", "none", [os.path.join(bindir(), "test_vfs_full_audit"), "$SMB_CONF_PATH"])