build: commit all the waf build files in the tree
[nivanova/samba-autobuild/.git] / source4 / torture / winbind / struct_based.c
index 2f8242883956c788be655f5d9c7d50d4b2f34278..99b08283197da105c704d3c7e0ba15d9615ee3c4 100644 (file)
@@ -122,8 +122,9 @@ static bool torture_winbind_struct_info(struct torture_context *torture)
        DO_STRUCT_REQ_REP(WINBINDD_INFO, NULL, &rep);
 
        separator = torture_setting_string(torture,
-                                          "winbindd separator",
+                                          "winbindd_separator",
                                           lp_winbind_separator(torture->lp_ctx));
+
        torture_assert_int_equal(torture,
                                 rep.data.info.winbind_separator,
                                 *separator,
@@ -166,10 +167,10 @@ static bool torture_winbind_struct_netbios_name(struct torture_context *torture)
        DO_STRUCT_REQ_REP(WINBINDD_NETBIOS_NAME, NULL, &rep);
 
        expected = torture_setting_string(torture,
-                                         "winbindd netbios name",
+                                         "winbindd_netbios_name",
                                          lp_netbios_name(torture->lp_ctx));
        expected = strupper_talloc(torture, expected);
-       
+
        torture_assert_str_equal(torture,
                                 rep.data.netbios_name, expected,
                                 "winbindd's netbios name doesn't match");
@@ -199,7 +200,7 @@ static bool torture_winbind_struct_domain_name(struct torture_context *torture)
        torture_comment(torture, "Running WINBINDD_DOMAIN_NAME (struct based)\n");
 
        expected = torture_setting_string(torture,
-                                         "winbindd netbios domain",
+                                         "winbindd_netbios_domain",
                                          lp_workgroup(torture->lp_ctx));
 
        get_winbind_domain(torture, &domain);
@@ -474,7 +475,7 @@ static bool torture_winbind_struct_getdcname(struct torture_context *torture)
        bool ok;
        bool strict = torture_setting_bool(torture, "strict mode", false);
        const char *domain_name = torture_setting_string(torture,
-                                       "winbindd netbios domain",
+                                       "winbindd_netbios_domain",
                                        lp_workgroup(torture->lp_ctx));
        struct torture_trust_domain *listd = NULL;
        uint32_t i, count = 0;
@@ -635,7 +636,8 @@ static bool torture_winbind_struct_list_users(struct torture_context *torture)
        return true;
 }
 
-static bool get_group_list(struct torture_context *torture, int *num_entries,
+static bool get_group_list(struct torture_context *torture,
+                          unsigned int *num_entries,
                           char ***groups)
 {
        struct winbindd_request req;
@@ -848,12 +850,23 @@ static bool torture_winbind_struct_getpwent(struct torture_context *torture)
        ZERO_STRUCT(req);
        ZERO_STRUCT(rep);
        req.data.num_entries = 1;
-       DO_STRUCT_REQ_REP(WINBINDD_GETPWENT, &req, &rep);
+       if (torture_setting_bool(torture, "samba3", false)) {
+               bool __noop = false;
+               DO_STRUCT_REQ_REP_EXT(WINBINDD_GETPWENT, &req, &rep,
+                                     NSS_STATUS_SUCCESS, false, __noop=true,
+                                     NULL);
+       } else {
+               DO_STRUCT_REQ_REP(WINBINDD_GETPWENT, &req, &rep);
+       }
        pwent = (struct winbindd_pw *)rep.extra_data.data;
-       torture_assert(torture, (pwent != NULL), "NULL pwent");
-       torture_comment(torture, "name: %s, uid: %d, gid: %d, shell: %s\n",
-                       pwent->pw_name, pwent->pw_uid, pwent->pw_gid,
-                       pwent->pw_shell);
+       if (!torture_setting_bool(torture, "samba3", false)) {
+               torture_assert(torture, (pwent != NULL), "NULL pwent");
+       }
+       if (pwent) {
+               torture_comment(torture, "name: %s, uid: %d, gid: %d, shell: %s\n",
+                               pwent->pw_name, pwent->pw_uid, pwent->pw_gid,
+                               pwent->pw_shell);
+       }
 
        return true;
 }
@@ -915,7 +928,7 @@ static bool lookup_name_sid_list(struct torture_context *torture, char **list)
                char *sid;
                char *name;
                const char *domain_name = torture_setting_string(torture,
-                                               "winbindd netbios domain",
+                                               "winbindd_netbios_domain",
                                                lp_workgroup(torture->lp_ctx));
 
                ZERO_STRUCT(req);