]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: reduce ceph-disk.sh verbosity
authorLoic Dachary <ldachary@redhat.com>
Wed, 1 Apr 2015 12:35:34 +0000 (14:35 +0200)
committerLoic Dachary <ldachary@redhat.com>
Sun, 5 Apr 2015 23:58:18 +0000 (01:58 +0200)
Signed-off-by: Loic Dachary <ldachary@redhat.com>
src/test/ceph-disk.sh

index 05041a99bd9cfb1f79dbc41587e8aa9311cc2d4f..1a99a755a138e28adc9594ff0b7ce89c0a4fdb76 100755 (executable)
@@ -15,7 +15,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU Library Public License for more details.
 #
-set -xe
+set -e
 
 source test/test_btrfs_common.sh
 
@@ -58,7 +58,6 @@ function setup() {
     teardown
     mkdir $DIR
     mkdir $OSD_DATA
-#    mkdir $OSD_DATA/ceph-0
     touch $DIR/ceph.conf # so ceph-disk think ceph is the cluster
 }
 
@@ -92,10 +91,13 @@ function run_mon() {
 }
 
 function kill_daemons() {
+    if ! test -e $DIR ; then
+        return
+    fi
     for pidfile in $(find $DIR | grep pidfile) ; do
         pid=$(cat $pidfile)
         for try in 0 1 1 1 2 3 ; do
-            kill $pid || break
+            kill $pid 2>/dev/null || break
             sleep $try
         done
     done
@@ -347,11 +349,12 @@ function loop_sanity_check() {
     local major=$(lsb_release -rs | cut -f1 -d.)
     if test $major != 6 || test $id != CentOS -a $id != RedHatEnterpriseServer ; then
         echo "/dev/loop is assumed to be configured with max_part > 0"
-        echo "and /dev/disk/by-partuuid to be populated by udev"
+        echo "and /dev/disk/by-partuuid to be populated by udev on"
+        lsb_release -a
         return 0
     fi
     local name=$DIR/sanity.disk
-    dd if=/dev/zero of=$name bs=1024k count=10 > /dev/null
+    dd if=/dev/zero of=$name bs=1024k count=10 > /dev/null 2>&1
     losetup --find $name
     local dev=$(losetup --associated $name | cut -f1 -d:)
     local guid=$($uuidgen)
@@ -369,21 +372,18 @@ function loop_sanity_check() {
 function create_dev() {
     local name=$1
 
-    set -x
     echo create_dev $name >&2
     dd if=/dev/zero of=$name bs=1024k count=400 > /dev/null
     losetup --find $name
     local dev=$(losetup --associated $name | cut -f1 -d:)
     ceph-disk zap $dev > /dev/null 2>&1
     echo $dev
-    set +x
 }
 
 function destroy_dev() {
     local name=$1
     local dev=$2
 
-    set -x
     echo destroy_dev $name $dev >&2
     for partition in 1 2 3 4 ; do
         umount ${dev}p${partition} > /dev/null 2>&1 || true
@@ -391,7 +391,6 @@ function destroy_dev() {
     ceph-disk zap $dev > /dev/null 2>&1
     losetup --detach $dev
     rm $name
-    set +x
 }
 
 function activate_dev_body() {