3 # Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
4 # Copyright (C) 2014, 2015 Red Hat <contact@redhat.com>
6 # Author: Loic Dachary <loic@dachary.org>
7 # Author: Sage Weil <sage@redhat.com>
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU Library Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU Library Public License for more details.
20 source $CEPH_ROOT/qa/standalone/ceph-helpers.sh
26 export CEPH_MON="127.0.0.1:7111" # git grep '\<7111\>' : there must be only one
28 CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none "
29 CEPH_ARGS+="--mon-host=$CEPH_MON "
31 local funcs=${@:-$(set | sed -n -e 's/^\(TEST_[0-9a-z_]*\) .*/\1/p')}
32 for func in $funcs ; do
33 setup $dir || return 1
34 $func $dir || return 1
35 teardown $dir || return 1
39 function TEST_copy_from() {
42 run_mon $dir a || return 1
43 run_mgr $dir x || return 1
44 run_osd $dir 0 || return 1
45 run_osd $dir 1 || return 1
46 create_rbd_pool || return 1
49 rados -p rbd put foo $(which rados)
50 rados -p rbd cp foo foo2
51 rados -p rbd stat foo2
54 ceph tell osd.\* injectargs -- --osd-debug-inject-copyfrom-error
55 ! rados -p rbd cp foo foo3
56 ! rados -p rbd stat foo3
59 ceph tell osd.\* injectargs -- --no-osd-debug-inject-copyfrom-error
60 ! rados -p rbd cp foo foo3
61 rados -p rbd stat foo3
64 main osd-copy-from "$@"
67 # compile-command: "cd ../.. ; make -j4 && test/osd/osd-bench.sh"