diff options
author | Jose <jose@zeroc.com> | 2009-11-26 23:24:04 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2009-11-26 23:24:04 +0100 |
commit | cd2034a7bd10e15544479e40afc239b085070f46 (patch) | |
tree | bc5580709b76b15e55482316c2ed5f0df1375a84 /cpp/test | |
parent | 4385 - new StreamApi & UserExecption (diff) | |
download | ice-cd2034a7bd10e15544479e40afc239b085070f46.tar.bz2 ice-cd2034a7bd10e15544479e40afc239b085070f46.tar.xz ice-cd2034a7bd10e15544479e40afc239b085070f46.zip |
4279 - alllTest.py fails to run if source path contains white spaces.
Diffstat (limited to 'cpp/test')
-rwxr-xr-x | cpp/test/Freeze/complex/run.py | 4 | ||||
-rwxr-xr-x | cpp/test/Freeze/dbmap/run.py | 2 | ||||
-rwxr-xr-x | cpp/test/Freeze/evictor/run.py | 2 | ||||
-rwxr-xr-x | cpp/test/FreezeScript/dbmap/run.py | 42 | ||||
-rwxr-xr-x | cpp/test/FreezeScript/evictor/run.py | 10 | ||||
-rwxr-xr-x | cpp/test/Glacier2/staticFiltering/run.py | 6 | ||||
-rwxr-xr-x | cpp/test/Ice/gc/run.py | 2 | ||||
-rwxr-xr-x | cpp/test/IceBox/configuration/run.py | 4 | ||||
-rwxr-xr-x | cpp/test/IceGrid/deployer/run.py | 4 | ||||
-rwxr-xr-x | cpp/test/IceGrid/distribution/run.py | 2 | ||||
-rwxr-xr-x | cpp/test/IceGrid/replicaGroup/run.py | 4 | ||||
-rwxr-xr-x | cpp/test/IceSSL/configuration/run.py | 2 | ||||
-rwxr-xr-x | cpp/test/IceStorm/repgrid/run.py | 2 | ||||
-rwxr-xr-x | cpp/test/IceUtil/unicode/run.py | 2 | ||||
-rwxr-xr-x | cpp/test/Slice/errorDetection/run.py | 14 |
15 files changed, 50 insertions, 52 deletions
diff --git a/cpp/test/Freeze/complex/run.py b/cpp/test/Freeze/complex/run.py index 0d9204e7fe7..1ce79738e05 100755 --- a/cpp/test/Freeze/complex/run.py +++ b/cpp/test/Freeze/complex/run.py @@ -34,13 +34,13 @@ if TestUtil.appverifier: TestUtil.setAppVerifierSettings([client]) print "starting populate...", -populateProc = TestUtil.startClient(client, " --dbdir %s populate" % os.getcwd(), startReader = False) +populateProc = TestUtil.startClient(client, ' --dbdir "%s" populate' % os.getcwd(), startReader = False) print "ok" populateProc.startReader() populateProc.waitTestSuccess() print "starting verification client...", -clientProc = TestUtil.startClient(client, " --dbdir %s validate" % os.getcwd(), startReader = False) +clientProc = TestUtil.startClient(client, ' --dbdir "%s" validate' % os.getcwd(), startReader = False) print "ok" clientProc.startReader() clientProc.waitTestSuccess() diff --git a/cpp/test/Freeze/dbmap/run.py b/cpp/test/Freeze/dbmap/run.py index c1ae645641a..89fb4e6c073 100755 --- a/cpp/test/Freeze/dbmap/run.py +++ b/cpp/test/Freeze/dbmap/run.py @@ -28,7 +28,7 @@ client = os.path.join(os.getcwd(), "client") if TestUtil.appverifier: TestUtil.setAppVerifierSettings([client]) -clientProc = TestUtil.startClient(client, " --Freeze.Warn.Rollback=0 %s" % os.getcwd()) +clientProc = TestUtil.startClient(client, ' --Freeze.Warn.Rollback=0 "%s"' % os.getcwd()) clientProc.waitTestSuccess() if TestUtil.appverifier: diff --git a/cpp/test/Freeze/evictor/run.py b/cpp/test/Freeze/evictor/run.py index b895339b126..9a3a60ee1c6 100755 --- a/cpp/test/Freeze/evictor/run.py +++ b/cpp/test/Freeze/evictor/run.py @@ -23,7 +23,7 @@ from scripts import * dbdir = os.path.join(os.getcwd(), "db") TestUtil.cleanDbDir(dbdir) -testOptions = " --Freeze.DbEnv.db.DbHome=%s --Ice.Config=%s" % (dbdir, os.path.join(os.getcwd(), "config")) +testOptions = ' --Freeze.DbEnv.db.DbHome="%s" --Ice.Config="%s"' % (dbdir, os.path.join(os.getcwd(), "config")) TestUtil.clientServerTest(additionalServerOptions= testOptions, additionalClientOptions= testOptions) diff --git a/cpp/test/FreezeScript/dbmap/run.py b/cpp/test/FreezeScript/dbmap/run.py index 305be843ca8..7fdabe7a6f7 100755 --- a/cpp/test/FreezeScript/dbmap/run.py +++ b/cpp/test/FreezeScript/dbmap/run.py @@ -21,7 +21,7 @@ sys.path.append(os.path.join(path[0])) from scripts import * -transformdb = os.path.join(TestUtil.getCppBinDir(), "transformdb") +transformdb = '%s' % os.path.join(TestUtil.getCppBinDir(), "transformdb") if TestUtil.appverifier: TestUtil.setAppVerifierSettings([transformdb]) @@ -67,13 +67,15 @@ for oldfile in files: else: value = "int" - command = transformdb + " --old " + os.path.join(os.getcwd(), "fail", oldfile) + " --new " + \ - os.path.join(os.getcwd(), "fail", newfile) + " -o tmp.xml --key string --value " + value + command = '"' + transformdb + '" --old "' + os.path.join(os.getcwd(), "fail", oldfile) + '" --new "' + \ + os.path.join(os.getcwd(), "fail", newfile) + '" -o tmp.xml --key string --value ' + value if TestUtil.debug: print command - stdin, stdout, stderr = os.popen3(command) + p = TestUtil.runCommand(command) + (stdin, stdout, stderr) = (p.stdin, p.stdout, p.stderr) + lines1 = stderr.readlines() lines2 = open(os.path.join(os.getcwd(), "fail", oldfile.replace("_old.ice", ".err")), "r").readlines() if len(lines1) != len(lines2): @@ -96,7 +98,7 @@ print "ok" print "creating test database...", sys.stdout.flush() -makedb = os.path.join(os.getcwd(), "makedb") + " " + os.getcwd() +makedb = '"%s" "%s"'% (os.path.join(os.getcwd(), "makedb"), os.getcwd()) proc = TestUtil.spawn(makedb) proc.waitTestSuccess() print "ok" @@ -109,36 +111,30 @@ checkxml = os.path.join(os.getcwd(), "check.xml") print "initializing test database...", sys.stdout.flush() -command = transformdb + " --old " + testold + " --new " + testold + " -f " + initxml + " " + dbdir + \ - " default.db " + init_dbdir -if TestUtil.debug: - print "(" + command + ")", -if os.system(command) != 0: - sys.exit(1) +command = '"' + transformdb + '" --old "' + testold + '" --new "' + testold + '" -f "' + initxml + '" "' + dbdir + \ + '" default.db "' + init_dbdir + '" ' + +TestUtil.spawn(command).waitTestSuccess() print "ok" print "executing default transformations...", sys.stdout.flush() -command = transformdb + " --old " + testold + " --new " + testnew + " --key int --value ::Test::S " + init_dbdir + \ - " default.db " + check_dbdir -if TestUtil.debug: - print "(" + command + ")", -stdin, stdout, stderr = os.popen3(command) -stderr.readlines() +command = '"' + transformdb + '" --old "' + testold + '" --new "' + testnew + '" --key int --value ::Test::S "' + init_dbdir + \ + '" default.db "' + check_dbdir + '" ' + +TestUtil.spawn(command).waitTestSuccess() print "ok" print "validating database...", sys.stdout.flush() -command = transformdb + " --old " + testnew + " --new " + testnew + " -f " + checkxml + " " + check_dbdir + \ - " default.db " + tmp_dbdir -if TestUtil.debug: - print "(" + command + ")", -if os.system(command) != 0: - sys.exit(1) +command = '"' + transformdb + '" --old "' + testnew + '" --new "' + testnew + '" -f "' + checkxml + '" "' + check_dbdir + \ + '" default.db "' + tmp_dbdir + '" ' + +TestUtil.spawn(command).waitTestSuccess() print "ok" diff --git a/cpp/test/FreezeScript/evictor/run.py b/cpp/test/FreezeScript/evictor/run.py index a4fa6c49e2a..fea87955568 100755 --- a/cpp/test/FreezeScript/evictor/run.py +++ b/cpp/test/FreezeScript/evictor/run.py @@ -41,7 +41,7 @@ os.mkdir(tmp_dbdir) print "creating test database...", sys.stdout.flush() -makedb = os.path.join(os.getcwd(), "makedb") + " " + os.getcwd() +makedb = '"%s" "%s"' % (os.path.join(os.getcwd(), "makedb"), os.getcwd()) proc = TestUtil.spawn(makedb) proc.waitTestSuccess() print "ok" @@ -54,8 +54,8 @@ checkxml = os.path.join(os.getcwd(), "check.xml") print "executing evictor transformations...", sys.stdout.flush() -command = transformdb + " -e -p --old " + testold + " --new " + testnew + " -f " + transformxml + " " + dbdir + \ - " evictor.db " + check_dbdir +command = '"' + transformdb + '" -e -p --old "' + testold + '" --new "' + testnew + '" -f "' + transformxml + '" "' + dbdir + \ + '" evictor.db "' + check_dbdir + '" ' proc = TestUtil.spawn(command) proc.waitTestSuccess() print "ok" @@ -63,8 +63,8 @@ print "ok" print "validating database...", sys.stdout.flush() -command = transformdb + " -e --old " + testnew + " --new " + testnew + " -f " + checkxml + " " + check_dbdir + \ - " evictor.db " + tmp_dbdir +command = '"' + transformdb + '" -e --old "' + testnew + '" --new "' + testnew + '" -f "' + checkxml + '" "' + check_dbdir + \ + '" evictor.db "' + tmp_dbdir + '"' proc = TestUtil.spawn(command) proc.waitTestSuccess() print "ok" diff --git a/cpp/test/Glacier2/staticFiltering/run.py b/cpp/test/Glacier2/staticFiltering/run.py index f1d7a6df140..58dcdf5466d 100755 --- a/cpp/test/Glacier2/staticFiltering/run.py +++ b/cpp/test/Glacier2/staticFiltering/run.py @@ -279,7 +279,7 @@ for testcase in testcases: # these tests. # - routerArgs = " --Ice.Config=" + os.path.join(os.getcwd(), "router.cfg") + \ + routerArgs = ' --Ice.Config="' + os.path.join(os.getcwd(), "router.cfg") + '"' + \ ' --Glacier2.Client.Endpoints="default -p 12347"' + \ ' --Ice.Admin.Endpoints="tcp -h 127.0.0.1 -p 12348"' + \ ' --Ice.Admin.InstanceName=Glacier2' + \ @@ -328,7 +328,7 @@ for testcase in testcases: if TestUtil.protocol != "ssl": serverConfig = file(os.path.join(os.getcwd(), "server.cfg"), "w") - serverOptions = ' --Ice.Config=' + os.path.join(os.getcwd(), "server.cfg") + " " + serverOptions = ' --Ice.Config="' + os.path.join(os.getcwd(), "server.cfg") + '" ' serverConfig.write("BackendAdapter.Endpoints=tcp -p 12010\n") serverConfig.close() else: @@ -352,7 +352,7 @@ for testcase in testcases: if clientDriver.host == "127.0.0.1": clientDriver.host = None clientDriver.host = commonClientOptions - clientArgs = " --Ice.Config=" + os.path.join(os.getcwd(), 'attack.cfg') + " " + clientArgs = ' --Ice.Config="%s"' % os.path.join(os.getcwd(), 'attack.cfg') clientProc = TestUtil.startClient(clientCmd, clientArgs, clientDriver) clientProc.waitTestSuccess() serverProc.waitTestSuccess() diff --git a/cpp/test/Ice/gc/run.py b/cpp/test/Ice/gc/run.py index 48cf7fc8ad5..18b307ca60b 100755 --- a/cpp/test/Ice/gc/run.py +++ b/cpp/test/Ice/gc/run.py @@ -24,7 +24,7 @@ client = os.path.join(os.getcwd(), "client") seedfile = os.path.join(os.getcwd(), "seed") -TestUtil.simpleTest(client, seedfile) +TestUtil.simpleTest(client, '"%s"' % seedfile) os.remove(seedfile) diff --git a/cpp/test/IceBox/configuration/run.py b/cpp/test/IceBox/configuration/run.py index 9b8395cb7ae..8e9f60684e8 100755 --- a/cpp/test/IceBox/configuration/run.py +++ b/cpp/test/IceBox/configuration/run.py @@ -25,6 +25,6 @@ icebox = TestUtil.getIceBox() config = os.path.join(os.getcwd(), "config.icebox") config2 = os.path.join(os.getcwd(), "config.icebox2") -TestUtil.clientServerTest(additionalServerOptions= "--Ice.Config=%s" % config, server = icebox) -TestUtil.clientServerTest(additionalServerOptions= "--Ice.Config=%s" % config2, server = icebox) +TestUtil.clientServerTest(additionalServerOptions= '--Ice.Config="%s"' % config, server = icebox) +TestUtil.clientServerTest(additionalServerOptions= '--Ice.Config="%s"' % config2, server = icebox) diff --git a/cpp/test/IceGrid/deployer/run.py b/cpp/test/IceGrid/deployer/run.py index 3595970fa14..24d33fbad44 100755 --- a/cpp/test/IceGrid/deployer/run.py +++ b/cpp/test/IceGrid/deployer/run.py @@ -20,9 +20,9 @@ if len(path) == 0: sys.path.append(os.path.join(path[0])) from scripts import * -IceGridAdmin.iceGridTest("application.xml", '--TestDir="%s"' % os.getcwd(), '"icebox.exe=%s"' % TestUtil.getIceBox()) +IceGridAdmin.iceGridTest("application.xml", '--TestDir="%s"' % os.getcwd(), "icebox.exe='%s'" % TestUtil.getIceBox()) # Tests with targets IceGridAdmin.iceGridTest("application.xml", '-t --TestDir="%s"' % os.getcwd(), - "icebox.exe=%s moreservers moreservices moreproperties" % TestUtil.getIceBox()) + "icebox.exe='%s' moreservers moreservices moreproperties" % TestUtil.getIceBox()) diff --git a/cpp/test/IceGrid/distribution/run.py b/cpp/test/IceGrid/distribution/run.py index d15618d4891..43172dcf748 100755 --- a/cpp/test/IceGrid/distribution/run.py +++ b/cpp/test/IceGrid/distribution/run.py @@ -26,7 +26,7 @@ def icepatch2Calc(datadir, dirname): icePatch2Calc = os.path.join(TestUtil.getServiceDir(), "icepatch2calc") else: icePatch2Calc = os.path.join(TestUtil.getCppBinDir(), "icepatch2calc") - commandProc = TestUtil.spawn(icePatch2Calc + " " + os.path.join(datadir, dirname)) + commandProc = TestUtil.spawn('"%s" "%s"' % (icePatch2Calc, os.path.join(datadir, dirname))) commandProc.waitTestSuccess() datadir = os.path.join(os.getcwd(), "data") diff --git a/cpp/test/IceGrid/replicaGroup/run.py b/cpp/test/IceGrid/replicaGroup/run.py index 3ef3f4a3169..a0db78792b9 100755 --- a/cpp/test/IceGrid/replicaGroup/run.py +++ b/cpp/test/IceGrid/replicaGroup/run.py @@ -20,6 +20,6 @@ if len(path) == 0: sys.path.append(os.path.join(path[0])) from scripts import * -IceGridAdmin.iceGridTest("application.xml", "--Ice.RetryIntervals=\"0 50 100 250\"", - "icebox.exe=%s" % TestUtil.getIceBox()) +IceGridAdmin.iceGridTest("application.xml", "--Ice.RetryIntervals='0 50 100 250'", + "icebox.exe='%s'" % TestUtil.getIceBox()) diff --git a/cpp/test/IceSSL/configuration/run.py b/cpp/test/IceSSL/configuration/run.py index 4c9cbc476a8..8d3aedef4ad 100755 --- a/cpp/test/IceSSL/configuration/run.py +++ b/cpp/test/IceSSL/configuration/run.py @@ -20,5 +20,5 @@ if len(path) == 0: sys.path.append(os.path.join(path[0])) from scripts import * -TestUtil.clientServerTest(additionalClientOptions = os.getcwd()) +TestUtil.clientServerTest(additionalClientOptions = '"%s"' % os.getcwd()) diff --git a/cpp/test/IceStorm/repgrid/run.py b/cpp/test/IceStorm/repgrid/run.py index 77bce6d70f2..61fae4c95bc 100755 --- a/cpp/test/IceStorm/repgrid/run.py +++ b/cpp/test/IceStorm/repgrid/run.py @@ -31,7 +31,7 @@ if TestUtil.appverifier: for filename in [os.path.join("db", f) for f in os.listdir("db") if f.endswith(".db")]: os.remove(filename) -variables = '"icebox.exe=%s"' % TestUtil.getIceBox() +variables = "icebox.exe='%s'" % TestUtil.getIceBox() if TestUtil.sqlType != None: variables += " db-plugin=IceStormSqlDB:createSqlDB" diff --git a/cpp/test/IceUtil/unicode/run.py b/cpp/test/IceUtil/unicode/run.py index 123c56353f2..d38aadbdd14 100755 --- a/cpp/test/IceUtil/unicode/run.py +++ b/cpp/test/IceUtil/unicode/run.py @@ -22,5 +22,5 @@ from scripts import * client = os.path.join(os.getcwd(), "client") -TestUtil.simpleTest(client, os.getcwd()) +TestUtil.simpleTest(client, '"%s"' % os.getcwd()) diff --git a/cpp/test/Slice/errorDetection/run.py b/cpp/test/Slice/errorDetection/run.py index e27fbfc76af..e6adbb3afa0 100755 --- a/cpp/test/Slice/errorDetection/run.py +++ b/cpp/test/Slice/errorDetection/run.py @@ -8,7 +8,7 @@ # # ********************************************************************** -import os, sys, re +import os, sys, re, subprocess path = [ ".", "..", "../..", "../../..", "../../../.." ] head = os.path.dirname(sys.argv[0]) @@ -20,7 +20,7 @@ if len(path) == 0: sys.path.append(os.path.join(path[0])) from scripts import * -slice2cpp = os.path.join(TestUtil.getCppBinDir(), "slice2cpp") +slice2cpp = '"%s"' % os.path.join(TestUtil.getCppBinDir(), "slice2cpp") regex1 = re.compile("\.ice$", re.IGNORECASE) files = [] @@ -33,13 +33,15 @@ files.sort() for file in files: print file + "...", + command = slice2cpp + ' -I. "%s"' % os.path.join(os.getcwd(), file) - command = slice2cpp + " -I. " + os.path.join(os.getcwd(), file); - stdin, stdout, stderr = os.popen3(command) + p = TestUtil.runCommand(command) + (stdin, stdout, stderr) = (p.stdin, p.stdout, p.stderr) + lines1 = stderr.readlines() lines2 = open(os.path.join(os.getcwd(), regex1.sub(".err", file)), "r").readlines() if len(lines1) != len(lines2): - print "failed!" + print "failed! " sys.exit(1) regex2 = re.compile("^.*(?=" + file + ")") @@ -48,7 +50,7 @@ for file in files: line1 = regex2.sub("", lines1[i]).strip() line2 = regex2.sub("", lines2[i]).strip() if line1 != line2: - print "failed!" + print "failed! " sys.exit(1) i = i + 1 else: |