]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: use different ports for each mon
authorLoic Dachary <loic-201408@dachary.org>
Sat, 18 Oct 2014 20:15:41 +0000 (13:15 -0700)
committerLoic Dachary <ldachary@redhat.com>
Sun, 9 Nov 2014 10:59:02 +0000 (11:59 +0100)
Run the mon on each test on a different port so they can run in
parallel.

http://tracker.ceph.com/issues/9815 Fixes: #9815

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
src/test/erasure-code/test-erasure-code.sh
src/test/mon/misc.sh
src/test/mon/mkfs.sh
src/test/mon/mon-handle-forward.sh
src/test/mon/osd-crush.sh
src/test/mon/osd-erasure-code-profile.sh
src/test/mon/osd-pool-create.sh
src/test/osd/osd-bench.sh
src/test/osd/osd-config.sh
src/test/osd/osd-scrub-repair.sh

index b8a10212192c827f1662db591f238fb291259452..41bee7b49f90d32a3c6925a4c859b3899b47d2a1 100755 (executable)
@@ -22,12 +22,13 @@ source test/osd/osd-test-helpers.sh
 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
index 1c8caa0a7a41fcf1c4ab970a530b2f948d5ce3ef..8201be73eaf97c9d608d954ad71dfd6ee8477e7b 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/bash
 #
 # Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
+# Copyright (C) 2014 Red Hat <contact@redhat.com>
 #
 # Author: Loic Dachary <loic@dachary.org>
 #
@@ -19,12 +20,13 @@ source test/mon/mon-test-helpers.sh
 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
index fbf560be26f2bdc2262402612e20ba40b1d530de..13b9a1bec9cb05e76fbc7c9d958c12be88e15973 100755 (executable)
@@ -23,8 +23,7 @@ export CEPH_CONF=/dev/null
 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() {
@@ -47,7 +46,7 @@ function mon_mkfs() {
         --mkfs \
         --mon-data=$MON_DIR \
         --mon-initial-members=$MON_ID \
-        --mon-host=$MONA \
+        --mon-host=$CEPH_MON \
         "$@"
 }
 
@@ -63,7 +62,7 @@ function mon_run() {
         --mon-cluster-log-file=$MON_DIR/log \
         --run-dir=$MON_DIR \
         --pid-file=$MON_DIR/pidfile \
-        --public-addr $MONA \
+        --public-addr $CEPH_MON \
         "$@"
 }
 
@@ -94,7 +93,7 @@ function auth_none() {
 
     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() {
@@ -113,7 +112,7 @@ EOF
     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() {
@@ -140,7 +139,7 @@ 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() {
index 6f3ea676f9057da3d192265768922b6a55215b69..bdbe72e4b471986f0e5c76d64376e6799620a50b 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/bash
 #
 # Copyright (C) 2013 Cloudwatt <libre.licensing@cloudwatt.com>
+# Copyright (C) 2014 Red Hat <contact@redhat.com>
 #
 # Author: Loic Dachary <loic@dachary.org>
 #
@@ -19,7 +20,7 @@ source test/mon/mon-test-helpers.sh
 function run() {
     local dir=$1
 
-    PORT=7451
+    PORT=7300 # CEPH_MON=
     MONA=127.0.0.1:$PORT
     MONB=127.0.0.1:$(($PORT + 1))
     (
index e7a98e8166b824b3169d3c228d2f4dc5938cdb35..4b1c601d41aac40d85a5addaa3881332fc916b9a 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/bash
 #
 # Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
+# Copyright (C) 2014 Red Hat <contact@redhat.com>
 #
 # Author: Loic Dachary <loic@dachary.org>
 #
@@ -19,14 +20,15 @@ source test/mon/mon-test-helpers.sh
 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
index fd0cf73692e3031a29f9e5ef0882f696746c1909..5b9fc33dc4eac1c39ddfe02c1de387d95c456664 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/bash
 #
 # Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
+# Copyright (C) 2014 Red Hat <contact@redhat.com>
 #
 # Author: Loic Dachary <loic@dachary.org>
 #
@@ -19,12 +20,13 @@ source test/mon/mon-test-helpers.sh
 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() {
@@ -113,7 +115,7 @@ function TEST_format_invalid() {
     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
@@ -125,7 +127,7 @@ function TEST_format_json() {
 
     # 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
@@ -136,7 +138,7 @@ function TEST_format_plain() {
 
     # 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
index cbcd65c7b8175569bd67d9de147a90de14cb4a4e..1cae8a644a1c994cc3ec7300fe0339574e048ff2 100755 (executable)
@@ -20,9 +20,10 @@ source test/mon/mon-test-helpers.sh
 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
@@ -36,7 +37,7 @@ function TEST_default_deprectated_0() {
     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
@@ -47,7 +48,7 @@ function TEST_default_deprectated_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
@@ -58,7 +59,7 @@ function TEST_default_deprectated_2() {
     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
@@ -70,7 +71,7 @@ function TEST_default_deprectated_2() {
 # 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
@@ -79,7 +80,7 @@ function TEST_erasure_invalid_profile() {
 
 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
     #
@@ -109,7 +110,7 @@ function TEST_erasure_crush_rule() {
 
 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
@@ -119,7 +120,7 @@ function TEST_erasure_code_profile_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
@@ -138,7 +139,7 @@ function TEST_erasure_crush_stripe_width_padded() {
     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
@@ -148,7 +149,7 @@ function TEST_erasure_crush_stripe_width_padded() {
 
 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
@@ -164,7 +165,7 @@ function TEST_erasure_code_pool() {
 
 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
@@ -184,7 +185,7 @@ function TEST_replicated_pool_with_ruleset() {
 
 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 \
@@ -203,7 +204,7 @@ function TEST_erasure_code_pool_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 | \
index 6feb8418e9e9cc9fcf4cb15a6558565d90d7307e..b4ae3fd4ff154531e3f13851f5a5f08084716b0b 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/bash
 #
 # Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
+# Copyright (C) 2014 Red Hat <contact@redhat.com>
 #
 # Author: Loic Dachary <loic@dachary.org>
 #
@@ -21,18 +22,19 @@ source test/osd/osd-test-helpers.sh
 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
 
index 042a2280141b2cc29003587453dcb366c8e5b4ff..aceda0cf121bffd08eb320eea87762d5f34a94b1 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/bash
 #
 # Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
+# Copyright (C) 2014 Red Hat <contact@redhat.com>
 #
 # Author: Loic Dachary <loic@dachary.org>
 #
@@ -21,18 +22,19 @@ source test/osd/osd-test-helpers.sh
 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
@@ -50,7 +52,7 @@ function TEST_config_init() {
 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
 
index 0c805b0b69e39c8ce5d7d09d51153ed1807b360e..a24237b2925b009fdbc39052092e65bc40445560 100755 (executable)
@@ -21,12 +21,13 @@ source test/osd/osd-test-helpers.sh
 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