2017-07-20 22:26:42 +00:00
|
|
|
#!/usr/bin/env bash
|
2014-12-06 22:59:54 +00:00
|
|
|
#
|
|
|
|
# Ceph distributed storage system
|
|
|
|
#
|
|
|
|
# Copyright (C) 2014 Red Hat <contact@redhat.com>
|
|
|
|
#
|
|
|
|
# Author: Loic Dachary <loic@dachary.org>
|
|
|
|
#
|
|
|
|
# This library is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
# License as published by the Free Software Foundation; either
|
|
|
|
# version 2.1 of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
|
2018-07-09 11:06:44 +00:00
|
|
|
#
|
|
|
|
# To just look at what this script will do, run it like this:
|
|
|
|
#
|
|
|
|
# $ DRY_RUN=echo ./run-make-check.sh
|
|
|
|
#
|
|
|
|
|
2019-09-05 09:58:44 +00:00
|
|
|
source src/script/run-make.sh
|
2018-09-08 15:06:45 +00:00
|
|
|
|
2020-11-26 01:18:02 +00:00
|
|
|
set -e
|
|
|
|
|
2014-12-06 22:59:54 +00:00
|
|
|
function run() {
|
2018-07-05 08:18:45 +00:00
|
|
|
# to prevent OSD EMFILE death on tests, make sure ulimit >= 1024
|
2017-08-30 08:32:49 +00:00
|
|
|
$DRY_RUN ulimit -n $(ulimit -Hn)
|
|
|
|
if [ $(ulimit -n) -lt 1024 ];then
|
|
|
|
echo "***ulimit -n too small, better bigger than 1024 for test***"
|
|
|
|
return 1
|
|
|
|
fi
|
2018-08-22 11:49:57 +00:00
|
|
|
|
|
|
|
# increase the aio-max-nr, which is by default 65536. we could reach this
|
|
|
|
# limit while running seastar tests and bluestore tests.
|
2019-08-20 02:49:18 +00:00
|
|
|
$DRY_RUN sudo /sbin/sysctl -q -w fs.aio-max-nr=$((65536 * 16))
|
2018-08-22 11:49:57 +00:00
|
|
|
|
2019-09-05 09:58:44 +00:00
|
|
|
CHECK_MAKEOPTS=${CHECK_MAKEOPTS:-$DEFAULT_MAKEOPTS}
|
2017-07-20 11:20:04 +00:00
|
|
|
if ! $DRY_RUN ctest $CHECK_MAKEOPTS --output-on-failure; then
|
2018-03-23 12:26:03 +00:00
|
|
|
rm -fr ${TMPDIR:-/tmp}/ceph-asok.*
|
2017-07-20 11:20:04 +00:00
|
|
|
return 1
|
|
|
|
fi
|
2014-12-06 22:59:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function main() {
|
2016-12-27 11:59:29 +00:00
|
|
|
if [[ $EUID -eq 0 ]] ; then
|
|
|
|
echo "For best results, run this script as a normal user configured"
|
|
|
|
echo "with the ability to run commands as root via sudo."
|
|
|
|
fi
|
2016-12-03 22:37:08 +00:00
|
|
|
echo -n "Checking hostname sanity... "
|
2018-07-09 11:06:44 +00:00
|
|
|
if $DRY_RUN hostname --fqdn >/dev/null 2>&1 ; then
|
2016-12-03 22:37:08 +00:00
|
|
|
echo "OK"
|
|
|
|
else
|
|
|
|
echo "NOT OK"
|
|
|
|
echo "Please fix 'hostname --fqdn', otherwise 'make check' will fail"
|
|
|
|
return 1
|
|
|
|
fi
|
2019-09-05 09:58:44 +00:00
|
|
|
FOR_MAKE_CHECK=1 prepare
|
|
|
|
# Init defaults after deps are installed.
|
2020-03-04 14:09:31 +00:00
|
|
|
local cmake_opts=" -DWITH_PYTHON3=3 -DWITH_GTEST_PARALLEL=ON -DWITH_FIO=ON -DWITH_CEPHFS_SHELL=ON -DWITH_SPDK=ON -DENABLE_GIT_VERSION=OFF"
|
|
|
|
if [ $WITH_SEASTAR ]; then
|
|
|
|
cmake_opts+=" -DWITH_SEASTAR=ON"
|
|
|
|
fi
|
2020-09-17 06:28:51 +00:00
|
|
|
if [ $WITH_ZBD ]; then
|
2020-09-22 02:17:56 +00:00
|
|
|
cmake_opts+=" -DWITH_ZBD=ON"
|
2020-09-17 06:28:51 +00:00
|
|
|
fi
|
2020-03-04 14:09:31 +00:00
|
|
|
configure $cmake_opts $@
|
2020-11-26 05:30:55 +00:00
|
|
|
build tests
|
|
|
|
echo "make check: successful build on $(git rev-parse HEAD)"
|
2019-09-05 09:58:44 +00:00
|
|
|
run
|
2014-12-06 22:59:54 +00:00
|
|
|
}
|
|
|
|
|
2014-12-21 08:47:57 +00:00
|
|
|
main "$@"
|