Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/osd: Relax the timing intervals in osd-markdown.sh #7899

Merged
merged 1 commit into from Mar 8, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 18 additions & 14 deletions src/test/osd/osd-markdown.sh
Expand Up @@ -38,16 +38,15 @@ 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
./ceph osd tree
./ceph osd tree | grep osd.0 |grep up || return 1
# mark the OSD down.
./ceph osd down 0
sleep $interval
sleep $sleeptime
done
}

Expand All @@ -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
}

Expand All @@ -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
}
Expand All @@ -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
}

Expand Down