]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: test/osd/osd-config.sh uses ceph-helpers.sh
authorLoic Dachary <ldachary@redhat.com>
Sat, 16 May 2015 13:40:51 +0000 (15:40 +0200)
committerLoic Dachary <ldachary@redhat.com>
Sun, 17 May 2015 11:31:25 +0000 (13:31 +0200)
The ceph-helpers.sh was already included, along with
mon/mon-test-helpers.sh and osd/osd-test-helpers.sh which creates
confusion.

  * modifying the .asok and .log names to match the ceph-helpers.sh
    conventions

  * trim the --public-addr argument from the run_mon call

Signed-off-by: Loic Dachary <ldachary@redhat.com>
src/test/osd/osd-config.sh

index 3606f6381741d2ddc4f74abf060fd3728430eb9c..b244a4b4329950c938249adbc4865e09c4584f00 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 #
 # Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
-# Copyright (C) 2014 Red Hat <contact@redhat.com>
+# Copyright (C) 2014, 2015 Red Hat <contact@redhat.com>
 #
 # Author: Loic Dachary <loic@dachary.org>
 #
 # GNU Library Public License for more details.
 #
 
-source test/mon/mon-test-helpers.sh
-source test/osd/osd-test-helpers.sh
+source test/ceph-helpers.sh
 
 function run() {
     local dir=$1
+    shift
 
     export CEPH_MON="127.0.0.1:7100"
     export CEPH_ARGS
-    CEPH_ARGS+="--mon-host=$CEPH_MON "
     CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none "
+    CEPH_ARGS+="--mon-host=$CEPH_MON "
 
-    FUNCTIONS=${FUNCTIONS:-$(set | sed -n -e 's/^\(TEST_[0-9a-z_]*\) .*/\1/p')}
-    for TEST_function in $FUNCTIONS ; do
+    local funcs=${@:-$(set | sed -n -e 's/^\(TEST_[0-9a-z_]*\) .*/\1/p')}
+    for func in $funcs ; do
         setup $dir || return 1
-        $TEST_function $dir || return 1
+        $func $dir || return 1
         teardown $dir || return 1
     done
 }
@@ -38,8 +38,7 @@ function run() {
 function TEST_config_init() {
     local dir=$1
 
-    run_mon $dir a --public-addr=$CEPH_MON \
-        || return 1
+    run_mon $dir a || return 1
     local advance=1000
     local stale=1000
     local cache=500
@@ -49,15 +48,14 @@ function TEST_config_init() {
         --osd-pg-epoch-persisted-max-stale $stale \
         || return 1
     CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-osd.0.asok log flush || return 1
-    grep 'is not > osd_map_max_advance' $dir/osd-0.log || return 1
-    grep 'is not > osd_pg_epoch_persisted_max_stale' $dir/osd-0.log || return 1
+    grep 'is not > osd_map_max_advance' $dir/osd.0.log || return 1
+    grep 'is not > osd_pg_epoch_persisted_max_stale' $dir/osd.0.log || return 1
 }
 
 function TEST_config_track() {
     local dir=$1
 
-    run_mon $dir a --public-addr=$CEPH_MON \
-        || return 1
+    run_mon $dir a || return 1
     run_osd $dir 0 || return 1
 
     local osd_map_cache_size=$(CEPH_ARGS='' ./ceph-conf \
@@ -69,43 +67,43 @@ function TEST_config_track() {
     #
     # lower cache_size under max_advance to trigger the warning
     #
-    ! grep 'is not > osd_map_max_advance' $dir/osd-0.log || return 1
+    ! grep 'is not > osd_map_max_advance' $dir/osd.0.log || return 1
     local cache=$(($osd_map_max_advance / 2))
     ./ceph tell osd.0 injectargs "--osd-map-cache-size $cache" || return 1
     CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-osd.0.asok log flush || return 1
-    grep 'is not > osd_map_max_advance' $dir/osd-0.log || return 1
-    rm $dir/osd-0.log
+    grep 'is not > osd_map_max_advance' $dir/osd.0.log || return 1
+    rm $dir/osd.0.log
     CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-osd.0.asok log reopen || return 1
 
     #
     # reset cache_size to the default and assert that it does not trigger the warning
     #
-    ! grep 'is not > osd_map_max_advance' $dir/osd-0.log || return 1
+    ! grep 'is not > osd_map_max_advance' $dir/osd.0.log || return 1
     local cache=$osd_map_cache_size
     ./ceph tell osd.0 injectargs "--osd-map-cache-size $cache" || return 1
     CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-osd.0.asok log flush || return 1
-    ! grep 'is not > osd_map_max_advance' $dir/osd-0.log || return 1
+    ! grep 'is not > osd_map_max_advance' $dir/osd.0.log || return 1
 
     #
     # increase the osd_map_max_advance above the default cache_size
     #
-    ! grep 'is not > osd_map_max_advance' $dir/osd-0.log || return 1
+    ! grep 'is not > osd_map_max_advance' $dir/osd.0.log || return 1
     local advance=$(($osd_map_cache_size * 2))
     ./ceph tell osd.0 injectargs "--osd-map-max-advance $advance" || return 1
     CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-osd.0.asok log flush || return 1
-    grep 'is not > osd_map_max_advance' $dir/osd-0.log || return 1
+    grep 'is not > osd_map_max_advance' $dir/osd.0.log || return 1
 
     #
     # increase the osd_pg_epoch_persisted_max_stale above the default cache_size
     #
-    ! grep 'is not > osd_pg_epoch_persisted_max_stale' $dir/osd-0.log || return 1
+    ! grep 'is not > osd_pg_epoch_persisted_max_stale' $dir/osd.0.log || return 1
     local stale=$(($osd_map_cache_size * 2))
     ceph tell osd.0 injectargs "--osd-pg-epoch-persisted-max-stale $stale" || return 1
     CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-osd.0.asok log flush || return 1
-    grep 'is not > osd_pg_epoch_persisted_max_stale' $dir/osd-0.log || return 1
+    grep 'is not > osd_pg_epoch_persisted_max_stale' $dir/osd.0.log || return 1
 }
 
-main osd-config
+main osd-config "$@"
 
 # Local Variables:
 # compile-command: "cd ../.. ; make -j4 && test/osd/osd-config.sh"