]>
git.proxmox.com Git - ceph.git/blob - ceph/src/test/vstart_wrapper.sh
3 # Copyright (C) 2013 Cloudwatt <libre.licensing@cloudwatt.com>
4 # Copyright (C) 2015 Red Hat <contact@redhat.com>
6 # Author: Loic Dachary <loic@dachary.org>
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU Library Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU Library Public License for more details.
19 source $CEPH_ROOT/qa
/standalone
/ceph-helpers.sh
21 export CEPH_VSTART_WRAPPER
=1
22 export CEPH_DIR
="${TMPDIR:-$PWD}/td/t-$CEPH_PORT"
23 export CEPH_DEV_DIR
="$CEPH_DIR/dev"
24 export CEPH_OUT_DIR
="$CEPH_DIR/out"
25 export CEPH_ASOK_DIR
="$CEPH_DIR/out"
27 export MGR_PYTHON_PATH
=$CEPH_ROOT/src
/pybind
/mgr
29 function vstart_setup
()
31 rm -fr $CEPH_DEV_DIR $CEPH_OUT_DIR
32 mkdir
-p $CEPH_DEV_DIR
33 trap "teardown $CEPH_DIR" EXIT
34 export LC_ALL
=C
# some tests are vulnerable to i18n
35 export PATH
="$(pwd):${PATH}"
37 if [ "bluestore" = "${CEPH_OBJECTSTORE}" ]; then
40 $CEPH_ROOT/src
/vstart.sh \
43 -o 'paxos propose interval = 0.01' \
45 export CEPH_CONF
=$CEPH_DIR/ceph.conf
47 crit
=$
(expr 100 - $
(ceph-conf
--show-config-value mon_data_avail_crit
))
48 if [ $
(df . | perl
-ne 'print if(s/.*\s(\d+)%.*/\1/)') -ge $crit ] ; then
51 error: not enough free disk space for mon to run
52 The mon will shutdown with a message such as
53 "reached critical levels of available space on local monitor storage -- shutdown!"
54 as soon as it finds the disk has is more than ${crit}% full.
55 This is a limit determined by
56 ceph-conf --show-config-value mon_data_avail_crit
65 vstart_setup ||
return 1
66 if CEPH_CONF
=$CEPH_DIR/ceph.conf
"$@"; then
70 display_logs
$CEPH_OUT_DIR