From: Loic Dachary Date: Sun, 21 Dec 2014 08:39:01 +0000 (+0100) Subject: tests: replace --enable-docker with --enable-root-make-check X-Git-Tag: v0.92~109^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=94abadbd804c4945322080ccdb91ba29bb45d829;p=ceph.git tests: replace --enable-docker with --enable-root-make-check The --enable-docker logic was that each test that needs privileges to run uses a container to do so. The problem with this approach and make -j8 check is that such tests compete for a single container. The --enable-root-make-check activates tests that require privileges and assume it is ok to use sudo to acquire privileges. The decision to run in a container is then taken by the caller who will run something like: docker-tests.sh ./configure --enable-root-make-check docker-tests.sh make -j8 check Signed-off-by: Loic Dachary --- diff --git a/configure.ac b/configure.ac index 4de5d4f35f99..d0576e8c1148 100644 --- a/configure.ac +++ b/configure.ac @@ -276,6 +276,12 @@ else AC_MSG_FAILURE([no suitable crypto library found]) fi +AC_ARG_ENABLE([root-make-check], + [AS_HELP_STRING([--enable-root-make-check], [enable make check tests that require root privileges])], + [], + [enable_root_make_check=no]) +AM_CONDITIONAL(ENABLE_ROOT_MAKE_CHECK, test "x$enable_root_make_check" != xno) + # profiler? AC_ARG_WITH([profiler], [AS_HELP_STRING([--with-profiler], [build extra profiler binaries])], @@ -313,12 +319,6 @@ AM_CONDITIONAL(WITH_DEBUG, test "$with_debug" = "yes") AC_DEFINE([DEBUG_GATHER], [1], [Define if you want C_Gather debugging]) -AC_ARG_ENABLE([docker], - [AS_HELP_STRING([--enable-docker], [enable docker based functional tests])], - [], - [enable_docker=no]) -AM_CONDITIONAL(ENABLE_DOCKER, test "x$enable_docker" != xno) - # code coverage? AC_ARG_ENABLE([coverage], [AS_HELP_STRING([--enable-coverage], [enable code coverage tracking])], diff --git a/run-make-check.sh b/run-make-check.sh index 7f369b7570e0..b7a78dfc3f9e 100755 --- a/run-make-check.sh +++ b/run-make-check.sh @@ -42,17 +42,6 @@ function get_processors() { fi } -# -# Return true if the working tree is after the commit that -# enabled docker based tests -# -function maybe_enable_docker() { - local commit=e038b1266b8d427308ab9e498d93a47bd8e3053a - if git rev-list HEAD | grep --quiet $commit ; then - echo --enable-docker - fi -} - function run() { sudo $(which apt-get yum zypper 2>/dev/null) install -y ccache jq sudo modprobe rbd @@ -61,7 +50,7 @@ function run() { $DRY_RUN ./install-deps.sh || return 1 fi $DRY_RUN ./autogen.sh || return 1 - $DRY_RUN ./configure $(maybe_enable_docker) --disable-static --with-radosgw --with-debug \ + $DRY_RUN ./configure "$@" --disable-static --with-radosgw --with-debug --without-lttng \ CC="ccache gcc" CXX="ccache g++" CFLAGS="-Wall -g" CXXFLAGS="-Wall -g" || return 1 $DRY_RUN make -j$(get_processors) || return 1 $DRY_RUN make $(maybe_parallel_make_check) check || return 1 diff --git a/src/test/Makefile.am b/src/test/Makefile.am index 20395dc0f5ca..175731e7f56b 100644 --- a/src/test/Makefile.am +++ b/src/test/Makefile.am @@ -248,12 +248,12 @@ check_SCRIPTS += \ test/osd/osd-config.sh \ test/osd/osd-bench.sh \ test/osd/osd-copy-from.sh \ - test/ceph-disk.sh \ test/mon/mon-handle-forward.sh -if ENABLE_DOCKER -check_SCRIPTS += \ - test/ceph-disk-root.sh +if ENABLE_ROOT_MAKE_CHECK +check_SCRIPTS += test/ceph-disk-root.sh +else +check_SCRIPTS += test/ceph-disk.sh endif EXTRA_DIST += \ diff --git a/src/test/ceph-disk-root.sh b/src/test/ceph-disk-root.sh index 9b02398d5960..c24b6e555176 100755 --- a/src/test/ceph-disk-root.sh +++ b/src/test/ceph-disk-root.sh @@ -14,12 +14,10 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library Public License for more details. # -source test/docker-test-helper.sh - -supported='([ubuntu]="14.04" [centos]="centos7")' -main_docker "$@" --all "$supported" --compile -main_docker "$@" --all "$supported" --user root --dev test/ceph-disk.sh test_activate_dev +set -e +sudo test/ceph-disk.sh test_activate_dev +test/ceph-disk.sh # Local Variables: -# compile-command: "cd ../.. ; make -j4 && test/osd/ceph-disk-root.sh" +# compile-command: "cd ../.. ; make -j4 && test/ceph-disk-root.sh" # End: