List:Commits« Previous MessageNext Message »
From:Stewart Smith Date:June 13 2007 12:54pm
Subject:bk commit into 5.1 tree (stewart:1.2535) BUG#29063
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of stewart. When stewart does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-06-13 22:54:00+10:00, stewart@stripped +2 -0
  [PATCH] BUG#29063 TESTCASE mgmapi: connect timeout set incorrectly
  
  Add test to testMgm for Connect timeout. add to autotest.
  
  Index: ndb-work/storage/ndb/test/ndbapi/testMgm.cpp
  ===================================================================

  storage/ndb/test/ndbapi/testMgm.cpp@stripped, 2007-06-13 15:05:32+10:00, stewart@stripped +75 -0
    BUG#29063 TESTCASE mgmapi: connect timeout set incorrectly

  storage/ndb/test/run-test/daily-basic-tests.txt@stripped, 2007-06-13 15:04:54+10:00, stewart@stripped +4 -0
    BUG#29063 TESTCASE mgmapi: connect timeout set incorrectly

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	stewart
# Host:	willster.(none)
# Root:	/home/stewart/Documents/MySQL/5.1/ndb-merge

--- 1.92/storage/ndb/test/run-test/daily-basic-tests.txt	2007-05-31 01:31:44 +10:00
+++ 1.93/storage/ndb/test/run-test/daily-basic-tests.txt	2007-06-13 15:04:54 +10:00
@@ -898,6 +898,10 @@
 cmd: testMgm
 args: -n ApiSessionFailure T1
 
+max-time: 15
+cmd: testMgm
+args: -n ApiConnectTimeout T1
+
 max-time: 120
 cmd: testMgm
 args: -n ApiTimeoutBasic T1

--- 1.15/storage/ndb/test/ndbapi/testMgm.cpp	2007-03-06 01:59:18 +11:00
+++ 1.16/storage/ndb/test/ndbapi/testMgm.cpp	2007-06-13 15:05:32 +10:00
@@ -212,6 +212,76 @@
   }
 }
 
+int runTestApiConnectTimeout(NDBT_Context* ctx, NDBT_Step* step)
+{
+  char *mgm= ctx->getRemoteMgm();
+  int result= NDBT_FAILED;
+  int cc= 0;
+  int mgmd_nodeid= 0;
+  ndb_mgm_reply reply;
+
+  NdbMgmHandle h;
+  h= ndb_mgm_create_handle();
+  ndb_mgm_set_connectstring(h, mgm);
+
+  ndbout << "TEST connect timeout" << endl;
+
+  ndb_mgm_set_timeout(h, 3000);
+
+  struct timeval tstart, tend;
+  int secs;
+  timerclear(&tstart);
+  timerclear(&tend);
+  gettimeofday(&tstart,NULL);
+
+  ndb_mgm_connect(h,0,0,0);
+
+  gettimeofday(&tend,NULL);
+
+  secs= tend.tv_sec - tstart.tv_sec;
+  ndbout << "Took about: " << secs <<" seconds"<<endl;
+
+  if(secs < 4)
+    result= NDBT_OK;
+  else
+    goto done;
+
+  ndb_mgm_set_connectstring(h, mgm);
+
+  ndbout << "TEST connect timeout" << endl;
+
+  ndb_mgm_destroy_handle(&h);
+
+  h= ndb_mgm_create_handle();
+  ndb_mgm_set_connectstring(h, "1.1.1.1");
+
+  ndbout << "TEST connect timeout (invalid host)" << endl;
+
+  ndb_mgm_set_timeout(h, 3000);
+
+  timerclear(&tstart);
+  timerclear(&tend);
+  gettimeofday(&tstart,NULL);
+
+  ndb_mgm_connect(h,0,0,0);
+
+  gettimeofday(&tend,NULL);
+
+  secs= tend.tv_sec - tstart.tv_sec;
+  ndbout << "Took about: " << secs <<" seconds"<<endl;
+
+  if(secs < 4)
+    result= NDBT_OK;
+  else
+    result= NDBT_FAILED;
+
+done:
+  ndb_mgm_disconnect(h);
+  ndb_mgm_destroy_handle(&h);
+
+  return result;
+}
+
 int runTestApiTimeoutBasic(NDBT_Context* ctx, NDBT_Step* step)
 {
   char *mgm= ctx->getRemoteMgm();
@@ -726,6 +796,11 @@
 TESTCASE("ApiSessionFailure",
 	 "Test failures in MGMAPI session"){
   INITIALIZER(runTestApiSession);
+
+}
+TESTCASE("ApiConnectTimeout",
+	 "Connect timeout tests for MGMAPI"){
+  INITIALIZER(runTestApiConnectTimeout);
 
 }
 TESTCASE("ApiTimeoutBasic",
Thread
bk commit into 5.1 tree (stewart:1.2535) BUG#29063Stewart Smith13 Jun