From c73d666e5abe8717a5ea333a6dae3619d9621d48 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 19 Aug 2022 10:45:10 +0200 Subject: [PATCH] smbtorture: turn maximum_allowed test into a test suite BUG: https://bugzilla.samba.org/show_bug.cgi?id=14215 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- selftest/knownfail | 2 +- source4/torture/smb2/max_allowed.c | 12 ++++++++++-- source4/torture/smb2/smb2.c | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/selftest/knownfail b/selftest/knownfail index 82dd7e1e8b4..f130d2dc3c5 100644 --- a/selftest/knownfail +++ b/selftest/knownfail @@ -118,7 +118,7 @@ ^samba4.smb2.charset.*.Testing partial surrogate # This test is currently broken ^samba3.smb2.charset.*.Testing partial surrogate # This test is currently broken ^samba4.*.base.maximum_allowed # broken until we implement NTCREATEX_OPTIONS_BACKUP_INTENT -^samba..*.smb2.maximum_allowed +^samba..*.smb2.maximum_allowed.maximum_allowed .*net.api.delshare.* # DelShare isn't implemented yet ^samba4.smb2.oplock.doc ^samba4.smb2.lock.valid-request diff --git a/source4/torture/smb2/max_allowed.c b/source4/torture/smb2/max_allowed.c index e68b0ff25d7..e70f0c865a3 100644 --- a/source4/torture/smb2/max_allowed.c +++ b/source4/torture/smb2/max_allowed.c @@ -27,8 +27,8 @@ #include "torture/smb2/proto.h" #define MAXIMUM_ALLOWED_FILE "torture_maximum_allowed" -bool torture_smb2_maximum_allowed(struct torture_context *tctx, - struct smb2_tree *tree) +static bool torture_smb2_maximum_allowed(struct torture_context *tctx, + struct smb2_tree *tree) { struct security_descriptor *sd = NULL, *sd_orig = NULL; struct smb2_create io = {0}; @@ -190,3 +190,11 @@ bool torture_smb2_maximum_allowed(struct torture_context *tctx, talloc_free(mem_ctx); return ret; } + +struct torture_suite *torture_smb2_max_allowed(TALLOC_CTX *ctx) +{ + struct torture_suite *suite = torture_suite_create(ctx, "maximum_allowed"); + + torture_suite_add_1smb2_test(suite, "maximum_allowed", torture_smb2_maximum_allowed); + return suite; +} diff --git a/source4/torture/smb2/smb2.c b/source4/torture/smb2/smb2.c index 85c51c2e890..458561adac3 100644 --- a/source4/torture/smb2/smb2.c +++ b/source4/torture/smb2/smb2.c @@ -205,7 +205,7 @@ NTSTATUS torture_smb2_init(TALLOC_CTX *ctx) torture_suite_add_1smb2_test(suite, "winattr", torture_smb2_winattrtest); torture_suite_add_1smb2_test(suite, "sdread", torture_smb2_sdreadtest); torture_suite_add_suite(suite, torture_smb2_readwrite_init(suite)); - torture_suite_add_1smb2_test(suite, "maximum_allowed", torture_smb2_maximum_allowed); + torture_suite_add_suite(suite, torture_smb2_max_allowed(suite)); torture_suite_add_1smb2_test(suite, "mangle", torture_smb2_mangle); torture_suite_add_1smb2_test(suite, "tcon", run_tcon_test); torture_suite_add_1smb2_test(suite, "mkdir", torture_smb2_mkdir);