]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:torture: Change -U|--user to --user1 and --user2
authorAndreas Schneider <asn@samba.org>
Thu, 17 Dec 2020 15:55:02 +0000 (16:55 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 16 Jun 2021 00:34:38 +0000 (00:34 +0000)
The '-U' option is already defined by the default cmdline parser!

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/torture/locktest.c
source4/torture/tests/test_locktest.sh

index 97e0b6c0abde86c24d06a92290a723fc829b897d..a46c5aeb39f1e2baf0017b3fd5e6cf2b7a3335ca 100644 (file)
@@ -558,7 +558,11 @@ int main(int argc, const char *argv[])
        poptContext pc;
        int argc_new, i;
        char **argv_new;
-       enum {OPT_UNCLIST=1000};
+       enum {
+               OPT_UNCLIST=1000,
+               OPT_USER1,
+               OPT_USER2,
+       };
        struct poptOption long_options[] = {
                POPT_AUTOHELP
                {"seed",          0, POPT_ARG_INT,  &seed,      0,      "Seed to use for randomizer",   NULL},
@@ -573,7 +577,8 @@ int main(int argc, const char *argv[])
                {"zerozero",      0, POPT_ARG_NONE, &zero_zero,    0,      "do zero/zero lock", NULL},
                {"exacterrors",   0, POPT_ARG_NONE, &exact_error_codes,0,"use exact error codes", NULL},
                {"unclist",       0, POPT_ARG_STRING,   NULL,   OPT_UNCLIST,    "unclist",      NULL},
-               { "user", 'U',       POPT_ARG_STRING, NULL, 'U', "Set the network username", "[DOMAIN/]USERNAME[%PASSWORD]" },
+               {"user1",         0, POPT_ARG_STRING, NULL, OPT_USER1, "Set first network username", "[DOMAIN/]USERNAME[%PASSWORD]" },
+               {"user2",         0, POPT_ARG_STRING, NULL, OPT_USER2, "Set second network username", "[DOMAIN/]USERNAME[%PASSWORD]" },
                POPT_COMMON_SAMBA
                POPT_COMMON_CONNECTION
                POPT_COMMON_CREDENTIALS
@@ -608,13 +613,16 @@ int main(int argc, const char *argv[])
                case OPT_UNCLIST:
                        lpcfg_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc));
                        break;
-               case 'U':
-                       if (username_count == 2) {
-                               usage(pc);
-                               talloc_free(mem_ctx);
-                               exit(1);
-                       }
-                       cli_credentials_parse_string(servers[username_count], poptGetOptArg(pc), CRED_SPECIFIED);
+               case OPT_USER1:
+                       cli_credentials_parse_string(servers[0],
+                                                    poptGetOptArg(pc),
+                                                    CRED_SPECIFIED);
+                       username_count++;
+                       break;
+               case OPT_USER2:
+                       cli_credentials_parse_string(servers[1],
+                                                    poptGetOptArg(pc),
+                                                    CRED_SPECIFIED);
                        username_count++;
                        break;
                }
index 95fc7ffc2755a03fe598ac92a6249ce9d883dd7b..4509ad0caced03a806b95c2c2f0b2dab940aebfa 100755 (executable)
@@ -23,6 +23,6 @@ locktest="$samba4bindir/locktest"
 
 . `dirname $0`/../../../testprogs/blackbox/subunit.sh
 
-testit "locktest" $VALGRIND $locktest //$SERVER/test1 //$SERVER/test2 --num-ops=100  -W "$DOMAIN" -U"$DOMAIN\\$USERNAME%$PASSWORD" $@ || failed=`expr $failed + 1`
+testit "locktest" $VALGRIND $locktest //$SERVER/test1 //$SERVER/test2 --num-ops=100  -W "$DOMAIN" --user1="$DOMAIN\\$USERNAME%$PASSWORD" $@ || failed=`expr $failed + 1`
 
 exit $failed