From: Stefan Metzmacher Date: Fri, 3 Jul 2020 13:58:38 +0000 (+0200) Subject: s4:torture: avoid multiple recursions into the test lists X-Git-Tag: samba-4.13.0rc1~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e39e43730ceaf79b5927f542ccd2f31c66ffb28;p=thirdparty%2Fsamba.git s4:torture: avoid multiple recursions into the test lists torture_run_suite_restricted() and torture_run_tcase_restricted() already handle recursion. If we call them from smbtorture we should avoid our own recursion. Without this passing 'smb2.multichannel.*' results in running tests more than once. Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c index f0da30727d9..beed88c0eb4 100644 --- a/source4/torture/smbtorture.c +++ b/source4/torture/smbtorture.c @@ -87,10 +87,12 @@ static bool run_matching(struct torture_context *torture, if (gen_fnmatch(expr, name) == 0) { *matched = true; reload_charcnv(torture->lp_ctx); - if (restricted != NULL) - ret &= torture_run_suite_restricted(torture, o, restricted); - else - ret &= torture_run_suite(torture, o); + ret &= torture_run_suite_restricted(torture, o, restricted); + /* + * torture_run_suite_restricted() already implements + * recursion, so we're done with this child suite. + */ + continue; } ret &= run_matching(torture, name, expr, restricted, o, matched); } @@ -101,6 +103,11 @@ static bool run_matching(struct torture_context *torture, *matched = true; reload_charcnv(torture->lp_ctx); ret &= torture_run_tcase_restricted(torture, t, restricted); + /* + * torture_run_tcase_restricted() already implements + * recursion, so we're done for this tcase. + */ + continue; } for (p = t->tests; p; p = p->next) { char *pname = prefix_name(torture, tname, p->name);