diff options
author | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:28:53 -0500 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:28:53 -0500 |
commit | 65229e966119f0b1537d258854a54105f32ae399 (patch) | |
tree | c6be94324703d914228290a8354021c2691f3ebe /source/torture | |
parent | 95e77b14b5440a9ced8fdf6dc803b90c9518b8e0 (diff) | |
download | samba-65229e966119f0b1537d258854a54105f32ae399.tar.gz |
[GLUE] Rsync SAMBA_3_0 SVN r25598 in order to create the v3-0-test branch.samba-misc-tags/initial-v3-0-test
Diffstat (limited to 'source/torture')
-rw-r--r-- | source/torture/cmd_vfs.c | 2 | ||||
-rw-r--r-- | source/torture/locktest.c | 14 | ||||
-rw-r--r-- | source/torture/locktest2.c | 15 | ||||
-rw-r--r-- | source/torture/mangle_test.c | 4 | ||||
-rw-r--r-- | source/torture/msgtest.c | 51 | ||||
-rw-r--r-- | source/torture/torture.c | 6 |
6 files changed, 40 insertions, 52 deletions
diff --git a/source/torture/cmd_vfs.c b/source/torture/cmd_vfs.c index 1005d14e797..455ca1c82c7 100644 --- a/source/torture/cmd_vfs.c +++ b/source/torture/cmd_vfs.c @@ -88,7 +88,7 @@ static NTSTATUS cmd_show_data(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int ar printf("show_data: error=-1 (not enough data in buffer)\n"); return NT_STATUS_UNSUCCESSFUL; } - dump_data(0, (uint8 *)(vfs->data) + offset, len); + dump_data(0, (char *)(vfs->data) + offset, len); return NT_STATUS_OK; } diff --git a/source/torture/locktest.c b/source/torture/locktest.c index 8d3234e367f..ff14b803a73 100644 --- a/source/torture/locktest.c +++ b/source/torture/locktest.c @@ -116,13 +116,13 @@ static struct record preset[] = { static struct record *recorded; -static void print_brl(struct file_id id, - struct server_id pid, +static void print_brl(SMB_DEV_T dev, + SMB_INO_T ino, + struct process_id pid, enum brl_type lock_type, enum brl_flavour lock_flav, br_off start, - br_off size, - void *private_data) + br_off size) { #if NASTY_POSIX_LOCK_HACK { @@ -138,8 +138,8 @@ static void print_brl(struct file_id id, } #endif - printf("%s %s %s %.0f:%.0f(%.0f)\n", - procid_str_static(&pid), file_id_static_string(&id), + printf("%s %05x:%05x %s %.0f:%.0f(%.0f)\n", + procid_str_static(&pid), (int)dev, (int)ino, lock_type==READ_LOCK?"R":"W", (double)start, (double)start+size-1,(double)size); @@ -148,7 +148,7 @@ static void print_brl(struct file_id id, static void show_locks(void) { - brl_forall(print_brl, NULL); + brl_forall(print_brl); /* system("cat /proc/locks"); */ } diff --git a/source/torture/locktest2.c b/source/torture/locktest2.c index 0da7e9cf00c..0a897fb2065 100644 --- a/source/torture/locktest2.c +++ b/source/torture/locktest2.c @@ -136,14 +136,13 @@ static BOOL try_unlock(struct cli_state *c, int fstype, return False; } -static void print_brl(struct file_id id, struct server_id pid, +static void print_brl(SMB_DEV_T dev, SMB_INO_T ino, struct process_id pid, enum brl_type lock_type, enum brl_flavour lock_flav, - br_off start, br_off size, - void *private_data) + br_off start, br_off size) { - printf("%6d %s %s %.0f:%.0f(%.0f)\n", - (int)procid_to_pid(&pid), file_id_static_string(&id), + printf("%6d %05x:%05x %s %.0f:%.0f(%.0f)\n", + (int)procid_to_pid(&pid), (int)dev, (int)ino, lock_type==READ_LOCK?"R":"W", (double)start, (double)start+size-1,(double)size); @@ -260,7 +259,7 @@ static BOOL test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS], op==READ_LOCK?"READ_LOCK":"WRITE_LOCK", ret[0], ret[1]); } - if (showall) brl_forall(print_brl, NULL); + if (showall) brl_forall(print_brl); if (ret[0] != ret[1]) return False; } else if (r2 < LOCK_PCT+UNLOCK_PCT) { /* unset a lock */ @@ -275,7 +274,7 @@ static BOOL test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS], start, start+len-1, len, ret[0], ret[1]); } - if (showall) brl_forall(print_brl, NULL); + if (showall) brl_forall(print_brl); if (!hide_unlock_fails && ret[0] != ret[1]) return False; } else { /* reopen the file */ @@ -291,7 +290,7 @@ static BOOL test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS], if (showall) { printf("reopen conn=%u fstype=%u f=%u\n", conn, fstype, f); - brl_forall(print_brl, NULL); + brl_forall(print_brl); } } return True; diff --git a/source/torture/mangle_test.c b/source/torture/mangle_test.c index 1330477cc57..1c9fba355a6 100644 --- a/source/torture/mangle_test.c +++ b/source/torture/mangle_test.c @@ -87,7 +87,7 @@ static BOOL test_one(struct cli_state *cli, const char *name) data = tdb_fetch_bystring(tdb, shortname); if (data.dptr) { /* maybe its a duplicate long name? */ - if (!strequal(name, (const char *)data.dptr)) { + if (!strequal(name, data.dptr)) { /* we have a collision */ collisions++; printf("Collision between %s and %s -> %s " @@ -98,7 +98,7 @@ static BOOL test_one(struct cli_state *cli, const char *name) } else { TDB_DATA namedata; /* store it for later */ - namedata.dptr = CONST_DISCARD(uint8 *, name); + namedata.dptr = CONST_DISCARD(char *, name); namedata.dsize = strlen(name)+1; tdb_store_bystring(tdb, shortname, namedata, TDB_REPLACE); } diff --git a/source/torture/msgtest.c b/source/torture/msgtest.c index d8c280e69bf..5a066bc599e 100644 --- a/source/torture/msgtest.c +++ b/source/torture/msgtest.c @@ -29,19 +29,14 @@ static int pong_count; /**************************************************************************** a useful function for testing the message system ****************************************************************************/ -static void pong_message(struct messaging_context *msg_ctx, - void *private_data, - uint32_t msg_type, - struct server_id pid, - DATA_BLOB *data) +static void pong_message(int msg_type, struct process_id src, + void *buf, size_t len, void *private_data) { pong_count++; } int main(int argc, char *argv[]) { - struct event_context *evt_ctx; - struct messaging_context *msg_ctx; pid_t pid; int i, n; char buf[12]; @@ -52,12 +47,8 @@ static void pong_message(struct messaging_context *msg_ctx, lp_load(dyn_CONFIGFILE,False,False,False,True); - if (!(evt_ctx = event_context_init(NULL)) || - !(msg_ctx = messaging_init(NULL, server_id_self(), evt_ctx))) { - fprintf(stderr, "could not init messaging context\n"); - exit(1); - } - + message_init(); + if (argc != 3) { fprintf(stderr, "%s: Usage - %s pid count\n", argv[0], argv[0]); @@ -67,15 +58,14 @@ static void pong_message(struct messaging_context *msg_ctx, pid = atoi(argv[1]); n = atoi(argv[2]); - messaging_register(msg_ctx, NULL, MSG_PONG, pong_message); + message_register(MSG_PONG, pong_message, NULL); for (i=0;i<n;i++) { - messaging_send(msg_ctx, pid_to_procid(pid), MSG_PING, - &data_blob_null); + message_send_pid(pid_to_procid(pid), MSG_PING, NULL, 0, True); } while (pong_count < i) { - message_dispatch(msg_ctx); + message_dispatch(); smb_msleep(1); } @@ -85,14 +75,14 @@ static void pong_message(struct messaging_context *msg_ctx, safe_strcpy(buf, "1234567890", sizeof(buf)-1); for (i=0;i<n;i++) { - messaging_send(msg_ctx, pid_to_procid(getpid()), MSG_PING, - &data_blob_null); - messaging_send_buf(msg_ctx, pid_to_procid(getpid()), MSG_PING, - (uint8 *)buf, 11); + message_send_pid(pid_to_procid(getpid()), MSG_PING, + NULL, 0, False); + message_send_pid(pid_to_procid(getpid()), MSG_PING, + buf, 11, False); } for (i=0;i<n;i++) { - message_dispatch(msg_ctx); + message_dispatch(); smb_msleep(1); } @@ -111,25 +101,24 @@ static void pong_message(struct messaging_context *msg_ctx, printf("Sending pings for %d seconds\n", (int)timelimit); while (timeval_elapsed(&tv) < timelimit) { - if(NT_STATUS_IS_OK(messaging_send_buf( - msg_ctx, pid_to_procid(pid), - MSG_PING, - (uint8 *)buf, 11))) + if(NT_STATUS_IS_OK(message_send_pid(pid_to_procid(pid), + MSG_PING, + buf, 11, False))) ping_count++; - if(NT_STATUS_IS_OK(messaging_send( - msg_ctx, pid_to_procid(pid), - MSG_PING, &data_blob_null))) + if(NT_STATUS_IS_OK(message_send_pid(pid_to_procid(pid), + MSG_PING, + NULL, 0, False))) ping_count++; while (ping_count > pong_count + 20) { - message_dispatch(msg_ctx); + message_dispatch(); } } printf("waiting for %d remaining replies (done %d)\n", (int)(ping_count - pong_count), pong_count); while (timeval_elapsed(&tv) < 30 && pong_count < ping_count) { - message_dispatch(msg_ctx); + message_dispatch(); } if (ping_count != pong_count) { diff --git a/source/torture/torture.c b/source/torture/torture.c index 92599e27652..8ca2eb58981 100644 --- a/source/torture/torture.c +++ b/source/torture/torture.c @@ -2619,7 +2619,7 @@ static BOOL new_trans(struct cli_state *pcli, int fnum, int level) correct = False; } else { printf("qfileinfo: level %d, len = %u\n", level, len); - dump_data(0, (uint8 *)buf, len); + dump_data(0, buf, len); printf("\n"); } SAFE_FREE(buf); @@ -4541,7 +4541,7 @@ static BOOL run_eatest(int dummy) for (i = 0; i < num_eas; i++) { printf("%d: ea_name = %s. Val = ", i, ea_list[i].name); - dump_data(0, ea_list[i].value.data, + dump_data(0, (char *)ea_list[i].value.data, ea_list[i].value.length); } @@ -4570,7 +4570,7 @@ static BOOL run_eatest(int dummy) printf("num_eas = %d\n", (int)num_eas); for (i = 0; i < num_eas; i++) { printf("%d: ea_name = %s. Val = ", i, ea_list[i].name); - dump_data(0, ea_list[i].value.data, + dump_data(0, (char *)ea_list[i].value.data, ea_list[i].value.length); } |