]> git.proxmox.com Git - ceph.git/blame - ceph/run-make-check.sh
Import ceph 15.2.8
[ceph.git] / ceph / run-make-check.sh
CommitLineData
11fdf7f2 1#!/usr/bin/env bash
7c673cae
FG
2#
3# Ceph distributed storage system
4#
5# Copyright (C) 2014 Red Hat <contact@redhat.com>
6#
7# Author: Loic Dachary <loic@dachary.org>
8#
9# This library is free software; you can redistribute it and/or
10# modify it under the terms of the GNU Lesser General Public
11# License as published by the Free Software Foundation; either
12# version 2.1 of the License, or (at your option) any later version.
13#
14
15#
f64942e4 16# To just look at what this script will do, run it like this:
7c673cae 17#
f64942e4
AA
18# $ DRY_RUN=echo ./run-make-check.sh
19#
20
9f95a23c 21source src/script/run-make.sh
11fdf7f2 22
f91f0fd5
TL
23set -e
24
7c673cae 25function run() {
f64942e4
AA
26 # to prevent OSD EMFILE death on tests, make sure ulimit >= 1024
27 $DRY_RUN ulimit -n $(ulimit -Hn)
28 if [ $(ulimit -n) -lt 1024 ];then
29 echo "***ulimit -n too small, better bigger than 1024 for test***"
30 return 1
31 fi
32
11fdf7f2
TL
33 # increase the aio-max-nr, which is by default 65536. we could reach this
34 # limit while running seastar tests and bluestore tests.
9f95a23c 35 $DRY_RUN sudo /sbin/sysctl -q -w fs.aio-max-nr=$((65536 * 16))
11fdf7f2 36
9f95a23c 37 CHECK_MAKEOPTS=${CHECK_MAKEOPTS:-$DEFAULT_MAKEOPTS}
c07f9fc5 38 if ! $DRY_RUN ctest $CHECK_MAKEOPTS --output-on-failure; then
11fdf7f2 39 rm -fr ${TMPDIR:-/tmp}/ceph-asok.*
c07f9fc5
FG
40 return 1
41 fi
7c673cae
FG
42}
43
44function main() {
45 if [[ $EUID -eq 0 ]] ; then
46 echo "For best results, run this script as a normal user configured"
47 echo "with the ability to run commands as root via sudo."
48 fi
49 echo -n "Checking hostname sanity... "
f64942e4 50 if $DRY_RUN hostname --fqdn >/dev/null 2>&1 ; then
7c673cae
FG
51 echo "OK"
52 else
53 echo "NOT OK"
54 echo "Please fix 'hostname --fqdn', otherwise 'make check' will fail"
55 return 1
56 fi
9f95a23c
TL
57 FOR_MAKE_CHECK=1 prepare
58 # Init defaults after deps are installed.
59 local cmake_opts=" -DWITH_PYTHON3=3 -DWITH_GTEST_PARALLEL=ON -DWITH_FIO=ON -DWITH_CEPHFS_SHELL=ON -DWITH_SPDK=ON -DENABLE_GIT_VERSION=OFF"
60 if [ $WITH_SEASTAR ]; then
61 cmake_opts+=" -DWITH_SEASTAR=ON"
62 fi
63 configure $cmake_opts $@
f91f0fd5
TL
64 build tests
65 echo "make check: successful build on $(git rev-parse HEAD)"
9f95a23c 66 run
7c673cae
FG
67}
68
69main "$@"