]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: verify osd config sanity checks
authorLoic Dachary <loic@dachary.org>
Sun, 15 Jun 2014 09:12:15 +0000 (11:12 +0200)
committerSage Weil <sage@inktank.com>
Mon, 16 Jun 2014 19:28:33 +0000 (12:28 -0700)
Signed-off-by: Loic Dachary <loic@dachary.org>
src/test/Makefile.am
src/test/osd/osd-config.sh [new file with mode: 0755]

index 1640b8bbf40f6345dc1025b8867849112d052114..008542e01ca768cde74b443bdc6b6186cdc72078 100644 (file)
@@ -238,6 +238,7 @@ check_SCRIPTS += \
        test/mon/osd-crush.sh \
        test/mon/osd-erasure-code-profile.sh \
        test/mon/mkfs.sh \
+       test/osd/osd-config.sh \
        test/ceph-disk.sh \
        test/mon/mon-handle-forward.sh \
        test/vstart_wrapped_tests.sh
diff --git a/src/test/osd/osd-config.sh b/src/test/osd/osd-config.sh
new file mode 100755 (executable)
index 0000000..1f38319
--- /dev/null
@@ -0,0 +1,77 @@
+#!/bin/bash
+#
+# Copyright (C) 2014 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.
+#
+
+source test/mon/mon-test-helpers.sh
+source test/osd/osd-test-helpers.sh
+
+function run() {
+    local dir=$1
+
+    export CEPH_ARGS
+    CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none "
+    CEPH_ARGS+="--mon-host=127.0.0.1 "
+
+    local id=a
+    call_TEST_functions $dir $id --public-addr 127.0.0.1 || return 1
+}
+
+function TEST_config_init() {
+    local dir=$1
+
+    run_mon $dir a --public-addr 127.0.0.1 \
+        || return 1
+    local advance=1000
+    local stale=1000
+    local cache=500
+    run_osd $dir 0 \
+        --osd-map-max-advance $advance \
+        --osd-map-cache-size $cache \
+        --osd-pg-epoch-persisted-max-stale $stale \
+        || return 1
+    find $dir
+    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
+}
+
+function TEST_config_track() {
+    local dir=$1
+
+    run_mon $dir a --public-addr 127.0.0.1 \
+        || return 1
+    run_osd $dir 0 || return 1
+
+    ! grep 'is not > osd_map_max_advance' $dir/osd-0.log || return 1
+    local advance=1000
+    local cache=500
+    ./ceph tell osd.0 injectargs "--osd-map-cache-size $cache" || return 1
+    ./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_pg_epoch_persisted_max_stale' $dir/osd-0.log || return 1
+    local stale=1000
+    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
+}
+
+main osd-config
+
+# Local Variables:
+# compile-command: "cd ../.. ; make -j4 && test/osd/osd-config.sh"
+# End: