s4-smbtorture: Make test names lowercase and dot-separated.
[metze/samba/wip.git] / source4 / torture / nbench / nbench.c
index 96144c47735592b5af885c7371ce3e0588e133e5..b0e3364f7e8dcd6dbf6c5e7f9bd07466ed50bd7a 100644 (file)
@@ -23,7 +23,6 @@
 #include "torture/smbtorture.h"
 #include "system/filesys.h"
 #include "system/locale.h"
-#include "pstring.h"
 
 #include "torture/nbench/proto.h"
 
@@ -59,7 +58,7 @@ static bool run_netbench(struct torture_context *tctx, struct smbcli_state *cli,
 {
        int torture_nprocs = torture_setting_int(tctx, "nprocs", 4);
        int i;
-       pstring line;
+       char line[1024];
        char *cname;
        FILE *f;
        bool correct = true;
@@ -96,11 +95,14 @@ again:
 
                nbench_line_count++;
 
-               line[strlen(line)-1] = 0;
+               if ((strlen(line) > 0) && line[strlen(line)-1] == '\n') {
+                       line[strlen(line)-1] = 0;
+               }
 
-               all_string_sub(line,"client1", cname, sizeof(line));
+               all_string_sub(line, "client1", cname, sizeof(line));
                
-               params = params0 = str_list_make_shell(NULL, line, " ");
+               params = params0 = const_str_list(
+                                       str_list_make_shell(NULL, line, " "));
                i = str_list_length(params);
 
                if (i > 0 && isdigit(params[0][0])) {
@@ -280,12 +282,10 @@ bool torture_nbench(struct torture_context *torture)
 
 NTSTATUS torture_nbench_init(void)
 {
-       struct torture_suite *suite = 
-               torture_suite_create(
-                       talloc_autofree_context(),
-                       "BENCH");
+       struct torture_suite *suite = torture_suite_create(
+                                                  talloc_autofree_context(), "bench");
 
-       torture_suite_add_simple_test(suite, "NBENCH", torture_nbench);
+       torture_suite_add_simple_test(suite, "nbench", torture_nbench);
 
        suite->description = talloc_strdup(suite, "Benchmarks");