svn commit: samba r5035 - in branches/SAMBA_4_0/source/torture/raw:
.
tridge at samba.org
tridge at samba.org
Thu Jan 27 06:18:20 GMT 2005
Author: tridge
Date: 2005-01-27 06:18:20 +0000 (Thu, 27 Jan 2005)
New Revision: 5035
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5035
Log:
fixed composite test to use --num-ops command line option
Modified:
branches/SAMBA_4_0/source/torture/raw/composite.c
Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/composite.c
===================================================================
--- branches/SAMBA_4_0/source/torture/raw/composite.c 2005-01-27 06:16:59 UTC (rev 5034)
+++ branches/SAMBA_4_0/source/torture/raw/composite.c 2005-01-27 06:18:20 UTC (rev 5035)
@@ -121,9 +121,10 @@
char *data;
int i;
size_t len = random() % 10000;
- const int num_ops = 10;
+ extern int torture_numops;
struct event_context *event_ctx;
int *count = talloc_zero(mem_ctx, int);
+ BOOL ret = True;
data = talloc_array(mem_ctx, uint8_t, len);
@@ -152,12 +153,12 @@
io2.in.password = lp_parm_string(-1, "torture", "password");
io2.in.filename = fname;
- printf("testing parallel fetchfile with %d ops\n", num_ops);
+ printf("testing parallel fetchfile with %d ops\n", torture_numops);
event_ctx = event_context_init(mem_ctx);
- c = talloc_array(mem_ctx, struct smbcli_composite *, num_ops);
+ c = talloc_array(mem_ctx, struct smbcli_composite *, torture_numops);
- for (i=0; i<num_ops; i++) {
+ for (i=0; i<torture_numops; i++) {
c[i] = smb_composite_fetchfile_send(&io2, event_ctx);
c[i]->async.fn = loadfile_complete;
c[i]->async.private = count;
@@ -165,45 +166,38 @@
printf("waiting for completion\n");
- while (*count != num_ops) {
+ while (*count != torture_numops) {
event_loop_once(event_ctx);
-#if 0
- /* Attempt to kill the event ... To fix -- vl */
- for (i=0; i<num_ops; i++) {
- if (!c[i]) continue;
- if (c[i]->state == SMBCLI_REQUEST_ERROR) {
- printf("error in %d\n", i); msleep(1000);
- talloc_free(c[i]); c[i]=NULL;
- }
- }
-#endif
printf("count=%d\r", *count);
fflush(stdout);
}
printf("count=%d\n", *count);
- for (i=0;i<num_ops;i++) {
+ for (i=0;i<torture_numops;i++) {
status = smb_composite_fetchfile_recv(c[i], mem_ctx);
if (!NT_STATUS_IS_OK(status)) {
printf("loadfile[%d] failed - %s\n", i,
nt_errstr(status));
- return False;
+ ret = False;
+ continue;
}
if (io2.out.size != len) {
printf("wrong length in returned data - %d "
"should be %d\n",
io2.out.size, len);
- return False;
+ ret = False;
+ continue;
}
if (memcmp(io2.out.data, data, len) != 0) {
printf("wrong data in loadfile!\n");
- return False;
+ ret = False;
+ continue;
}
}
- return NT_STATUS_IS_OK(status);
+ return ret;
}
/*
More information about the samba-cvs
mailing list