summaryrefslogtreecommitdiffstats
path: root/etc/requirements.txt
blob: 7550086ff206d591e1e83051c80a19794cfcade8 (plain)
1
2
3
4
5
6
7
8
tox
Sphinx==1.3.1
doc8
docutils==0.12
setuptools
six
sphinxcontrib-httpdomain
sphinx_bootstrap_theme>=0.4.11
or: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
#!/usr/bin/env bash
#
# Copyright (C) 2017 Tencent <contact@tencent.com>
#
# Author: Chang Liu <liuchang0812@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Library Public License for more details.
#
source $CEPH_ROOT/qa/standalone/ceph-helpers.sh

function run() {
    local dir=$1
    shift

    export CEPH_MON="127.0.0.1:7113" # git grep '\<7113\>' : there must be only one
    export CEPH_ARGS
    CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none "
    CEPH_ARGS+="--mon-host=$CEPH_MON "

    local funcs=${@:-$(set | sed -n -e 's/^\(TEST_[0-9a-z_]*\) .*/\1/p')}
    for func in $funcs ; do
        setup $dir || return 1
        $func $dir || return 1
        teardown $dir || return 1
    done
}

function TEST_ceph_df() {
    local dir=$1
    setup $dir || return 1

    run_mon $dir a || return 1
    run_osd $dir 0 || return 1
    run_osd $dir 1 || return 1
    run_osd $dir 2 || return 1
    run_osd $dir 3 || return 1
    run_osd $dir 4 || return 1
    run_osd $dir 5 || return 1
    run_mgr $dir x || return 1

    profile+=" plugin=jerasure"
    profile+=" technique=reed_sol_van"
    profile+=" k=4"
    profile+=" m=2"
    profile+=" crush-failure-domain=osd"

    ceph osd erasure-code-profile set ec42profile ${profile}
 
    local rep_poolname=testcephdf_replicate
    local ec_poolname=testcephdf_erasurecode
    create_pool $rep_poolname 6 6 replicated
    create_pool $ec_poolname 6 6 erasure ec42profile

    local global_avail=`ceph df -f json | jq '.stats.total_avail_bytes'`
    local rep_avail=`ceph df -f json | jq '.pools | map(select(.name == "$rep_poolname"))[0].stats.max_avail'`
    local ec_avail=`ceph df -f json | jq '.pools | map(select(.name == "$ec_poolname"))[0].stats.max_avail'`

    echo "${global_avail} >= ${rep_avail}*3" | bc || return 1
    echo "${global_avail} >= ${ec_avail}*1.5" | bc || return 1

    ceph osd pool delete  $rep_poolname $rep_poolname  --yes-i-really-really-mean-it
    ceph osd pool delete  $ec_poolname $ec_poolname  --yes-i-really-really-mean-it
    ceph osd erasure-code-profile rm ec42profile
    teardown $dir || return 1
}

main osd-pool-df "$@"