]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: remove vstart_wrapped_tests.sh
authorLoic Dachary <loic-201408@dachary.org>
Sat, 18 Oct 2014 22:41:40 +0000 (15:41 -0700)
committerLoic Dachary <ldachary@redhat.com>
Sun, 9 Nov 2014 10:59:02 +0000 (11:59 +0100)
Listing tests to be run in a single script does not take advantage of
parallel runs in make.

The vstart_wrapper.sh script is reworked and made less specialized and
let the caller decide which daemons to run via CEPH_START and does not
enforce the number of deamons of each time. It no longer uses stop.sh to
avoid killing the osd/mon/mds that are unrelated to the tests.

http://tracker.ceph.com/issues/9815 Fixes: #9815

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
src/test/vstart_wrapped_tests.sh [deleted file]
src/test/vstart_wrapper.sh

diff --git a/src/test/vstart_wrapped_tests.sh b/src/test/vstart_wrapped_tests.sh
deleted file mode 100755 (executable)
index d80863f..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2013 Cloudwatt <libre.licensing@cloudwatt.com>
-#
-# Author: Loic Dachary <loic@dachary.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Library Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Library Public License for more details.
-#
-code=0
-echo "Run unit tests that need a cluster, using vstart.sh"
-while read line ; do
-  echo "================ START ================"
-  echo "$line"
-  echo "======================================="
-  if ! test/vstart_wrapper.sh $line ; then
-      code=1
-  fi
-  echo "================ STOP ================="  
-done <<EOF
-../qa/workunits/cephtool/test.sh --asok-does-not-need-root
-EOF
-exit $code
index a2ffe2f554464fbc07ee670027393b4faa23c425..b71131aab702f477de6335f1b3e94f6cc69122f0 100755 (executable)
 # GNU Library Public License for more details.
 #
 
+source test/mon/mon-test-helpers.sh
 
-export CEPH_DIR="$PWD/"
-export CEPH_DEV_DIR="$CEPH_DIR/test_dev"
-export CEPH_OUT_DIR="$CEPH_DIR/test_out"
-
-function vstart_teardown()
-{
-    ./stop.sh
-}
+export CEPH_DIR="$PWD/test-$CEPH_PORT"
+export CEPH_DEV_DIR="$CEPH_DIR/dev"
+export CEPH_OUT_DIR="$CEPH_DIR/out"
 
 function vstart_setup()
 {
     rm -fr $CEPH_DEV_DIR $CEPH_OUT_DIR
     mkdir -p $CEPH_DEV_DIR
-    trap "vstart_teardown ; rm -f $TMPFILE" EXIT
+    trap "teardown $CEPH_DIR" EXIT
     export LC_ALL=C # some tests are vulnerable to i18n
-    MDS=1 MON=1 OSD=3 ./vstart.sh \
+    ./vstart.sh \
         -o 'paxos propose interval = 0.01' \
-        -n -l mon osd mds || return 1
+        -n -l $VSTART_ARGS || return 1
     export PATH=.:$PATH
-    export CEPH_CONF=ceph.conf
+    export CEPH_CONF=$CEPH_DIR/ceph.conf
 
     crit=$(expr 100 - $(ceph-conf --show-config-value mon_data_avail_crit))
     if [ $(df . | perl -ne 'print if(s/.*\s(\d+)%.*/\1/)') -ge $crit ] ; then
@@ -54,13 +50,9 @@ EOF
 
 function main()
 {
-    if [[ $(pwd) =~ /src$ ]] && [ -d .libs ] && [ -d pybind ] ; then
-        vstart_setup || return 1
-    else
-        trap "rm -f $TMPFILE" EXIT
-    fi
-    
-    "$@" || return 1
+    teardown $CEPH_DIR
+    vstart_setup || return 1
+    CEPH_CONF=$CEPH_DIR/ceph.conf "$@" || return 1
 }
 
 main "$@"