~ubuntu-branches/ubuntu/vivid/samba/vivid

« back to all changes in this revision

Viewing changes to source3/torture/msgtest.c

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-12-21 13:18:04 UTC
  • mfrom: (0.39.21 sid)
  • Revision ID: package-import@ubuntu.com-20111221131804-xtlr39wx6njehxxr
Tags: 2:3.6.1-3ubuntu1
* Merge from Debian testing.  Remaining changes:
  + debian/patches/VERSION.patch:
    - set SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/patches/error-trans.fix-276472:
    - Add the translation of Unix Error code -ENOTSUP to NT Error Code
    - NT_STATUS_NOT_SUPPORTED to prevent the Permission denied error.
  + debian/smb.conf:
    - add "(Samba, Ubuntu)" to server string.
    - comment out the default [homes] share, and add a comment about
      "valid users = %S" to show users how to restrict access to
      \\server\username to only username.
    - Set 'usershare allow guests', so that usershare admins are 
      allowed to create public shares in addition to authenticated
      ones.
    - add map to guest = Bad user, maps bad username to guest access.
  + debian/samba-common.config:
    - Do not change priority to high if dhclient3 is installed.
    - Use priority medium instead of high for the workgroup question.
  + debian/control:
    - Don't build against or suggest ctdb.
    - Add dependency on samba-common-bin to samba.
  + Add ufw integration:
    - Created debian/samba.ufw.profile
    - debian/rules, debian/samba.dirs, debian/samba.files: install
      profile
    - debian/control: have samba suggest ufw
  + Add apport hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba.dirs, debian/samba-common-bin.files: install
  + Switch to upstart:
    - Add debian/samba.{nmbd,smbd}.upstart.
  + debian/samba.logrotate, debian/samba-common.dhcp, debian/samba.if-up:
    - Make them upstart compatible
  + debian/samba.postinst: 
    - Avoid scary pdbedit warnings on first import.
  + debian/samba-common.postinst: Add more informative error message for
    the case where smb.conf was manually deleted
  + debian/patches/fix-debuglevel-name-conflict.patch: don't use 'debug_level'
    as a global variable name in an NSS module 
  + Dropped:
    - debian/patches/error-trans.fix-276472
    - debian/patches/fix-debuglevel-name-conflict.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* 
2
2
   Unix SMB/CIFS implementation.
3
3
   Copyright (C) Andrew Tridgell 2000
4
 
   
 
4
 
5
5
   This program is free software; you can redistribute it and/or modify
6
6
   it under the terms of the GNU General Public License as published by
7
7
   the Free Software Foundation; either version 3 of the License, or
8
8
   (at your option) any later version.
9
 
   
 
9
 
10
10
   This program is distributed in the hope that it will be useful,
11
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
13
   GNU General Public License for more details.
14
 
   
 
14
 
15
15
   You should have received a copy of the GNU General Public License
16
16
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
17
*/
21
21
 */
22
22
 
23
23
#include "includes.h"
 
24
#include "messages.h"
24
25
 
25
26
static int pong_count;
26
27
 
48
49
 
49
50
        load_case_tables();
50
51
 
51
 
        setup_logging(argv[0],True);
52
 
        
 
52
        setup_logging(argv[0], DEBUG_STDOUT);
 
53
 
53
54
        lp_load(get_dyn_CONFIGFILE(),False,False,False,True);
54
55
 
55
56
        if (!(evt_ctx = tevent_context_init(NULL)) ||
56
 
            !(msg_ctx = messaging_init(NULL, server_id_self(), evt_ctx))) {
 
57
            !(msg_ctx = messaging_init(NULL, procid_self(), evt_ctx))) {
57
58
                fprintf(stderr, "could not init messaging context\n");
58
59
                exit(1);
59
60
        }
60
 
        
 
61
 
61
62
        if (argc != 3) {
62
63
                fprintf(stderr, "%s: Usage - %s pid count\n", argv[0],
63
64
                        argv[0]);
87
88
        safe_strcpy(buf, "1234567890", sizeof(buf)-1);
88
89
 
89
90
        for (i=0;i<n;i++) {
90
 
                messaging_send(msg_ctx, pid_to_procid(getpid()), MSG_PING,
 
91
                messaging_send(msg_ctx, messaging_server_id(msg_ctx), MSG_PING,
91
92
                               &data_blob_null);
92
 
                messaging_send_buf(msg_ctx, pid_to_procid(getpid()), MSG_PING,
93
 
                                   (uint8 *)buf, 11);
 
93
                messaging_send_buf(msg_ctx, messaging_server_id(msg_ctx),
 
94
                                   MSG_PING,(uint8 *)buf, 11);
94
95
        }
95
96
 
96
97
        for (i=0;i<n;i++) {
132
133
                                }
133
134
                        }
134
135
                }
135
 
                
 
136
 
136
137
                printf("waiting for %d remaining replies (done %d)\n", 
137
138
                       (int)(ping_count - pong_count), pong_count);
138
139
                while (timeval_elapsed(&tv) < 30 && pong_count < ping_count) {
141
142
                                break;
142
143
                        }
143
144
                }
144
 
                
 
145
 
145
146
                if (ping_count != pong_count) {
146
147
                        fprintf(stderr, "ping test failed! received %d, sent "
147
148
                                "%d\n", pong_count, (int)ping_count);
148
149
                }
149
 
                
 
150
 
150
151
                printf("ping rate of %.0f messages/sec\n", 
151
152
                       (ping_count+pong_count)/timeval_elapsed(&tv));
152
153
        }