osd: verify osd config sanity checks

Signed-off-by: Loic Dachary <loic@dachary.org>
This commit is contained in:
Loic Dachary 2014-06-15 11:12:15 +02:00 committed by Sage Weil
parent 84948517e9
commit 1c72465187
2 changed files with 78 additions and 0 deletions

View 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

77
src/test/osd/osd-config.sh Executable file
View File

@ -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: