function run() {
local dir=$1
+ export CEPH_MON="127.0.0.1:7101"
export CEPH_ARGS
CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none "
- CEPH_ARGS+="--mon-host=127.0.0.1 "
+ CEPH_ARGS+="--mon-host=$CEPH_MON "
setup $dir || return 1
- run_mon $dir a --public-addr 127.0.0.1 || return 1
+ run_mon $dir a --public-addr $CEPH_MON || return 1
# check that erasure code plugins are preloaded
CEPH_ARGS='' ./ceph --admin-daemon $dir/a/ceph-mon.a.asok log flush || return 1
grep 'load: jerasure.*lrc' $dir/a/log || return 1
#!/bin/bash
#
# Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
+# Copyright (C) 2014 Red Hat <contact@redhat.com>
#
# Author: Loic Dachary <loic@dachary.org>
#
function run() {
local dir=$1
+ export CEPH_MON="127.0.0.1:7102"
export CEPH_ARGS
CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none "
- CEPH_ARGS+="--mon-host=127.0.0.1 "
+ CEPH_ARGS+="--mon-host=$CEPH_MON "
setup $dir || return 1
- run_mon $dir a --public-addr 127.0.0.1
+ run_mon $dir a --public-addr $CEPH_MON
FUNCTIONS=${FUNCTIONS:-$(set | sed -n -e 's/^\(TEST_[0-9a-z_]*\) .*/\1/p')}
for TEST_function in $FUNCTIONS ; do
if ! $TEST_function $dir ; then
unset CEPH_ARGS
MON_ID=a
MON_DIR=$DIR/$MON_ID
-PORT=7451
-MONA=127.0.0.1:$PORT
+CEPH_MON=127.0.0.1:7110
TIMEOUT=360
function setup() {
--mkfs \
--mon-data=$MON_DIR \
--mon-initial-members=$MON_ID \
- --mon-host=$MONA \
+ --mon-host=$CEPH_MON \
"$@"
}
--mon-cluster-log-file=$MON_DIR/log \
--run-dir=$MON_DIR \
--pid-file=$MON_DIR/pidfile \
- --public-addr $MONA \
+ --public-addr $CEPH_MON \
"$@"
}
mon_run --auth-supported=none
- timeout $TIMEOUT ./ceph --mon-host $MONA mon stat || return 1
+ timeout $TIMEOUT ./ceph --mon-host $CEPH_MON mon stat || return 1
}
function auth_cephx_keyring() {
timeout $TIMEOUT ./ceph \
--name mon. \
--keyring $MON_DIR/keyring \
- --mon-host $MONA mon stat || return 1
+ --mon-host $CEPH_MON mon stat || return 1
}
function auth_cephx_key() {
timeout $TIMEOUT ./ceph \
--name mon. \
--keyring $MON_DIR/keyring \
- --mon-host $MONA mon stat || return 1
+ --mon-host $CEPH_MON mon stat || return 1
}
function makedir() {
#!/bin/bash
#
# Copyright (C) 2013 Cloudwatt <libre.licensing@cloudwatt.com>
+# Copyright (C) 2014 Red Hat <contact@redhat.com>
#
# Author: Loic Dachary <loic@dachary.org>
#
function run() {
local dir=$1
- PORT=7451
+ PORT=7300 # CEPH_MON=
MONA=127.0.0.1:$PORT
MONB=127.0.0.1:$(($PORT + 1))
(
#!/bin/bash
#
# Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
+# Copyright (C) 2014 Red Hat <contact@redhat.com>
#
# Author: Loic Dachary <loic@dachary.org>
#
function run() {
local dir=$1
+ export CEPH_MON="127.0.0.1:7104"
export CEPH_ARGS
CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none "
- CEPH_ARGS+="--mon-host=127.0.0.1 "
+ CEPH_ARGS+="--mon-host=$CEPH_MON "
FUNCTIONS=${FUNCTIONS:-$(set | sed -n -e 's/^\(TEST_[0-9a-z_]*\) .*/\1/p')}
for TEST_function in $FUNCTIONS ; do
setup $dir || return 1
- run_mon $dir a --public-addr 127.0.0.1
+ run_mon $dir a --public-addr $CEPH_MON
if ! $TEST_function $dir ; then
cat $dir/a/log
return 1
#!/bin/bash
#
# Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
+# Copyright (C) 2014 Red Hat <contact@redhat.com>
#
# Author: Loic Dachary <loic@dachary.org>
#
function run() {
local dir=$1
+ export CEPH_MON="127.0.0.1:7108"
export CEPH_ARGS
CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none "
- CEPH_ARGS+="--mon-host=127.0.0.1 "
+ CEPH_ARGS+="--mon-host=$CEPH_MON "
local id=a
- call_TEST_functions $dir $id --public-addr 127.0.0.1 || return 1
+ call_TEST_functions $dir $id --public-addr $CEPH_MON || return 1
}
function SHARE_MON_TEST_set() {
local profile=profile
# osd_pool_default_erasure-code-profile is
# valid JSON but not of the expected type
- run_mon $dir a --public-addr 127.0.0.1 \
+ run_mon $dir a --public-addr $CEPH_MON \
--osd_pool_default_erasure-code-profile 1
! ./ceph osd erasure-code-profile set $profile > $dir/out 2>&1 || return 1
cat $dir/out
# osd_pool_default_erasure-code-profile is JSON
expected='"plugin":"example"'
- run_mon $dir a --public-addr 127.0.0.1 \
+ run_mon $dir a --public-addr $CEPH_MON \
--osd_pool_default_erasure-code-profile "{$expected}"
./ceph --format json osd erasure-code-profile get default | \
grep "$expected" || return 1
# osd_pool_default_erasure-code-profile is plain text
expected='"plugin":"example"'
- run_mon $dir a --public-addr 127.0.0.1 \
+ run_mon $dir a --public-addr $CEPH_MON \
--osd_pool_default_erasure-code-profile "plugin=example"
./ceph --format json osd erasure-code-profile get default | \
grep "$expected" || return 1
function run() {
local dir=$1
+ export CEPH_MON="127.0.0.1:7105"
export CEPH_ARGS
CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none "
- CEPH_ARGS+="--mon-host=127.0.0.1 "
+ CEPH_ARGS+="--mon-host=$CEPH_MON "
FUNCTIONS=${FUNCTIONS:-$(set | sed -n -e 's/^\(TEST_[0-9a-z_]*\) .*/\1/p')}
for TEST_function in $FUNCTIONS ; do
local dir=$1
# explicitly set the default crush rule
expected=66
- run_mon $dir a --public-addr 127.0.0.1 \
+ run_mon $dir a --public-addr $CEPH_MON \
--osd_pool_default_crush_replicated_ruleset $expected
./ceph --format json osd dump | grep '"crush_ruleset":'$expected
CEPH_ARGS='' ./ceph --admin-daemon $dir/a/ceph-mon.a.asok log flush || return 1
local dir=$1
# explicitly set the default crush rule using deprecated option
expected=55
- run_mon $dir a --public-addr 127.0.0.1 \
+ run_mon $dir a --public-addr $CEPH_MON \
--osd_pool_default_crush_rule $expected
./ceph --format json osd dump | grep '"crush_ruleset":'$expected
CEPH_ARGS='' ./ceph --admin-daemon $dir/a/ceph-mon.a.asok log flush || return 1
local dir=$1
expected=77
unexpected=33
- run_mon $dir a --public-addr 127.0.0.1 \
+ run_mon $dir a --public-addr $CEPH_MON \
--osd_pool_default_crush_rule $expected \
--osd_pool_default_crush_replicated_ruleset $unexpected
./ceph --format json osd dump | grep '"crush_ruleset":'$expected
# Before http://tracker.ceph.com/issues/8307 the invalid profile was created
function TEST_erasure_invalid_profile() {
local dir=$1
- run_mon $dir a --public-addr 127.0.0.1
+ run_mon $dir a --public-addr $CEPH_MON
local poolname=pool_erasure
local notaprofile=not-a-valid-erasure-code-profile
! ./ceph osd pool create $poolname 12 12 erasure $notaprofile || return 1
function TEST_erasure_crush_rule() {
local dir=$1
- run_mon $dir a --public-addr 127.0.0.1
+ run_mon $dir a --public-addr $CEPH_MON
#
# choose the crush ruleset used with an erasure coded pool
#
function TEST_erasure_code_profile_default() {
local dir=$1
- run_mon $dir a --public-addr 127.0.0.1
+ run_mon $dir a --public-addr $CEPH_MON
./ceph osd erasure-code-profile rm default || return 1
! ./ceph osd erasure-code-profile ls | grep default || return 1
./ceph osd pool create $poolname 12 12 erasure default
function TEST_erasure_crush_stripe_width() {
local dir=$1
# the default stripe width is used to initialize the pool
- run_mon $dir a --public-addr 127.0.0.1
+ run_mon $dir a --public-addr $CEPH_MON
stripe_width=$(./ceph-conf --show-config-value osd_pool_erasure_code_stripe_width)
./ceph osd pool create pool_erasure 12 12 erasure
./ceph --format json osd dump | tee $dir/osd.json
expected_chunk_size=2048
actual_stripe_width=$(($expected_chunk_size * $k))
desired_stripe_width=$(($actual_stripe_width - 1))
- run_mon $dir a --public-addr 127.0.0.1 \
+ run_mon $dir a --public-addr $CEPH_MON \
--osd_pool_erasure_code_stripe_width $desired_stripe_width \
--osd_pool_default_erasure_code_profile "$profile"
./ceph osd pool create pool_erasure 12 12 erasure
function TEST_erasure_code_pool() {
local dir=$1
- run_mon $dir a --public-addr 127.0.0.1
+ run_mon $dir a --public-addr $CEPH_MON
./ceph --format json osd dump > $dir/osd.json
local expected='"erasure_code_profile":"default"'
! grep "$expected" $dir/osd.json || return 1
function TEST_replicated_pool_with_ruleset() {
local dir=$1
- run_mon $dir a --public-addr 127.0.0.1
+ run_mon $dir a --public-addr $CEPH_MON
local ruleset=ruleset0
local root=host1
./ceph osd crush add-bucket $root host
function TEST_erasure_code_pool_lrc() {
local dir=$1
- run_mon $dir a --public-addr 127.0.0.1
+ run_mon $dir a --public-addr $CEPH_MON
./ceph osd erasure-code-profile set LRCprofile \
plugin=lrc \
function TEST_replicated_pool() {
local dir=$1
- run_mon $dir a --public-addr 127.0.0.1
+ run_mon $dir a --public-addr $CEPH_MON
./ceph osd pool create replicated 12 12 replicated replicated_ruleset 2>&1 | \
grep "pool 'replicated' created" || return 1
./ceph osd pool create replicated 12 12 replicated replicated_ruleset 2>&1 | \
#!/bin/bash
#
# Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
+# Copyright (C) 2014 Red Hat <contact@redhat.com>
#
# Author: Loic Dachary <loic@dachary.org>
#
function run() {
local dir=$1
+ export CEPH_MON="127.0.0.1:7106"
export CEPH_ARGS
CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none "
- CEPH_ARGS+="--mon-host=127.0.0.1 "
+ CEPH_ARGS+="--mon-host=$CEPH_MON "
local id=a
- call_TEST_functions $dir $id --public-addr 127.0.0.1 || return 1
+ call_TEST_functions $dir $id || return 1
}
function TEST_bench() {
local dir=$1
- run_mon $dir a --public-addr 127.0.0.1 \
+ run_mon $dir a --public-addr $CEPH_MON \
|| return 1
run_osd $dir 0 || return 1
#!/bin/bash
#
# Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
+# Copyright (C) 2014 Red Hat <contact@redhat.com>
#
# Author: Loic Dachary <loic@dachary.org>
#
function run() {
local dir=$1
+ export CEPH_MON="127.0.0.1:7100"
export CEPH_ARGS
+ CEPH_ARGS+="--mon-host=$CEPH_MON "
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
+ call_TEST_functions $dir $id || return 1
}
function TEST_config_init() {
local dir=$1
- run_mon $dir a --public-addr 127.0.0.1 \
+ run_mon $dir a --public-addr=$CEPH_MON \
|| return 1
local advance=1000
local stale=1000
function TEST_config_track() {
local dir=$1
- run_mon $dir a --public-addr 127.0.0.1 \
+ run_mon $dir a --public-addr=$CEPH_MON \
|| return 1
run_osd $dir 0 || return 1
function run() {
local dir=$1
+ export CEPH_MON="127.0.0.1:7107"
export CEPH_ARGS
CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none "
- CEPH_ARGS+="--mon-host=127.0.0.1 "
+ CEPH_ARGS+="--mon-host=$CEPH_MON "
setup $dir || return 1
- run_mon $dir a --public-addr 127.0.0.1 || return 1
+ run_mon $dir a --public-addr $CEPH_MON || return 1
for id in $(seq 0 3) ; do
run_osd $dir $id || return 1
done