3 source $
(dirname $0)/..
/detect-build-env-vars.sh
4 source $CEPH_ROOT/qa
/workunits
/ceph-helpers.sh
9 i
[[3456]]86*|x86_64
*|amd64
*)
10 legacy_jerasure_plugins
=(jerasure_generic jerasure_sse3 jerasure_sse4
)
11 legacy_shec_plugins
=(shec_generic shec_sse3 shec_sse4
)
12 plugins
=(jerasure shec lrc isa
)
15 legacy_jerasure_plugins
=(jerasure_generic jerasure_neon
)
16 legacy_shec_plugins
=(shec_generic shec_neon
)
17 plugins
=(jerasure shec lrc
)
20 echo "unsupported platform ${arch}."
29 export CEPH_MON
="127.0.0.1:17110" # git grep '\<17110\>' : there must be only one
31 CEPH_ARGS
+="--fsid=$(uuidgen) --auth-supported=none "
32 CEPH_ARGS
+="--mon-host=$CEPH_MON "
34 local funcs
=${@:-$(set | sed -n -e 's/^\(TEST_[0-9a-z_]*\) .*/\1/p')}
35 for func
in $funcs ; do
36 $func $dir ||
return 1
40 function TEST_preload_warning
() {
43 for plugin
in ${legacy_jerasure_plugins[*]} ${legacy_shec_plugins[*]}; do
44 setup
$dir ||
return 1
45 run_mon
$dir a
--osd_erasure_code_plugins="${plugin}" ||
return 1
46 run_mgr
$dir x ||
return 1
47 CEPH_ARGS
='' ceph
--admin-daemon $dir/ceph-mon.a.asok log flush ||
return 1
48 run_osd
$dir 0 --osd_erasure_code_plugins="${plugin}" ||
return 1
49 CEPH_ARGS
='' ceph
--admin-daemon $dir/ceph-osd
.0.asok log flush ||
return 1
50 grep "WARNING: osd_erasure_code_plugins contains plugin ${plugin}" $dir/mon.a.log ||
return 1
51 grep "WARNING: osd_erasure_code_plugins contains plugin ${plugin}" $dir/osd
.0.log ||
return 1
52 teardown
$dir ||
return 1
57 function TEST_preload_no_warning
() {
60 for plugin
in ${plugins[*]}; do
61 setup
$dir ||
return 1
62 run_mon
$dir a
--osd_erasure_code_plugins="${plugin}" ||
return 1
63 run_mgr
$dir x ||
return 1
64 CEPH_ARGS
='' ceph
--admin-daemon $dir/ceph-mon.a.asok log flush ||
return 1
65 run_osd
$dir 0 --osd_erasure_code_plugins="${plugin}" ||
return 1
66 CEPH_ARGS
='' ceph
--admin-daemon $dir/ceph-osd
.0.asok log flush ||
return 1
67 ! grep "WARNING: osd_erasure_code_plugins contains plugin" $dir/mon.a.log ||
return 1
68 ! grep "WARNING: osd_erasure_code_plugins contains plugin" $dir/osd
.0.log ||
return 1
69 teardown
$dir ||
return 1
75 function TEST_preload_no_warning_default
() {
78 setup
$dir ||
return 1
79 run_mon
$dir a ||
return 1
80 CEPH_ARGS
='' ceph
--admin-daemon $dir/ceph-mon.a.asok log flush ||
return 1
81 run_mgr
$dir x ||
return 1
82 run_osd
$dir 0 ||
return 1
83 CEPH_ARGS
='' ceph
--admin-daemon $dir/ceph-osd
.0.asok log flush ||
return 1
84 ! grep "WARNING: osd_erasure_code_plugins" $dir/mon.a.log ||
return 1
85 ! grep "WARNING: osd_erasure_code_plugins" $dir/osd
.0.log ||
return 1
86 teardown
$dir ||
return 1
91 function TEST_ec_profile_warning
() {
94 setup
$dir ||
return 1
95 run_mon
$dir a ||
return 1
96 run_mgr
$dir x ||
return 1
97 for id
in $
(seq 0 2) ; do
98 run_osd
$dir $id ||
return 1
100 wait_for_clean ||
return 1
102 for plugin
in ${legacy_jerasure_plugins[*]}; do
103 ceph osd erasure-code-profile
set prof-
${plugin} ruleset-failure-domain
=osd technique
=reed_sol_van plugin
=${plugin} ||
return 1
104 CEPH_ARGS
='' ceph
--admin-daemon $dir/ceph-mon.a.asok log flush ||
return 1
105 grep "WARNING: erasure coding profile prof-${plugin} uses plugin ${plugin}" $dir/mon.a.log ||
return 1
108 for plugin
in ${legacy_shec_plugins[*]}; do
109 ceph osd erasure-code-profile
set prof-
${plugin} ruleset-failure-domain
=osd plugin
=${plugin} ||
return 1
110 CEPH_ARGS
='' ceph
--admin-daemon $dir/ceph-mon.a.asok log flush ||
return 1
111 grep "WARNING: erasure coding profile prof-${plugin} uses plugin ${plugin}" $dir/mon.a.log ||
return 1
114 teardown
$dir ||
return 1
117 main test-erasure-code-plugins
"$@"