Changeset: 368b8edeb43c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=368b8edeb43c
Modified Files:
        sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.py
        sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.stable.err
        sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.stable.out
Branch: Oct2012
Log Message:

Change the test script for Bug 2791
Remove sql file, send the sql command directly to the mclient


diffs (114 lines):

diff --git a/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.py 
b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.py
--- a/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.py
+++ b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.py
@@ -7,14 +7,8 @@ except ImportError:
 
 currenttime = time.strftime('%H:%M:%S', time.localtime(time.time()))
 
-#print currenttime
-
-#Change the current time in the sql file
-
-sqlfile = open("currenttime.Bug-2791.sql","w")
-sqlfile.write("select (localtime() - time '%s' < time '00:00:20') and (time 
'%s' - localtime() < time '00:00:20');" %(currenttime, currenttime))
-sqlfile.close()
-
+#SQL command for checking the localtime
+sqlcommand = "select (localtime() - time '%s' < time '00:00:20') and (time 
'%s' - localtime() < time '00:00:20');" %(currenttime, currenttime)
 
 def server_start():
     sys.stderr.write('#mserver\n')
@@ -23,19 +17,18 @@ def server_start():
                          stdout = process.PIPE, stderr = process.PIPE)
     return srv
 
-def client(lang, file, user = 'monetdb', passwd = 'monetdb'):
+def client(lang, sqlCommand, user = 'monetdb', passwd = 'monetdb'):
     sys.stderr.write('#client\n')
     sys.stderr.flush()
     clt = process.client(lang, user = user, passwd = passwd,
-                         stdin = open(file),
+                         stdin = process.PIPE,
                          stdout = process.PIPE, stderr = process.PIPE)
-    return clt.communicate()
+    return clt.communicate(sqlCommand)
 
 def main():
     srv = server_start()
-    out, err = client('sql',
-                      os.path.join(os.getenv('RELSRCDIR'),
-                                   'currenttime.Bug-2791.sql'))
+    out, err = client('sql',sqlcommand)
+
     sys.stdout.write(out)
     sys.stderr.write(err)
     out, err = srv.communicate()
diff --git a/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.stable.err 
b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.stable.err
--- a/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.stable.err
+++ b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.stable.err
@@ -1,9 +1,9 @@
 stderr of test 'currenttime.Bug-2791` in directory 'test/BugTracker-2012` 
itself:
 
 
-# 13:29:41 >  
-# 13:29:41 >  "/usr/bin/python" "currenttime.Bug-2791.py" 
"currenttime.Bug-2791"
-# 13:29:41 >  
+# 13:47:05 >  
+# 13:47:05 >  "/usr/bin/python" "currenttime.Bug-2791.py" 
"currenttime.Bug-2791"
+# 13:47:05 >  
 
 #mserver
 #client
@@ -21,12 +21,9 @@ stderr of test 'currenttime.Bug-2791` in
 # cmdline opt  gdk_nr_threads = 0
 # cmdline opt  gdk_dbfarm = 
/export/scratch2/duc/work/BugsDay/MonetDB/var/MonetDB
 # cmdline opt  mapi_open = true
-# cmdline opt  mapi_port = 35580
+# cmdline opt  mapi_port = 30109
 # cmdline opt  monet_prompt = 
 # cmdline opt  mal_listing = 2
 # cmdline opt  gdk_dbname = mTests_test_BugTracker-2012
 
-# 13:29:41 >  
-# 13:29:41 >  "Done."
-# 13:29:41 >  
 
diff --git a/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.stable.out 
b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.stable.out
--- a/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.stable.out
+++ b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.stable.out
@@ -1,11 +1,11 @@
 stdout of test 'currenttime.Bug-2791` in directory 'test/BugTracker-2012` 
itself:
 
 
-# 13:29:41 >  
-# 13:29:41 >  "/usr/bin/python" "currenttime.Bug-2791.py" 
"currenttime.Bug-2791"
-# 13:29:41 >  
+# 13:47:05 >  
+# 13:47:05 >  "/usr/bin/python" "currenttime.Bug-2791.py" 
"currenttime.Bug-2791"
+# 13:47:05 >  
 
-#select (localtime() - time '13:29:41' < time '00:00:20') and (time '13:29:41' 
- localtime() < time '00:00:20');
+#select (localtime() - time '13:48:19' < time '00:00:20') and (time '13:48:19' 
- localtime() < time '00:00:20');
 % . # table_name
 % sql_sub_localtime # name
 % boolean # type
@@ -19,7 +19,7 @@ stdout of test 'currenttime.Bug-2791` in
 # Copyright (c) 1993-July 2008 CWI.
 # Copyright (c) August 2008-2012 MonetDB B.V., all rights reserved
 # Visit http://www.monetdb.org/ for further information
-# Listening for connection requests on mapi:monetdb://london.ins.cwi.nl:35580/
+# Listening for connection requests on mapi:monetdb://london.ins.cwi.nl:30109/
 # MonetDB/GIS module loaded
 # MonetDB/JAQL module loaded
 # MonetDB/SQL module loaded
@@ -47,7 +47,7 @@ stdout of test 'currenttime.Bug-2791` in
 # loading sql script: 80_udf.sql
 # loading sql script: 99_system.sql
 
-# 13:29:41 >  
-# 13:29:41 >  "Done."
-# 13:29:41 >  
+# 13:47:05 >  
+# 13:47:05 >  "Done."
+# 13:47:05 >  
 
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to