diff options
-rwxr-xr-x | do_cmake.sh | 12 | ||||
-rwxr-xr-x | do_freebsd.sh | 16 | ||||
-rwxr-xr-x | examples/rbd-replay/trace | 3 | ||||
-rwxr-xr-x | qa/workunits/rados/test_envlibrados_for_rocksdb.sh | 4 | ||||
-rwxr-xr-x | qa/workunits/rgw/run-s3tests.sh | 6 | ||||
-rwxr-xr-x | src/init-ceph.in | 4 | ||||
-rwxr-xr-x | src/mrgw.sh | 5 | ||||
-rwxr-xr-x | src/mrun | 6 | ||||
-rwxr-xr-x | src/mstart.sh | 6 | ||||
-rwxr-xr-x | src/mstop.sh | 6 | ||||
-rwxr-xr-x | src/pybind/mgr/dashboard/run-backend-api-request.sh | 3 | ||||
-rwxr-xr-x | src/pybind/mgr/dashboard/run-backend-api-tests.sh | 26 | ||||
-rwxr-xr-x | src/pybind/mgr/dashboard/run-frontend-e2e-tests.sh | 10 | ||||
-rwxr-xr-x | src/pybind/mgr/dashboard/run-frontend-unittests.sh | 3 | ||||
-rwxr-xr-x | src/script/gen-corpus.sh | 4 |
15 files changed, 71 insertions, 43 deletions
diff --git a/do_cmake.sh b/do_cmake.sh index 2e1593ec2fc..5e54fc4b7fd 100755 --- a/do_cmake.sh +++ b/do_cmake.sh @@ -1,8 +1,12 @@ #!/usr/bin/env bash set -x + git submodule update --init --recursive -if test -e build; then - echo 'build dir already exists; rm -rf build and re-run' + +[ -z "$BUILD_DIR" ] && BUILD_DIR=build + +if [ -e $BUILD_DIR ]; then + echo "'$BUILD_DIR' dir already exists; either rm -rf '$BUILD_DIR' and re-run, or set BUILD_DIR env var to a different directory name" exit 1 fi @@ -46,8 +50,8 @@ if [ -n "$WITH_RADOSGW_AMQP_ENDPOINT" ] ; then ARGS="$ARGS -DWITH_RADOSGW_AMQP_ENDPOINT=$WITH_RADOSGW_AMQP_ENDPOINT" fi -mkdir build -cd build +mkdir $BUILD_DIR +cd $BUILD_DIR if type cmake3 > /dev/null 2>&1 ; then CMAKE=cmake3 else diff --git a/do_freebsd.sh b/do_freebsd.sh index d3f60a26558..509384bee57 100755 --- a/do_freebsd.sh +++ b/do_freebsd.sh @@ -24,16 +24,18 @@ CMAKE_C_FLAGS_DEBUG="$C_FLAGS_DEBUG $COMPILE_FLAGS" # dashboard, because versions fetched are not working on FreeBSD. +[ -z "$BUILD_DIR" ] && BUILD_DIR=build + echo Keeping the old build -if [ -d build.old ]; then - sudo mv build.old build.del - sudo rm -rf build.del & +if [ -d ${BUILD_DIR}.old ]; then + sudo mv ${BUILD_DIR}.old ${BUILD_DIR}.del + sudo rm -rf ${BUILD_DIR}.del & fi -if [ -d build ]; then - sudo mv build build.old +if [ -d ${BUILD_DIR} ]; then + sudo mv ${BUILD_DIR} ${BUILD_DIR}.old fi -mkdir build +mkdir ${BUILD_DIR} ./do_cmake.sh "$*" \ -D WITH_CCACHE=ON \ -D CMAKE_BUILD_TYPE=Debug \ @@ -61,7 +63,7 @@ mkdir build echo -n "start building: "; date printenv -cd build +cd ${BUILD_DIR} gmake -j$CPUS V=1 VERBOSE=1 gmake tests echo -n "start testing: "; date ; diff --git a/examples/rbd-replay/trace b/examples/rbd-replay/trace index 43697b086a3..8739d46e174 100755 --- a/examples/rbd-replay/trace +++ b/examples/rbd-replay/trace @@ -5,6 +5,7 @@ lttng create -o traces librbd lttng enable-event -u 'librbd:*' lttng add-context -u -t pthread_id lttng start -LD_LIBRARY_PATH=../../build/lib qemu-system-i386 -m 1024 rbd:rbd/my-image:conf=../../src/ceph.conf +[ -z "$BUILD_DIR" ] && BUILD_DIR=build +LD_LIBRARY_PATH=../../${BUILD_DIR}/lib qemu-system-i386 -m 1024 rbd:rbd/my-image:conf=../../src/ceph.conf lttng stop lttng view > trace.log diff --git a/qa/workunits/rados/test_envlibrados_for_rocksdb.sh b/qa/workunits/rados/test_envlibrados_for_rocksdb.sh index 1360f6dfe5b..a78b3ad890f 100755 --- a/qa/workunits/rados/test_envlibrados_for_rocksdb.sh +++ b/qa/workunits/rados/test_envlibrados_for_rocksdb.sh @@ -72,7 +72,9 @@ if type cmake3 > /dev/null 2>&1 ; then else CMAKE=cmake fi -mkdir build && cd build && ${CMAKE} -DWITH_LIBRADOS=ON -DWITH_SNAPPY=ON -DWITH_GFLAGS=OFF -DFAIL_ON_WARNINGS=OFF .. + +[ -z "$BUILD_DIR" ] && BUILD_DIR=build +mkdir ${BUILD_DIR} && cd ${BUILD_DIR} && ${CMAKE} -DWITH_LIBRADOS=ON -DWITH_SNAPPY=ON -DWITH_GFLAGS=OFF -DFAIL_ON_WARNINGS=OFF .. make rocksdb_env_librados_test -j8 echo "Copy ceph.conf" diff --git a/qa/workunits/rgw/run-s3tests.sh b/qa/workunits/rgw/run-s3tests.sh index 307eea01b56..9ecbae30554 100755 --- a/qa/workunits/rgw/run-s3tests.sh +++ b/qa/workunits/rgw/run-s3tests.sh @@ -12,10 +12,12 @@ port=$2 ## +[ -z "$BUILD_DIR" ] && BUILD_DIR=build + if [ -e CMakeCache.txt ]; then BIN_PATH=$PWD/bin -elif [ -e $root_path/../build/CMakeCache.txt ]; then - cd $root_path/../build +elif [ -e $root_path/../${BUILD_DIR}/CMakeCache.txt ]; then + cd $root_path/../${BUILD_DIR} BIN_PATH=$PWD/bin fi PATH=$PATH:$BIN_PATH diff --git a/src/init-ceph.in b/src/init-ceph.in index 8ea9ef076ed..e1915bbfb6d 100755 --- a/src/init-ceph.in +++ b/src/init-ceph.in @@ -17,6 +17,8 @@ if [ -e /lib/lsb/init-functions ]; then . /lib/lsb/init-functions fi +[ -z "$BUILD_DIR" ] && BUILD_DIR=build + if [ `dirname $0` = "." ] && [ $PWD != "/etc/init.d" ]; then # looks like an autotools src dir build BINDIR=. @@ -33,7 +35,7 @@ else LIBEXECDIR=$CEPH_ROOT/src ETCDIR=. ASSUME_DEV=1 - CEPH_LIB=$CEPH_ROOT/build/lib + CEPH_LIB=$CEPH_ROOT/${BUILD_DIR}/lib echo "$PYTHONPATH" | grep -q $CEPH_LIB || export PYTHONPATH=$CEPH_LIB/cython_modules/lib.@MGR_PYTHON_VERSION_MAJOR@:$PYTHONPATH echo "$LD_LIBRARY_PATH" | grep -q $CEPH_LIB || export LD_LIBRARY_PATH=$CEPH_LIB:$LD_LIBRARY_PATH echo "$DYLD_LIBRARY_PATH" | grep -q $CEPH_LIB || export DYLD_LIBRARY_PATH=$CEPH_LIB:$DYLD_LIBRARY_PATH diff --git a/src/mrgw.sh b/src/mrgw.sh index 54e8039e643..c27ba25bcab 100755 --- a/src/mrgw.sh +++ b/src/mrgw.sh @@ -5,10 +5,11 @@ set -e rgw_frontend=${RGW_FRONTEND:-"beast"} script_root=`dirname $0` script_root=`(cd $script_root;pwd)` +[ -z "$BUILD_DIR" ] && BUILD_DIR=build if [ -e CMakeCache.txt ]; then script_root=$PWD -elif [ -e $script_root/../build/CMakeCache.txt ]; then - cd $script_root/../build +elif [ -e $script_root/../${BUILD_DIR}/CMakeCache.txt ]; then + cd $script_root/../${BUILD_DIR} script_root=$PWD fi ceph_bin=$script_root/bin @@ -8,11 +8,13 @@ command=$2 CEPH_BIN=$root CEPH_CONF_PATH=$root/run/$run_name +[ -z "$BUILD_DIR" ] && BUILD_DIR=build + if [ -e CMakeCache.txt ]; then CEPH_BIN=$PWD/bin CEPH_CONF_PATH=$PWD/run/$run_name -elif [ -e $root/../build/CMakeCache.txt ]; then - cd $root/../build +elif [ -e $root/../${BUILD_DIR}/CMakeCache.txt ]; then + cd $root/../${BUILD_DIR} CEPH_BIN=$PWD/bin CEPH_CONF_PATH=$PWD/run/$run_name fi diff --git a/src/mstart.sh b/src/mstart.sh index 32759175184..4bf3bde4b69 100755 --- a/src/mstart.sh +++ b/src/mstart.sh @@ -18,10 +18,12 @@ vstart_path=`dirname $0` root_path=`dirname $0` root_path=`(cd $root_path; pwd)` +[ -z "$BUILD_DIR" ] && BUILD_DIR=build + if [ -e CMakeCache.txt ]; then root_path=$PWD -elif [ -e $root_path/../build/CMakeCache.txt ]; then - cd $root_path/../build +elif [ -e $root_path/../${BUILD_DIR}/CMakeCache.txt ]; then + cd $root_path/../${BUILD_DIR} root_path=$PWD fi RUN_ROOT_PATH=${root_path}/run diff --git a/src/mstop.sh b/src/mstop.sh index 0dfe715e86b..702d1765941 100755 --- a/src/mstop.sh +++ b/src/mstop.sh @@ -4,10 +4,12 @@ set -e script_root=`dirname $0` +[ -z "$BUILD_DIR" ] && BUILD_DIR=build + if [ -e CMakeCache.txt ]; then script_root=$PWD -elif [ -e $script_root/../build/CMakeCache.txt ]; then - script_root=`(cd $script_root/../build; pwd)` +elif [ -e $script_root/../${BUILD_DIR}/CMakeCache.txt ]; then + script_root=`(cd $script_root/../${BUILD_DIR}; pwd)` fi [ "$#" -lt 1 ] && echo "usage: $0 <name> [entity [id]]" && exit 1 diff --git a/src/pybind/mgr/dashboard/run-backend-api-request.sh b/src/pybind/mgr/dashboard/run-backend-api-request.sh index 5c4c155943b..ad5c42939a6 100755 --- a/src/pybind/mgr/dashboard/run-backend-api-request.sh +++ b/src/pybind/mgr/dashboard/run-backend-api-request.sh @@ -1,7 +1,8 @@ #!/bin/bash CURR_DIR=`pwd` -cd ../../../../build +[ -z "$BUILD_DIR" ] && BUILD_DIR=build +cd ../../../../${BUILD_DIR} API_URL=`./bin/ceph mgr services 2>/dev/null | jq .dashboard | sed -e 's/"//g' -e 's!/$!!g'` if [ "$API_URL" = "null" ]; then echo "Couldn't retrieve API URL, exiting..." >&2 diff --git a/src/pybind/mgr/dashboard/run-backend-api-tests.sh b/src/pybind/mgr/dashboard/run-backend-api-tests.sh index 1e11b612e5c..47aa8d0f409 100755 --- a/src/pybind/mgr/dashboard/run-backend-api-tests.sh +++ b/src/pybind/mgr/dashboard/run-backend-api-tests.sh @@ -24,10 +24,12 @@ get_cmake_variable() { grep "$variable" CMakeCache.txt | cut -d "=" -f 2 } +[ -z "$BUILD_DIR" ] && BUILD_DIR=build + get_build_py_version() { CURR_DIR=`pwd` - BUILD_DIR="$CURR_DIR/../../../../build" - cd $BUILD_DIR + LOCAL_BUILD_DIR="$CURR_DIR/../../../../$BUILD_DIR" + cd "$LOCAL_BUILD_DIR" CEPH_MGR_PY_VERSION_MAJOR=$(get_cmake_variable MGR_PYTHON_VERSION | cut -d '.' -f1) if [ -n "$CEPH_MGR_PY_VERSION_MAJOR" ]; then @@ -104,7 +106,7 @@ setup_coverage() { on_tests_error() { if [[ -n "$JENKINS_HOME" ]]; then - CEPH_OUT_DIR=${CEPH_OUT_DIR:-"$BUILD_DIR"/out} + CEPH_OUT_DIR=${CEPH_OUT_DIR:-"$LOCAL_BUILD_DIR"/out} MGR_LOG_FILES=$(find "$CEPH_OUT_DIR" -iname "mgr.*.log" | tr '\n' ' ') MGR_LOG_FILE_LAST_LINES=60000 for mgr_log_file in ${MGR_LOG_FILES[@]}; do @@ -119,13 +121,13 @@ on_tests_error() { run_teuthology_tests() { trap on_tests_error ERR - cd "$BUILD_DIR" + cd "$LOCAL_BUILD_DIR" find ../src/pybind/mgr/dashboard/ -name '*.pyc' -exec rm -f {} \; 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=`for i in \`ls $LOCAL_BUILD_DIR/../qa/tasks/mgr/dashboard/test_*\`; do F=$(basename $i); M="${F%.*}"; echo -n " tasks.mgr.dashboard.$M"; done` # Mgr selftest module tests have to be run at the end as they stress the mgr daemon. TEST_CASES="tasks.mgr.test_dashboard $TEST_CASES tasks.mgr.test_module_selftest" if [[ "$@" == '--create-cluster-only' ]]; then @@ -137,18 +139,18 @@ run_teuthology_tests() { done fi - export PATH=$BUILD_DIR/bin:$PATH + export PATH=$LOCAL_BUILD_DIR/bin:$PATH source $TEMP_DIR/venv/bin/activate # Run after setting PATH as it does the last PATH export. - export LD_LIBRARY_PATH=$BUILD_DIR/lib/cython_modules/lib.${CEPH_PY_VERSION_MAJOR}/:$BUILD_DIR/lib - local source_dir=$(dirname "$BUILD_DIR") + export LD_LIBRARY_PATH=$LOCAL_BUILD_DIR/lib/cython_modules/lib.${CEPH_PY_VERSION_MAJOR}/:$LOCAL_BUILD_DIR/lib + local source_dir=$(dirname "$LOCAL_BUILD_DIR") local pybind_dir=$source_dir/src/pybind local python_common_dir=$source_dir/src/python-common # In CI environment we set python paths inside build (where you find the required frontend build: "dist" dir). if [[ -n "$JENKINS_HOME" ]]; then - export PYBIND=$BUILD_DIR/src/pybind + export PYBIND=$LOCAL_BUILD_DIR/src/pybind pybind_dir=$PYBIND fi - export PYTHONPATH=$TEMP_DIR/teuthology:$source_dir/qa:$BUILD_DIR/lib/cython_modules/lib.${CEPH_PY_VERSION_MAJOR}/:$pybind_dir:$python_common_dir:${COVERAGE_PATH} + export PYTHONPATH=$TEMP_DIR/teuthology:$source_dir/qa:$LOCAL_BUILD_DIR/lib/cython_modules/lib.${CEPH_PY_VERSION_MAJOR}/:$pybind_dir:$python_common_dir:${COVERAGE_PATH} export RGW=${RGW:-1} export COVERAGE_ENABLED=true @@ -162,7 +164,7 @@ run_teuthology_tests() { } cleanup_teuthology() { - cd "$BUILD_DIR" + cd "$LOCAL_BUILD_DIR" killall ceph-mgr sleep 10 if [[ "$COVERAGE_ENABLED" == 'true' ]]; then @@ -178,7 +180,7 @@ cleanup_teuthology() { unset TEMP_DIR unset CURR_DIR - unset BUILD_DIR + unset LOCAL_BUILD_DIR unset COVERAGE_PATH unset get_build_py_version unset setup_teuthology diff --git a/src/pybind/mgr/dashboard/run-frontend-e2e-tests.sh b/src/pybind/mgr/dashboard/run-frontend-e2e-tests.sh index cf7ee4bce60..ad4c64f5b26 100755 --- a/src/pybind/mgr/dashboard/run-frontend-e2e-tests.sh +++ b/src/pybind/mgr/dashboard/run-frontend-e2e-tests.sh @@ -4,7 +4,7 @@ set -e stop() { if [ "$REMOTE" == "false" ]; then - cd $BUILD_DIR + cd ${FULL_PATH_BUILD_DIR} ../src/stop.sh fi exit $1 @@ -39,8 +39,10 @@ fi DASH_DIR=`pwd` -cd ../../../../build -BUILD_DIR=`pwd` +[ -z "$BUILD_DIR" ] && BUILD_DIR=build + +cd ../../../../${BUILD_DIR} +FULL_PATH_BUILD_DIR=`pwd` if [ "$BASE_URL" == "" ]; then MGR=2 RGW=1 ../src/vstart.sh -n -d @@ -64,7 +66,7 @@ export BASE_URL cd $DASH_DIR/frontend jq .[].target=\"$BASE_URL\" proxy.conf.json.sample > proxy.conf.json -. $BUILD_DIR/src/pybind/mgr/dashboard/node-env/bin/activate +. ${FULL_PATH_BUILD_DIR}/src/pybind/mgr/dashboard/node-env/bin/activate if [ "$DEVICE" == "chrome" ]; then npm run e2e:ci || stop 1 diff --git a/src/pybind/mgr/dashboard/run-frontend-unittests.sh b/src/pybind/mgr/dashboard/run-frontend-unittests.sh index 0186e872d75..b64ac446306 100755 --- a/src/pybind/mgr/dashboard/run-frontend-unittests.sh +++ b/src/pybind/mgr/dashboard/run-frontend-unittests.sh @@ -3,8 +3,9 @@ failed=false : ${CEPH_ROOT:=$PWD/../../../../} cd $CEPH_ROOT/src/pybind/mgr/dashboard/frontend +[ -z "$BUILD_DIR" ] && BUILD_DIR=build if [ `uname` != "FreeBSD" ]; then - . $CEPH_ROOT/build/src/pybind/mgr/dashboard/node-env/bin/activate + . $CEPH_ROOT/${BUILD_DIR}/src/pybind/mgr/dashboard/node-env/bin/activate fi # Build diff --git a/src/script/gen-corpus.sh b/src/script/gen-corpus.sh index 7f9b61ce4ed..018e2bd9d08 100755 --- a/src/script/gen-corpus.sh +++ b/src/script/gen-corpus.sh @@ -13,6 +13,8 @@ function get_jobs() { fi } +[ -z "$BUILD_DIR" ] && BUILD_DIR=build + function build() { local encode_dump_path=$1 shift @@ -22,7 +24,7 @@ function build() { -DWITH_DPDK=OFF \ -DWITH_SPDK=OFF \ -DCMAKE_CXX_FLAGS="-DENCODE_DUMP_PATH=${encode_dump_path}" - cd build + cd ${BUILD_DIR} cmake --build . -- -j$(get_jobs) } |