]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
run-make-check.sh: run ulimit without sudo
authoryang.wang <yang.wang@easystack.cn>
Wed, 30 Aug 2017 08:32:49 +0000 (16:32 +0800)
committerkungf <yang.wang@easystack.cn>
Fri, 15 Sep 2017 02:11:03 +0000 (10:11 +0800)
ulimit is a shell builtin like cd, not a separate program.
sudo looks for a binary to run, but there is no ulimit binary,
then you will get an error message like:
          "sudo: ulimit: command not found"
ulimit can only be run with root if you want raise the ulimit -n

Change-Id: I59ab09240cb15cabe5b0a7342c3f562cd50c75e9
Signed-off-by: yang.wang <yang.wang@easystack.cn>
run-make-check.sh

index 6b9ed29f63a97f476b2d5bd4f6a957fb8c0b629d..75e7d92b683bcb14170f12192ea7a3fba8c3f0cd 100755 (executable)
@@ -71,8 +71,13 @@ function run() {
     $DRY_RUN ./do_cmake.sh $@ || return 1
     $DRY_RUN cd build
     $DRY_RUN make $BUILD_MAKEOPTS tests || return 1
-    # prevent OSD EMFILE death on tests
-    $DRY_RUN sudo ulimit -n 32768
+    # prevent OSD EMFILE death on tests, make sure large than 1024
+    $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
     if ! $DRY_RUN ctest $CHECK_MAKEOPTS --output-on-failure; then
         rm -f ${TMPDIR:-/tmp}/ceph-asok.*
         return 1