diff options
Diffstat (limited to 'cpp/test/IceGrid/distribution/run.py')
-rwxr-xr-x | cpp/test/IceGrid/distribution/run.py | 40 |
1 files changed, 14 insertions, 26 deletions
diff --git a/cpp/test/IceGrid/distribution/run.py b/cpp/test/IceGrid/distribution/run.py index 086147b34cd..f5ff701f241 100755 --- a/cpp/test/IceGrid/distribution/run.py +++ b/cpp/test/IceGrid/distribution/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,35 +10,25 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" - -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() -import IceGridAdmin +sys.path.append(os.path.join(path[0])) +from scripts import * def icepatch2Calc(datadir, dirname): icePatch2Calc = os.path.join(TestUtil.getCppBinDir(), "icepatch2calc") - commandPipe = os.popen(icePatch2Calc + " " + os.path.join(datadir, dirname) + " 2>&1") - - TestUtil.printOutputFromPipe(commandPipe) - - commandStatus = TestUtil.closePipe(commandPipe) - if commandStatus: - sys.exit(1) + commandProc = TestUtil.spawn(icePatch2Calc + " " + os.path.join(datadir, dirname)) + commandProc.waitTestSuccess() -name = os.path.join("IceGrid", "distribution") - -testdir = os.path.dirname(os.path.abspath(__file__)) -datadir = os.path.join(testdir, "data") +datadir = os.path.join(os.getcwd(), "data") -files = [ \ +files = [ [ "original/rootfile", "rootfile" ], [ "original/dir1/file1", "dummy-file1"], [ "original/dir1/file2", "dummy-file2"], @@ -68,9 +58,7 @@ icepatch2Calc(datadir, "original") icepatch2Calc(datadir, "updated") print "ok" -IceGridAdmin.iceGridTest(testdir, name, "application.xml", "") +IceGridAdmin.iceGridTest("application.xml") IceGridAdmin.cleanDbDir(datadir) os.rmdir(datadir) - -sys.exit(0) |