summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSachin Prabhu <sprabhu@redhat.com>2020-07-03 14:17:43 +0200
committerStefan Metzmacher <metze@samba.org>2020-07-07 10:30:40 +0000
commit8902eb82d981e07812134285e199b47b22acd815 (patch)
tree9bc1cf64baa8e6a8d8253141505e451f7f30ae39
parent4e39e43730ceaf79b5927f542ccd2f31c66ffb28 (diff)
downloadsamba-8902eb82d981e07812134285e199b47b22acd815.tar.gz
s4:torture: Add command line parameter --fullname
This argument is used to print out the the full name which includes the name of the test suite. For example, the name in the output for the test smb2.read.dir is "dir". By using the --fullname parameter, the name used will be "smb2.read.dir". The default continues to be to use the shortname. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
-rw-r--r--source4/torture/smbtorture.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c
index beed88c0eb4..88c38d254e9 100644
--- a/source4/torture/smbtorture.c
+++ b/source4/torture/smbtorture.c
@@ -38,6 +38,8 @@
#include <readline/history.h>
#endif
+static int use_fullname;
+
static char *prefix_name(TALLOC_CTX *mem_ctx, const char *prefix, const char *name)
{
if (prefix == NULL)
@@ -87,7 +89,13 @@ static bool run_matching(struct torture_context *torture,
if (gen_fnmatch(expr, name) == 0) {
*matched = true;
reload_charcnv(torture->lp_ctx);
+ if (use_fullname == 1) {
+ torture_subunit_prefix_reset(torture, prefix);
+ }
ret &= torture_run_suite_restricted(torture, o, restricted);
+ if (use_fullname == 1) {
+ torture_subunit_prefix_reset(torture, NULL);
+ }
/*
* torture_run_suite_restricted() already implements
* recursion, so we're done with this child suite.
@@ -102,7 +110,13 @@ static bool run_matching(struct torture_context *torture,
if (gen_fnmatch(expr, tname) == 0) {
*matched = true;
reload_charcnv(torture->lp_ctx);
+ if (use_fullname == 1) {
+ torture_subunit_prefix_reset(torture, prefix);
+ }
ret &= torture_run_tcase_restricted(torture, t, restricted);
+ if (use_fullname == 1) {
+ torture_subunit_prefix_reset(torture, NULL);
+ }
/*
* torture_run_tcase_restricted() already implements
* recursion, so we're done for this tcase.
@@ -114,7 +128,15 @@ static bool run_matching(struct torture_context *torture,
if (gen_fnmatch(expr, pname) == 0) {
*matched = true;
reload_charcnv(torture->lp_ctx);
+ if (use_fullname == 1) {
+ torture_subunit_prefix_reset(torture,
+ tname);
+ }
ret &= torture_run_test_restricted(torture, t, p, restricted);
+ if (use_fullname == 1) {
+ torture_subunit_prefix_reset(torture,
+ NULL);
+ }
}
}
}
@@ -400,6 +422,8 @@ int main(int argc, const char *argv[])
struct poptOption long_options[] = {
POPT_AUTOHELP
+ {"fullname", 0, POPT_ARG_NONE, &use_fullname, 0,
+ "use full name for the test", NULL },
{"format", 0, POPT_ARG_STRING, &ui_ops_name, 0, "Output format (one of: simple, subunit)", NULL },
{"smb-ports", 'p', POPT_ARG_STRING, NULL, OPT_SMB_PORTS, "SMB ports", NULL},
{"basedir", 0, POPT_ARG_STRING, &basedir, 0, "base directory", "BASEDIR" },