]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libcli/security: test_run_conditional_ace can set debug levels
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 16 Nov 2023 22:29:06 +0000 (11:29 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 27 Nov 2023 22:37:32 +0000 (22:37 +0000)
No -d, just `bin/test_run_conditional_ace 3`.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
libcli/security/tests/test_run_conditional_ace.c

index ebc3524fa4b1f3731558f1493b27a559b7b2e540..33d31459329176e0aaaae97a8ed69eaeedb94c09 100644 (file)
@@ -663,7 +663,18 @@ int main(_UNUSED_ int argc, _UNUSED_ const char **argv)
                cmocka_unit_test(test_composite_different_order_with_dupes),
                cmocka_unit_test(test_more_values_not_equal),
        };
-       if (!isatty(1)) {
+       if (isatty(1)) {
+               /*
+                * interactive testers can set debug level
+                * -- just give it a number.
+                */
+               int debug_level = DBGLVL_WARNING;
+               if (argc > 1) {
+                       debug_level = atoi(argv[1]);
+               }
+               debuglevel_set(debug_level);
+
+       } else {
                cmocka_set_message_output(CM_OUTPUT_SUBUNIT);
        }
        return cmocka_run_group_tests(tests, NULL, NULL);