Update of /cvsroot/monetdb/pathfinder/tests/BugDay_2005-12-19_0.9.3/Tests
In directory 
23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv1099/tests/BugDay_2005-12-19_0.9.3/Tests

Modified Files:
      Tag: Aug2009_NFI
        file_locked_after_shredding.SF-1238352.MIL.py 
        multiple_servers.SF-1385152.py 
        multiple_servers_2.SF-1385152.py 
        shredding_on_the_fly.SF-1377006.XQUERY.py 
Log Message:
os.popen is deprecated, use subprocess.Popen instead.

U file_locked_after_shredding.SF-1238352.MIL.py
Index: file_locked_after_shredding.SF-1238352.MIL.py
===================================================================
RCS file: 
/cvsroot/monetdb/pathfinder/tests/BugDay_2005-12-19_0.9.3/Tests/file_locked_after_shredding.SF-1238352.MIL.py,v
retrieving revision 1.2
retrieving revision 1.2.28.1
diff -u -d -r1.2 -r1.2.28.1
--- file_locked_after_shredding.SF-1238352.MIL.py       30 Aug 2007 00:07:34 
-0000      1.2
+++ file_locked_after_shredding.SF-1238352.MIL.py       12 Oct 2009 15:03:03 
-0000      1.2.28.1
@@ -1,4 +1,9 @@
 import os
+try:
+    import subprocess
+except ImportError:
+    # user private copy for old Python versions
+    import MonetDBtesting.subprocess26 as subprocess
 
 def main():
     # create a temporary document
@@ -7,10 +12,10 @@
     f.write('<testdoc><content/></testdoc>\n')
     f.close()
     # shred it
-    p = os.popen(os.getenv('MIL_CLIENT'), 'w')
-    p.write('module("pathfinder");\n')
-    p.write('shred_doc("%s", "testdoc.xml");\n' % fn.replace('\\', r'\\'))
-    p.close()
+    p = subprocess.Popen(os.getenv('MIL_CLIENT'), shell = True, stdin = 
subprocess.PIPE)
+    p.stdin.write('module("pathfinder");\n')
+    p.stdin.write('shred_doc("%s", "testdoc.xml");\n' % fn.replace('\\', 
r'\\'))
+    p.communicate()
     # Here's the real test: try unlinking the source document while
     # the server is still running.  If the unlink fails, we get a
     # traceback which should be caught by Mtest

U multiple_servers_2.SF-1385152.py
Index: multiple_servers_2.SF-1385152.py
===================================================================
RCS file: 
/cvsroot/monetdb/pathfinder/tests/BugDay_2005-12-19_0.9.3/Tests/multiple_servers_2.SF-1385152.py,v
retrieving revision 1.7
retrieving revision 1.7.26.1
diff -u -d -r1.7 -r1.7.26.1
--- multiple_servers_2.SF-1385152.py    30 Aug 2007 00:07:34 -0000      1.7
+++ multiple_servers_2.SF-1385152.py    12 Oct 2009 15:03:04 -0000      1.7.26.1
@@ -1,4 +1,9 @@
 import os, time, sys
+try:
+    import subprocess
+except ImportError:
+    # user private copy for old Python versions
+    import MonetDBtesting.subprocess26 as subprocess
 
 def server_start(x,s,dbinit):
     srvcmd = '%s --dbname "%s" --dbinit "%s"' % 
(os.getenv('MSERVER'),os.getenv('TSTDB'),dbinit)
@@ -6,12 +11,12 @@
     sys.stderr.write('\nserver %d%d : "%s"\n' % (x,s,dbinit))
     sys.stdout.flush()
     sys.stderr.flush()
-    srv = os.popen(srvcmd, 'w')
+    srv = subprocess.Popen(srvcmd, shell = True, stdin = subprocess.PIPE)
     time.sleep(5)                      # give server time to start
     return srv
 
 def server_stop(srv):
-    srv.close()
+    srv.communicate()
 
 def client(x,s, c, dbinit, lang, cmd, h):
     cltcmd = os.getenv('%s_CLIENT' % lang)
@@ -19,9 +24,8 @@
     sys.stderr.write('\nserver %d%d : "%s", client %d: %s%s\n' % 
(x,s,dbinit,c,h,lang))
     sys.stdout.flush()
     sys.stderr.flush()
-    clt = os.popen(cltcmd, 'w')
-    clt.write(cmd)
-    clt.close()
+    clt = subprocess.Popen(cltcmd, shell = True, stdin = subprocess.PIPE)
+    clt.communicate(cmd)
     return '%s(%s) ' % (h,lang)
 
 def clients(x,dbinit):

U shredding_on_the_fly.SF-1377006.XQUERY.py
Index: shredding_on_the_fly.SF-1377006.XQUERY.py
===================================================================
RCS file: 
/cvsroot/monetdb/pathfinder/tests/BugDay_2005-12-19_0.9.3/Tests/shredding_on_the_fly.SF-1377006.XQUERY.py,v
retrieving revision 1.2
retrieving revision 1.2.6.1
diff -u -d -r1.2 -r1.2.6.1
--- shredding_on_the_fly.SF-1377006.XQUERY.py   14 Jul 2009 09:09:27 -0000      
1.2
+++ shredding_on_the_fly.SF-1377006.XQUERY.py   12 Oct 2009 15:03:04 -0000      
1.2.6.1
@@ -1,9 +1,13 @@
 import os
+try:
+    import subprocess
+except ImportError:
+    # user private copy for old Python versions
+    import MonetDBtesting.subprocess26 as subprocess
 
 def main():
     fn = os.path.join(os.getenv('TSTSRCDIR'), 'test1377006.xml')
-    p = os.popen(os.getenv('XQUERY_CLIENT'), 'w')
-    p.write('doc("%s")/x' % fn)
-    p.close()
+    p = subprocess.Popen(os.getenv('XQUERY_CLIENT'), shell = True, stdin = 
subprocess.PIPE)
+    p.communicate('doc("%s")/x' % fn)
 
 main()

U multiple_servers.SF-1385152.py
Index: multiple_servers.SF-1385152.py
===================================================================
RCS file: 
/cvsroot/monetdb/pathfinder/tests/BugDay_2005-12-19_0.9.3/Tests/multiple_servers.SF-1385152.py,v
retrieving revision 1.7
retrieving revision 1.7.26.1
diff -u -d -r1.7 -r1.7.26.1
--- multiple_servers.SF-1385152.py      30 Aug 2007 00:07:34 -0000      1.7
+++ multiple_servers.SF-1385152.py      12 Oct 2009 15:03:03 -0000      1.7.26.1
@@ -1,12 +1,17 @@
 import os, time
+try:
+    import subprocess
+except ImportError:
+    # user private copy for old Python versions
+    import MonetDBtesting.subprocess26 as subprocess
 
 def main():
     srvcmd = '%s --set mapi_port=%s --dbinit 
"module(pathfinder);module(sql_server);mil_start();"' % 
(os.getenv('MSERVER'),os.getenv('MAPIPORT'))
-    srv = os.popen(srvcmd, 'w')
+    srv = subprocess.Popen(srvcmd, shell = True, stdin = subprocess.PIPE)
     time.sleep(10)                      # give server time to start
     cltcmd = os.getenv('MIL_CLIENT')
-    clt = os.popen(cltcmd, 'w')
-    clt.close()
-    srv.close()
+    clt = subprocess.Popen(cltcmd, shell = True, stdin = subprocess.PIPE)
+    clt.communicate()
+    srv.communicate()
 
 main()


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to