r25291: add WINBIND-STRUCT-PRIV_PIPE_DIR test
authorStefan Metzmacher <metze@samba.org>
Fri, 21 Sep 2007 13:23:43 +0000 (13:23 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 20:07:07 +0000 (15:07 -0500)
this may needs
--option="torture:winbindd private pipe dir=/var/lib/samba/winbindd_privileged"

metze
(This used to be commit f83062d10955115a55928c51d289a219c1442632)

source4/torture/winbind/struct_based.c

index 51269b9d95f7441e54b363e4195af158e1470d76..69bb71ff49753c937aa08db3d0ebdf295826e284 100644 (file)
@@ -122,6 +122,35 @@ static bool torture_winbind_struct_info(struct torture_context *torture)
        return true;
 }
 
+static bool torture_winbind_struct_priv_pipe_dir(struct torture_context *torture)
+{
+       struct winbindd_response rep;
+       const char *default_dir;
+       const char *expected_dir;
+       const char *got_dir;
+
+       ZERO_STRUCT(rep);
+
+       torture_comment(torture, "Running WINBINDD_PRIV_PIPE_DIR (struct based)\n");
+
+       DO_STRUCT_REQ_REP(WINBINDD_PRIV_PIPE_DIR, NULL, &rep);
+
+       got_dir = (const char *)rep.extra_data.data;
+
+       torture_assert(torture, got_dir, "NULL WINBINDD_PRIV_PIPE_DIR\n");
+
+       default_dir = lock_path(torture, WINBINDD_PRIV_SOCKET_SUBDIR);
+       expected_dir = torture_setting_string(torture,
+                                             "winbindd private pipe dir",
+                                             default_dir);
+
+       torture_assert_str_equal(torture, got_dir, expected_dir,
+                                "WINBINDD_PRIV_PIPE_DIR doesn't match");
+
+       SAFE_FREE(rep.extra_data.data);
+       return true;
+}
+
 static bool torture_winbind_struct_netbios_name(struct torture_context *torture)
 {
        struct winbindd_request req;
@@ -421,6 +450,7 @@ struct torture_suite *torture_winbind_struct_init(void)
        torture_suite_add_simple_test(suite, "INTERFACE_VERSION", torture_winbind_struct_interface_version);
        torture_suite_add_simple_test(suite, "PING", torture_winbind_struct_ping);
        torture_suite_add_simple_test(suite, "INFO", torture_winbind_struct_info);
+       torture_suite_add_simple_test(suite, "PRIV_PIPE_DIR", torture_winbind_struct_priv_pipe_dir);
        torture_suite_add_simple_test(suite, "NETBIOS_NAME", torture_winbind_struct_netbios_name);
        torture_suite_add_simple_test(suite, "DOMAIN_NAME", torture_winbind_struct_domain_name);
        torture_suite_add_simple_test(suite, "LIST_TRUSTDOM", torture_winbind_struct_list_trustdom);