# If you wish to run a named test case, pass it as an argument:
python ~/git/ceph/qa/tasks/vstart_runner.py tasks.cephfs.test_data_scan
+ # Also, you can create the cluster once and then run named test cases against it:
+ python ~/git/ceph/qa/tasks/vstart_runner.py --create-cluster-only
+ python ~/git/ceph/qa/tasks/vstart_runner.py tasks.mgr.dashboard.test_health
+ python ~/git/ceph/qa/tasks/vstart_runner.py tasks.mgr.dashboard.test_rgw
+
"""
from StringIO import StringIO
# Parse arguments
interactive_on_error = False
create_cluster = False
+ create_cluster_only = False
args = sys.argv[1:]
flags = [a for a in args if a.startswith("-")]
interactive_on_error = True
elif f == "--create":
create_cluster = True
+ elif f == "--create-cluster-only":
+ create_cluster_only = True
else:
log.error("Unknown option '{0}'".format(f))
sys.exit(-1)
os.kill(pid, signal.SIGKILL)
# Fire up the Ceph cluster if the user requested it
- if create_cluster:
+ if create_cluster or create_cluster_only:
log.info("Creating cluster with {0} MDS daemons".format(
max_required_mds))
remote.run([os.path.join(SRC_PREFIX, "stop.sh")], check_status=False)
# definitely succeed
LocalCephCluster(LocalContext()).mon_manager.wait_for_all_osds_up(timeout=30)
+ if create_cluster_only:
+ return
+
# List of client mounts, sufficient to run the selected tests
clients = [i.__str__() for i in range(0, max_required_clients)]
CURR_DIR=`pwd`
BUILD_DIR="$CURR_DIR/../../../../build"
- read -r -d '' TEUTHOLOFY_PY_REQS <<EOF
+ read -r -d '' TEUTHOLOGY_PY_REQS <<EOF
apache-libcloud==2.2.1 \
asn1crypto==0.22.0 \
bcrypt==3.1.4 \
virtualenv --python=/usr/bin/python venv
source venv/bin/activate
- eval pip install $TEUTHOLOFY_PY_REQS
+ eval pip install $TEUTHOLOGY_PY_REQS
pip install -r $CURR_DIR/requirements.txt
deactivate
# export COVERAGE_ENABLED=true
# export COVERAGE_FILE=.coverage.mgr.dashboard
- MGR=2 RGW=1 ../src/vstart.sh -n -d
- sleep 10
cd $CURR_DIR
}
find ../src/pybind/mgr/dashboard/ -name '*.pyc' -exec rm -f {} \;
source $TEMP_DIR/venv/bin/activate
-
- if [ "$#" -gt 0 ]; then
- TEST_CASES=""
+ OPTIONS=''
+ TEST_CASES=''
+ if [[ "$@" == '' || "$@" == '--create-cluster-only' ]]; then
+ TEST_CASES=`for i in \`ls $BUILD_DIR/../qa/tasks/mgr/dashboard/test_*\`; do F=$(basename $i); M="${F%.*}"; echo -n " tasks.mgr.dashboard.$M"; done`
+ TEST_CASES="tasks.mgr.test_dashboard $TEST_CASES"
+ if [[ "$@" == '--create-cluster-only' ]]; then
+ OPTIONS="$@"
+ fi
+ else
for t in "$@"; do
TEST_CASES="$TEST_CASES $t"
done
- else
- TEST_CASES=`for i in \`ls $BUILD_DIR/../qa/tasks/mgr/dashboard/test_*\`; do F=$(basename $i); M="${F%.*}"; echo -n " tasks.mgr.dashboard.$M"; done`
- TEST_CASES="tasks.mgr.test_dashboard $TEST_CASES"
fi
export PATH=$BUILD_DIR/bin:$PATH
export LD_LIBRARY_PATH=$BUILD_DIR/lib/cython_modules/lib.${CEPH_PY_VERSION_MAJOR}/:$BUILD_DIR/lib
export PYTHONPATH=$TEMP_DIR/teuthology:$BUILD_DIR/../qa:$BUILD_DIR/lib/cython_modules/lib.${CEPH_PY_VERSION_MAJOR}/:$BUILD_DIR/../src/pybind
- eval python ../qa/tasks/vstart_runner.py $TEST_CASES
+ if [[ -z "$RGW" ]]; then
+ export RGW=1
+ fi
+
+ eval python ../qa/tasks/vstart_runner.py $OPTIONS $TEST_CASES
deactivate
cd $CURR_DIR
}
setup_teuthology
+run_teuthology_tests --create-cluster-only
# End sourced section
return 2> /dev/null