Merge pull request #7899 from liewegas/wip-osd-markdown

test/osd: Relax the timing intervals in osd-markdown.sh
This commit is contained in:
Sage Weil 2016-03-08 11:20:54 -05:00
commit b533cf107a

View File

@ -38,8 +38,7 @@ function run() {
function markdown_N_impl() {
markdown_times=$1
total_time=$2
interval=$(($total_time / markdown_times))
sleep 10
sleeptime=$3
for i in `seq 1 $markdown_times`
do
# check the OSD is UP
@ -47,7 +46,7 @@ function markdown_N_impl() {
./ceph osd tree | grep osd.0 |grep up || return 1
# mark the OSD down.
./ceph osd down 0
sleep $interval
sleep $sleeptime
done
}
@ -59,13 +58,14 @@ function TEST_markdown_exceed_maxdown_count() {
run_osd $dir 0 || return 1
run_osd $dir 1 || return 1
run_osd $dir 2 || return 1
local count=5
local period=40
# 3+1 times within 120s, osd should stay dead on the 4th time
local count=3
local sleeptime=10
local period=120
ceph tell osd.0 injectargs '--osd_max_markdown_count '$count'' || return 1
ceph tell osd.0 injectargs '--osd_max_markdown_period '$period'' || return 1
markdown_N_impl $(($count+1)) $period
# down N+1 times ,the osd.0 shoud die
markdown_N_impl $(($count+1)) $period $sleeptime
./ceph osd tree | grep down | grep osd.0 || return 1
}
@ -77,12 +77,14 @@ function TEST_markdown_boot() {
run_osd $dir 1 || return 1
run_osd $dir 2 || return 1
local count=5
local period=40
# 3 times within 120s, should stay up
local count=3
local sleeptime=10
local period=120
ceph tell osd.0 injectargs '--osd_max_markdown_count '$count'' || return 1
ceph tell osd.0 injectargs '--osd_max_markdown_period '$period'' || return 1
markdown_N_impl $count $period
markdown_N_impl $count $period $sleeptime
#down N times, osd.0 should be up
./ceph osd tree | grep up | grep osd.0 || return 1
}
@ -95,13 +97,15 @@ function TEST_markdown_boot_exceed_time() {
run_osd $dir 1 || return 1
run_osd $dir 2 || return 1
local count=5
local period=40
# 3+1 times, but over 40s, > 20s, so should stay up
local count=3
local period=20
local sleeptime=10
ceph tell osd.0 injectargs '--osd_max_markdown_count '$count'' || return 1
ceph tell osd.0 injectargs '--osd_max_markdown_period '$period'' || return 1
#actually we will down 6 times in 60s, so the 5th down will be in 50s > period
markdown_N_impl $(($count+1)) $(($period + 20))
markdown_N_impl $(($count+1)) $period $sleeptime
./ceph osd tree | grep up | grep osd.0 || return 1
}