summaryrefslogtreecommitdiff
path: root/source4/torture/smbtorture.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-10-30 11:34:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:24:43 -0500
commit56c9e61d10976b7eae34bf7f064d45c0c4dbe8b8 (patch)
tree8551be720ecbde12cb364b6d4ba9909f9d58c331 /source4/torture/smbtorture.c
parentaf3c5b46d3c81692dc7e49c84bd372d2ff740e24 (diff)
downloadsamba-56c9e61d10976b7eae34bf7f064d45c0c4dbe8b8.tar.gz
r19513: Add support for recipes (using '@')
(This used to be commit dbe5e8dd8c0986e5ab55a072957048f633838157)
Diffstat (limited to 'source4/torture/smbtorture.c')
-rw-r--r--source4/torture/smbtorture.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c
index b615dd66adf..b47127ff3fc 100644
--- a/source4/torture/smbtorture.c
+++ b/source4/torture/smbtorture.c
@@ -425,6 +425,33 @@ const static struct torture_ui_ops quiet_ui_ops = {
.test_result = quiet_test_result
};
+void run_recipe(struct torture_context *tctx, const char *recipe)
+{
+ int numlines, i, ret;
+ char **lines;
+
+ lines = file_lines_load(recipe, &numlines, NULL);
+ if (lines == NULL) {
+ fprintf(stderr, "Unable to load file %s\n", recipe);
+ return;
+ }
+
+ for (i = 0; i < numlines; i++) {
+ int argc;
+ char **argv;
+
+ ret = poptParseArgvString(lines[i], &argc, &argv);
+ if (ret != 0) {
+ fprintf(stderr, "Error parsing line\n");
+ continue;
+ }
+
+ run_test(tctx, argv[0]);
+ }
+
+ talloc_free(lines);
+}
+
void run_shell(struct torture_context *tctx)
{
char *cline;
@@ -523,7 +550,7 @@ int main(int argc,char *argv[])
setlinebuf(stdout);
/* we are never interested in SIGPIPE */
- BlockSignals(true,SIGPIPE);
+ BlockSignals(true, SIGPIPE);
pc = poptGetContext("smbtorture", argc, (const char **) argv, long_options,
POPT_CONTEXT_KEEP_FIRST);
@@ -649,7 +676,9 @@ int main(int argc,char *argv[])
double rate;
int unexpected_failures;
for (i=2;i<argc_new;i++) {
- if (!run_test(torture, argv_new[i])) {
+ if (argv_new[i][0] == '@') {
+ run_recipe(torture, argv_new[i]+1);
+ } else if (!run_test(torture, argv_new[i])) {
correct = false;
}
}