Based on our discussion...
A user's ~/.teuthology.yaml specifies the root of the
test directory by defining the value of "test_path", e.g.:
test_path: /tmp/cephtest/elder
By default, it's just /tmp/cephtest/<user>-<tstamp> or
/tmp/cephtest/<jobname>. Call this the "test root."
Within that, subdirectories are created for the role that's
executing the test (e.g., client.0, mon.b, mds.a, osd.3, etc.).
So, for example:
/tmp/cephtest/elder-<something>/workunit.client.0/
Call this the "role test path."
The scripts get copied from the git repository into
the role test path for execution. The things in that
directory are the same as are in the "qa/workunits"
directory of the ceph repository. I.e.
ls workunit.client.0/
caps false.sh kernel_untar_build.sh misc rbd suites
cephtool hadoop-internal-tests libcephfs mon rename
cls hadoop-wordcount libcephfs-java osdc restart
direct_io kclient Makefile rados snaps
ubuntu@mira096:/tmp/cephtest$
A mount point is created in the test root, and a file
system is mounted onto it, and that's where the tests
are actually run. Call that the "test mount point."
That is, something a bit like:
mkdir <test_root>/mnt.$$
mount /dev/<whatever> <test_root>/mnt.$$
cd <test_root>/mnt.$$
<role_test_path>/script.sh
Apparently the test script will be launched using its
absolute path, so it should be possible to derive that
and the test using something like:
ROLE_TEST_PATH=$(dirname $0)
TEST_MOUNT_POINT=$(pwd)
It should therefore be possible to include an rbd script
library using the above and something like:
source "${ROLE_TEST_PATH}/rbd/rbd_common.sh"
And make sure that's
not checked in as an
executable script (so it won't be considered
runnable by the workunit task). Or maybe
move it elsewhere under qa/workunits that will
not be treated that way (if that's possible).
OK, I think that's about all the background
we should need.