From 51855584eb970b28dfa266ee3653963fb77a2b1e Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Thu, 13 Nov 2014 17:30:29 +0100 Subject: [PATCH] tests: ceph_objectstore_tool.py use a dedicated directory Set CEPH_DIR to a directory that is specific to ceph_objectstore_tool so that it can run in parallel with other vstart.sh clusters. Signed-off-by: Loic Dachary (cherry picked from commit e303d1afde58e68c1f587962010da9e1f1278bc3) Conflicts: src/test/ceph_objectstore_tool.py --- src/test/ceph_objectstore_tool.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/test/ceph_objectstore_tool.py b/src/test/ceph_objectstore_tool.py index 6bad141c923ce..10ad79d331a55 100755 --- a/src/test/ceph_objectstore_tool.py +++ b/src/test/ceph_objectstore_tool.py @@ -172,7 +172,10 @@ def main(argv): sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) nullfd = open(os.devnull, "w") - OSDDIR = "dev" + CEPH_DIR = "ceph_objectstore_tool_dir" + call("rm -fr ceph_objectstore_tool_dir ; mkdir ceph_objectstore_tool_dir", shell=True) + os.environ["CEPH_DIR"] = CEPH_DIR; + OSDDIR = os.path.join(CEPH_DIR, "dev") REP_POOL = "rep_pool" REP_NAME = "REPobject" EC_POOL = "ec_pool" @@ -199,9 +202,11 @@ def main(argv): pid = os.getpid() TESTDIR = "/tmp/test.{pid}".format(pid=pid) DATADIR = "/tmp/data.{pid}".format(pid=pid) - CFSD_PREFIX = "./ceph-objectstore-tool --data-path dev/{osd} --journal-path dev/{osd}.journal " + CFSD_PREFIX = "./ceph-objectstore-tool --data-path " + OSDDIR + "/{osd} --journal-path " + OSDDIR + "/{osd}.journal " PROFNAME = "testecprofile" + CEPH_CONF = os.path.join(CEPH_DIR, 'ceph.conf') + os.environ['CEPH_CONF'] = CEPH_CONF vstart(new=True) wait_for_health() @@ -415,11 +420,11 @@ def main(argv): ERRORS += test_failure(cmd, "Must provide --type (filestore, memstore, keyvaluestore-dev)") # Don't specify a data-path - cmd = "./ceph-objectstore-tool --journal-path dev/{osd}.journal --type memstore --op list --pgid {pg}".format(osd=ONEOSD, pg=ONEPG) + cmd = "./ceph-objectstore-tool --journal-path {dir}/{osd}.journal --type memstore --op list --pgid {pg}".format(dir=OSDDIR, osd=ONEOSD, pg=ONEPG) ERRORS += test_failure(cmd, "Must provide --data-path") # Don't specify a journal-path for filestore - cmd = "./ceph-objectstore-tool --type filestore --data-path dev/{osd} --op list --pgid {pg}".format(osd=ONEOSD, pg=ONEPG) + cmd = "./ceph-objectstore-tool --type filestore --data-path {dir}/{osd} --op list --pgid {pg}".format(dir=OSDDIR, osd=ONEOSD, pg=ONEPG) ERRORS += test_failure(cmd, "Must provide --journal-path") # Test --op list and generate json for all objects @@ -752,6 +757,7 @@ def main(argv): call("/bin/rm -rf {dir}".format(dir=TESTDIR), shell=True) call("/bin/rm -rf {dir}".format(dir=DATADIR), shell=True) + call("/bin/rm -fr ceph_objectstore_tool_dir", shell=True) if ERRORS == 0: print "TEST PASSED" -- 2.39.5