diff --git a/.functests b/.functests index 9797f58a1e..d4190f5675 100755 --- a/.functests +++ b/.functests @@ -1,6 +1,6 @@ #!/bin/bash -SRC_DIR=$(dirname $0) +SRC_DIR=$(python -c "import os; print os.path.dirname(os.path.realpath('$0'))") cd ${SRC_DIR}/test/functional nosetests --exe $@ diff --git a/.probetests b/.probetests index 5d9f69915e..e89fcc01d4 100755 --- a/.probetests +++ b/.probetests @@ -1,6 +1,8 @@ #!/bin/bash -cd $(dirname $0)/test/probe +SRC_DIR=$(python -c "import os; print os.path.dirname(os.path.realpath('$0'))") + +cd ${SRC_DIR}/test/probe nosetests --exe rvalue=$? cd - diff --git a/.unittests b/.unittests index ffce146d6b..4004b842ac 100755 --- a/.unittests +++ b/.unittests @@ -1,6 +1,6 @@ #!/bin/bash -TOP_DIR=$(dirname $(python -c 'import os,sys;print os.path.realpath(sys.argv[1])' $0)) +TOP_DIR=$(python -c "import os; print os.path.dirname(os.path.realpath('$0'))") python -c 'from distutils.version import LooseVersion as Ver; import nose, sys; sys.exit(0 if Ver(nose.__version__) >= Ver("1.2.0") else 1)' if [ $? != 0 ]; then diff --git a/test/probe/common.py b/test/probe/common.py index 9c0f3bd991..d49a4e8f1b 100644 --- a/test/probe/common.py +++ b/test/probe/common.py @@ -24,7 +24,8 @@ from time import sleep, time from swiftclient import get_auth, head_account from swift.common.ring import Ring -from swift.common.utils import readconf, ismount +from swift.common.utils import readconf +from swift.common.manager import Manager from test.probe import CHECK_SERVER_TIMEOUT, VALIDATE_RSYNC @@ -153,9 +154,10 @@ def get_ring(server, force_validate=None): conf = port_to_config[dev['port']] for device in os.listdir(conf['devices']): if device == dev['device']: - full_path = path.realpath(path.join(conf['devices'], device)) - assert ismount(full_path), \ - 'device %s in %s was not mounted (%s)' % ( + dev_path = path.join(conf['devices'], device) + full_path = path.realpath(dev_path) + assert path.exists(full_path), \ + 'device %s in %s was not found (%s)' % ( device, conf['devices'], full_path) break else: @@ -163,7 +165,10 @@ def get_ring(server, force_validate=None): "unable to find ring device %s under %s's devices (%s)" % ( dev['device'], server, conf['devices'])) # verify server is exposing rsync device - rsync_export = '%s%s' % (server, dev['replication_port']) + if port_to_config[dev['port']].get('vm_test_mode', False): + rsync_export = '%s%s' % (server, dev['replication_port']) + else: + rsync_export = server cmd = "rsync rsync://localhost/%s" % rsync_export p = Popen(cmd, shell=True, stdout=PIPE) stdout, _stderr = p.communicate() @@ -184,6 +189,7 @@ def reset_environment(): p = Popen("resetswift 2>&1", shell=True, stdout=PIPE) stdout, _stderr = p.communicate() print stdout + Manager(['all']).stop() pids = {} try: account_ring = get_ring('account')