s4: popt: Global replace of cmdline_credentials -> popt_get_cmdline_credentials().
[gd/samba-autobuild/.git] / source4 / torture / libsmbclient / libsmbclient.c
index 2f146c907ab6af1db6cc9601580b6b6500309ff8..f6cd8102c4d5eb4c5b07d49165c0db78eac1a7ac 100644 (file)
@@ -38,7 +38,8 @@ bool torture_libsmbclient_init_context(struct torture_context *tctx,
 
        /* yes, libsmbclient API frees the username when freeing the context, so
         * have to pass malloced data here */
-       smbc_setUser(ctx, strdup(cli_credentials_get_username(cmdline_credentials)));
+       smbc_setUser(ctx, strdup(cli_credentials_get_username(
+                       popt_get_cmdline_credentials())));
 
        *ctx_p = ctx;
 
@@ -194,27 +195,28 @@ bool torture_libsmbclient_options(struct torture_context *tctx)
        TEST_OPTION_INT(OptionUseKerberos, false);
        TEST_OPTION_INT(OptionFallbackAfterKerberos, false);
        TEST_OPTION_INT(OptionNoAutoAnonymousLogin, true);
+       TEST_OPTION_INT(OptionUseCCache, true);
 
        smbc_free_context(ctx, 1);
 
        return true;
 }
 
-NTSTATUS torture_libsmbclient_init(void)
+NTSTATUS torture_libsmbclient_init(TALLOC_CTX *ctx)
 {
        struct torture_suite *suite;
 
-       suite = torture_suite_create(talloc_autofree_context(), "LIBSMBCLIENT");
+       suite = torture_suite_create(ctx, "libsmbclient");
 
-       torture_suite_add_simple_test(suite, "VERSION", torture_libsmbclient_version);
-       torture_suite_add_simple_test(suite, "INITIALIZE", torture_libsmbclient_initialize);
-       torture_suite_add_simple_test(suite, "CONFIGURATION", torture_libsmbclient_configuration);
-       torture_suite_add_simple_test(suite, "OPTIONS", torture_libsmbclient_options);
-       torture_suite_add_simple_test(suite, "OPENDIR", torture_libsmbclient_opendir);
+       torture_suite_add_simple_test(suite, "version", torture_libsmbclient_version);
+       torture_suite_add_simple_test(suite, "initialize", torture_libsmbclient_initialize);
+       torture_suite_add_simple_test(suite, "configuration", torture_libsmbclient_configuration);
+       torture_suite_add_simple_test(suite, "options", torture_libsmbclient_options);
+       torture_suite_add_simple_test(suite, "opendir", torture_libsmbclient_opendir);
 
        suite->description = talloc_strdup(suite, "libsmbclient interface tests");
 
-       torture_register_suite(suite);
+       torture_register_suite(ctx, suite);
 
        return NT_STATUS_OK;
 }