Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
1 deleted
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source4/torture/local/dbspeed.c

    r414 r745  
    2222#include "includes.h"
    2323#include "system/filesys.h"
    24 #include "../tdb/include/tdb.h"
    25 #include "lib/ldb/include/ldb.h"
    26 #include "lib/ldb/include/ldb_errors.h"
    27 #include "lib/ldb_wrap.h"
    28 #include "lib/tdb_wrap.h"
     24#include <tdb.h>
     25#include <ldb.h>
     26#include <ldb_errors.h>
     27#include "ldb_wrap.h"
     28#include "lib/util/tdb_wrap.h"
    2929#include "torture/smbtorture.h"
    3030#include "param/param.h"
     
    3737        TDB_DATA key, data;
    3838        int ret;
     39
    3940        key.dptr = (uint8_t *)talloc_asprintf(tdbw, fmt1, i);
    4041        key.dsize = strlen((char *)key.dptr)+1;
     
    6768                             10000, 0, O_RDWR|O_CREAT|O_TRUNC, 0600);
    6869        if (!tdbw) {
    69                 unlink("test.tdb");
    70                 talloc_free(tmp_ctx);
    71                 torture_fail(torture, "Failed to open test.tdb");
     70                torture_result(torture, TORTURE_FAIL, "Failed to open test.tdb");
     71                goto failed;
    7272        }
    7373
     
    7878                                    "S-1-5-21-53173311-3623041448-2049097239-%u",
    7979                                    "UID %u", i)) {
    80                         torture_result(torture, TORTURE_FAIL, "Failed to add SID %d\n", i);
     80                        torture_result(torture, TORTURE_FAIL, "Failed to add SID %d!", i);
    8181                        goto failed;
    8282                }
     
    8484                                    "UID %u",
    8585                                    "S-1-5-21-53173311-3623041448-2049097239-%u", i)) {
    86                         torture_result(torture, TORTURE_FAIL, "Failed to add UID %d\n", i);
     86                        torture_result(torture, TORTURE_FAIL, "Failed to add UID %d!", i);
    8787                        goto failed;
    8888                }
     
    101101                talloc_free(key.dptr);
    102102                if (data.dptr == NULL) {
    103                         torture_result(torture, TORTURE_FAIL, "Failed to fetch SID %d\n", i);
     103                        torture_result(torture, TORTURE_FAIL, "Failed to find SID %d!", i);
    104104                        goto failed;
    105105                }
     
    110110                talloc_free(key.dptr);
    111111                if (data.dptr == NULL) {
    112                         torture_result(torture, TORTURE_FAIL, "Failed to fetch UID %d\n", i);
     112                        torture_result(torture, TORTURE_FAIL, "Failed to find UID %d!", i);
    113113                        goto failed;
    114114                }
     
    119119        torture_comment(torture, "tdb speed %.2f ops/sec\n", tdb_speed);
    120120       
    121 
     121        talloc_free(tmp_ctx);
    122122        unlink("test.tdb");
    123         talloc_free(tmp_ctx);
    124123        return true;
    125124
    126125failed:
     126        talloc_free(tmp_ctx);
    127127        unlink("test.tdb");
    128         talloc_free(tmp_ctx);
    129128        return false;
    130129}
     
    143142        msg->dn = ldb_dn_new_fmt(msg, ldb, "SID=S-1-5-21-53173311-3623041448-2049097239-%u", rid);
    144143        if (msg->dn == NULL) {
     144                talloc_free(msg);
    145145                return false;
    146146        }
    147147
    148         if (ldb_msg_add_fmt(msg, "UID", "%u", rid) != 0) {
     148        ret = ldb_msg_add_fmt(msg, "UID", "%u", rid);
     149        if (ret != LDB_SUCCESS) {
     150                talloc_free(msg);
    149151                return false;
    150152        }
     
    177179        torture_comment(torture, "Testing ldb speed for sidmap\n");
    178180
    179         ldb = ldb_wrap_connect(tmp_ctx, torture->ev, torture->lp_ctx, "tdb://test.ldb", 
    180                                 NULL, NULL, LDB_FLG_NOSYNC, NULL);
     181        ldb = ldb_wrap_connect(tmp_ctx, torture->ev, torture->lp_ctx, "tdb://test.ldb",
     182                                NULL, NULL, LDB_FLG_NOSYNC);
    181183        if (!ldb) {
    182                 unlink("./test.ldb");
    183                 talloc_free(tmp_ctx);
    184                 torture_fail(torture, "Failed to open test.ldb");
     184                torture_result(torture, TORTURE_FAIL, "Failed to open test.ldb");
     185                goto failed;
    185186        }
    186187
    187188        /* add an index */
    188189        ldif = ldb_ldif_read_string(ldb, &init_ldif);
    189         if (ldif == NULL) goto failed;
    190         if (ldb_add(ldb, ldif->msg) != LDB_SUCCESS) goto failed;
     190        if (ldif == NULL) {
     191                torture_result(torture, TORTURE_FAIL, "Didn't get LDIF data!");
     192                goto failed;
     193        }
     194        if (ldb_add(ldb, ldif->msg) != LDB_SUCCESS) {
     195                torture_result(torture, TORTURE_FAIL, "Couldn't apply LDIF data!");
     196                talloc_free(ldif);
     197                goto failed;
     198        }
    191199        talloc_free(ldif);
    192200
     
    195203        for (i=0;i<torture_entries;i++) {
    196204                if (!ldb_add_record(ldb, i)) {
    197                         torture_result(torture, TORTURE_FAIL, "Failed to add SID %d\n", i);
    198                         goto failed;
    199                 }
    200         }
    201 
    202         if (talloc_total_blocks(torture) > 100) {
    203                 torture_result(torture, TORTURE_FAIL, "memory leak in ldb add\n");
     205                        torture_result(torture, TORTURE_FAIL, "Failed to add SID %d", i);
     206                        goto failed;
     207                }
     208        }
     209
     210        if (talloc_total_blocks(tmp_ctx) > 100) {
     211                torture_result(torture, TORTURE_FAIL, "memory leak in ldb add");
    204212                goto failed;
    205213        }
     
    216224                dn = ldb_dn_new_fmt(tmp_ctx, ldb, "SID=S-1-5-21-53173311-3623041448-2049097239-%u", i);
    217225                if (ldb_search(ldb, tmp_ctx, &res, dn, LDB_SCOPE_BASE, NULL, NULL) != LDB_SUCCESS || res->count != 1) {
    218                         torture_fail(torture, talloc_asprintf(torture, "Failed to find SID %d", i));
     226                        torture_result(torture, TORTURE_FAIL, "Failed to find SID %d!", i);
     227                        goto failed;
    219228                }
    220229                talloc_free(res);
    221230                talloc_free(dn);
    222231                if (ldb_search(ldb, tmp_ctx, &res, NULL, LDB_SCOPE_SUBTREE, NULL, "(UID=%u)", i) != LDB_SUCCESS || res->count != 1) {
    223                         torture_fail(torture, talloc_asprintf(torture, "Failed to find UID %d", i));
     232                        torture_result(torture, TORTURE_FAIL, "Failed to find UID %d!", i);
     233                        goto failed;
    224234                }
    225235                talloc_free(res);
    226236        }
    227237
    228         if (talloc_total_blocks(torture) > 100) {
    229                 unlink("./test.ldb");
    230                 talloc_free(tmp_ctx);
    231                 torture_fail(torture, "memory leak in ldb search");
     238        if (talloc_total_blocks(tmp_ctx) > 100) {
     239                torture_result(torture, TORTURE_FAIL, "memory leak in ldb search");
     240                goto failed;
    232241        }
    233242
     
    237246        torture_comment(torture, "ldb/tdb speed ratio is %.2f%%\n", (100*ldb_speed/tdb_speed));
    238247       
    239 
     248        talloc_free(tmp_ctx);
    240249        unlink("./test.ldb");
    241         talloc_free(tmp_ctx);
    242250        return true;
    243251
    244252failed:
     253        talloc_free(tmp_ctx);
    245254        unlink("./test.ldb");
    246         talloc_free(tmp_ctx);
    247255        return false;
    248256}
     
    250258struct torture_suite *torture_local_dbspeed(TALLOC_CTX *mem_ctx)
    251259{
    252         struct torture_suite *s = torture_suite_create(mem_ctx, "DBSPEED");
     260        struct torture_suite *s = torture_suite_create(mem_ctx, "dbspeed");
    253261        torture_suite_add_simple_tcase_const(s, "tdb_speed", test_tdb_speed,
    254262                        NULL);
  • trunk/server/source4/torture/local/local.c

    r414 r745  
    2121#include "torture/smbtorture.h"
    2222#include "torture/local/proto.h"
    23 #include "torture/ndr/ndr.h"
    2423#include "torture/ndr/proto.h"
    2524#include "torture/auth/proto.h"
    2625#include "../lib/crypto/test_proto.h"
    2726#include "lib/registry/tests/proto.h"
     27#include "lib/replace/replace-test.h"
    2828
    2929/* ignore me */ static struct torture_suite *
     
    4040        torture_local_util_time,
    4141        torture_local_util_data_blob,
     42        torture_local_util_asn1,
     43        torture_local_util_anonymous_shared,
    4244        torture_local_idtree,
     45        torture_local_dlinklist,
    4346        torture_local_genrand,
    4447        torture_local_iconv,
    4548        torture_local_socket,
     49#ifdef SOCKET_WRAPPER
    4650        torture_local_socket_wrapper,
     51#endif
     52#ifdef NSS_WRAPPER
    4753        torture_local_nss_wrapper,
     54#endif
    4855        torture_pac,
    4956        torture_local_resolve,
     
    6067        torture_local_credentials,
    6168        torture_ldb,
     69        torture_dsdb_dn,
     70        torture_dsdb_syntax,
    6271        torture_registry,
    6372        NULL
     
    6877        int i;
    6978        struct torture_suite *suite = torture_suite_create(
    70                 talloc_autofree_context(),
    71                 "LOCAL");
     79                talloc_autofree_context(), "local");
    7280       
    73         torture_suite_add_simple_test(suite, "TALLOC", torture_local_talloc);
    74         torture_suite_add_simple_test(suite, "REPLACE", torture_local_replace);
     81        torture_suite_add_simple_test(suite, "talloc", torture_local_talloc);
     82        torture_suite_add_simple_test(suite, "replace", torture_local_replace);
    7583       
    7684        torture_suite_add_simple_test(suite,
    77                                       "CRYPTO-MD4", torture_local_crypto_md4);
    78         torture_suite_add_simple_test(suite, "CRYPTO-MD5",
     85                                      "crypto.md4", torture_local_crypto_md4);
     86        torture_suite_add_simple_test(suite, "crypto.md5",
    7987                                      torture_local_crypto_md5);
    80         torture_suite_add_simple_test(suite, "CRYPTO-HMACMD5",
     88        torture_suite_add_simple_test(suite, "crypto.hmacmd5",
    8189                                      torture_local_crypto_hmacmd5);
    8290
  • trunk/server/source4/torture/local/torture.c

    r414 r745  
    2121
    2222#include "includes.h"
    23 #include "torture/torture.h"
    2423#include "system/wait.h"
    25 #include "lib/events/events.h"
    2624#include "libcli/raw/libcliraw.h"
    2725#include "torture/util.h"
     
    7775struct torture_suite *torture_local_torture(TALLOC_CTX *mem_ctx)
    7876{
    79         struct torture_suite *suite = torture_suite_create(mem_ctx,
    80                                                                                                            "TORTURE");
     77        struct torture_suite *suite = torture_suite_create(mem_ctx, "torture");
    8178
    8279        torture_suite_add_simple_test(suite, "tempdir", test_tempdir);
Note: See TracChangeset for help on using the changeset viewer.