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:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source4/torture/gentest.c

    r414 r745  
    4949        int analyze_always;
    5050        int analyze_continuous;
    51         uint_t max_open_handles;
    52         uint_t seed;
    53         uint_t numops;
     51        unsigned int max_open_handles;
     52        unsigned int seed;
     53        unsigned int numops;
    5454        int use_oplocks;
    5555        char **ignore_patterns;
     
    6868static struct {
    6969        bool active;
    70         uint_t instance;
     70        unsigned int instance;
    7171        struct smb2_handle smb2_handle[NSERVERS]; /* SMB2 */
    7272        uint16_t smb_handle[NSERVERS];            /* SMB */
    7373        const char *name;
    7474} *open_handles;
    75 static uint_t num_open_handles;
     75static unsigned int num_open_handles;
    7676
    7777/* state information for the servers. We open NINSTANCES connections to
     
    8787/* the seeds and flags for each operation */
    8888static struct {
    89         uint_t seed;
     89        unsigned int seed;
    9090        bool disabled;
    9191} *op_parms;
     
    112112static struct {
    113113        const char *name;
    114         uint_t seed;
     114        unsigned int seed;
    115115        NTSTATUS status;
    116         uint_t opnum;
     116        unsigned int opnum;
    117117        TALLOC_CTX *mem_ctx;
    118118        const char *mismatch;
     
    216216                        struct smbcli_options smb_options;
    217217                        struct smbcli_session_options smb_session_options;
    218                         lp_smbcli_options(lp_ctx, &smb_options);
    219                         lp_smbcli_session_options(lp_ctx, &smb_session_options);
     218                        lpcfg_smbcli_options(lp_ctx, &smb_options);
     219                        lpcfg_smbcli_session_options(lp_ctx, &smb_session_options);
    220220
    221221                        printf("Connecting to \\\\%s\\%s as %s - instance %d\n",
     
    228228                        if (options.smb2) {
    229229                                status = smb2_connect(NULL, servers[i].server_name,
    230                                                                           lp_smb_ports(lp_ctx),
     230                                                                          lpcfg_smb_ports(lp_ctx),
    231231                                                      servers[i].share_name,
    232                                                       lp_resolve_context(lp_ctx),
     232                                                      lpcfg_resolve_context(lp_ctx),
    233233                                                      servers[i].credentials,
    234234                                                      &servers[i].smb2_tree[j],
    235235                                                      ev, &smb_options,
    236                                                           lp_socket_options(lp_ctx),
    237                                                           lp_gensec_settings(lp_ctx, lp_ctx)
     236                                                          lpcfg_socket_options(lp_ctx),
     237                                                          lpcfg_gensec_settings(lp_ctx, lp_ctx)
    238238                                                          );
    239239                        } else {
     
    241241                                                                     &servers[i].smb_tree[j],
    242242                                                                     servers[i].server_name,
    243                                                                      lp_smb_ports(lp_ctx),
     243                                                                     lpcfg_smb_ports(lp_ctx),
    244244                                                                     servers[i].share_name, "A:",
    245                                                                          lp_socket_options(lp_ctx),
     245                                                                         lpcfg_socket_options(lp_ctx),
    246246                                                                     servers[i].credentials,
    247                                                                      lp_resolve_context(lp_ctx), ev,
     247                                                                     lpcfg_resolve_context(lp_ctx), ev,
    248248                                                                     &smb_options,
    249249                                                                     &smb_session_options,
    250                                                                          lp_iconv_convenience(lp_ctx),
    251                                                                          lp_gensec_settings(lp_ctx, lp_ctx));
     250                                                                         lpcfg_gensec_settings(lp_ctx, lp_ctx));
    252251                        }
    253252                        if (!NT_STATUS_IS_OK(status)) {
     
    278277  work out the time skew between the servers - be conservative
    279278*/
    280 static uint_t time_skew(void)
    281 {
    282         uint_t ret;
     279static unsigned int time_skew(void)
     280{
     281        unsigned int ret;
    283282        if (options.smb2) {
    284283                ret = labs(servers[0].smb2_tree[0]->session->transport->negotiate.system_time -
     
    300299  turn a server handle into a local handle
    301300*/
    302 static uint_t fnum_to_handle_smb2(int server, int instance, struct smb2_handle server_handle)
    303 {
    304         uint_t i;
     301static unsigned int fnum_to_handle_smb2(int server, int instance, struct smb2_handle server_handle)
     302{
     303        unsigned int i;
    305304        for (i=0;i<options.max_open_handles;i++) {
    306305                if (!open_handles[i].active ||
     
    318317  turn a server handle into a local handle
    319318*/
    320 static uint_t fnum_to_handle_smb(int server, int instance, uint16_t server_handle)
    321 {
    322         uint_t i;
     319static unsigned int fnum_to_handle_smb(int server, int instance, uint16_t server_handle)
     320{
     321        unsigned int i;
    323322        for (i=0;i<options.max_open_handles;i++) {
    324323                if (!open_handles[i].active ||
     
    451450  return true with 'chance' probability as a percentage
    452451*/
    453 static bool gen_chance(uint_t chance)
     452static bool gen_chance(unsigned int chance)
    454453{
    455454        return ((random() % 100) <= chance);
     
    512511static int gen_int_range(uint64_t min, uint64_t max)
    513512{
    514         uint_t r = random();
     513        unsigned int r = random();
    515514        return min + (r % (1+max-min));
    516515}
     
    641640  generate a bitmask
    642641*/
    643 static uint32_t gen_bits_mask(uint_t mask)
    644 {
    645         uint_t ret = random();
     642static uint32_t gen_bits_mask(unsigned int mask)
     643{
     644        unsigned int ret = random();
    646645        return ret & mask;
    647646}
     
    870869  generate a file allocation size
    871870*/
    872 static uint_t gen_alloc_size(void)
    873 {
    874         uint_t ret;
     871static unsigned int gen_alloc_size(void)
     872{
     873        unsigned int ret;
    875874
    876875        if (gen_chance(30)) return 0;
     
    12131212        int i, j;
    12141213
    1215         msleep(20);
     1214        smb_msleep(20);
    12161215
    12171216        for (j=0;j<NINSTANCES;j++) {
     
    18201819        parm[0].ntcreatex.level = RAW_OPEN_NTCREATEX;
    18211820        parm[0].ntcreatex.in.flags = gen_ntcreatex_flags();
    1822         parm[0].ntcreatex.in.root_fid = gen_root_fid(instance);
     1821        parm[0].ntcreatex.in.root_fid.fnum = gen_root_fid(instance);
    18231822        parm[0].ntcreatex.in.access_mask = gen_access_mask();
    18241823        parm[0].ntcreatex.in.alloc_size = gen_alloc_size();
     
    18381837       
    18391838        GEN_COPY_PARM;
    1840         if (parm[0].ntcreatex.in.root_fid != 0) {
    1841                 GEN_SET_FNUM_SMB(ntcreatex.in.root_fid);
     1839        if (parm[0].ntcreatex.in.root_fid.fnum != 0) {
     1840                GEN_SET_FNUM_SMB(ntcreatex.in.root_fid.fnum);
    18421841        }
    18431842        GEN_CALL_SMB(smb_raw_open(tree, current_op.mem_ctx, &parm[i]));
     
    26622661        parm[0].in.file.handle.data[0] = gen_fnum(instance);
    26632662        parm[0].in.lock_count = gen_lock_count();
    2664         parm[0].in.reserved = gen_reserved32();
     2663        parm[0].in.lock_sequence = gen_reserved32();
    26652664       
    26662665        parm[0].in.locks = talloc_array(current_op.mem_ctx,
     
    31873186                switch (opt) {
    31883187                case OPT_UNCLIST:
    3189                         lp_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc));
     3188                        lpcfg_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc));
    31903189                        break;
    31913190                case 'U':
Note: See TracChangeset for help on using the changeset viewer.