summaryrefslogtreecommitdiffstats
path: root/qa/client/common.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
commit19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch)
tree42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /qa/client/common.sh
parentInitial commit. (diff)
downloadceph-6d07fdb6bb33b1af39833b850bb6cf8af79fe293.tar.xz
ceph-6d07fdb6bb33b1af39833b850bb6cf8af79fe293.zip
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'qa/client/common.sh')
-rw-r--r--qa/client/common.sh58
1 files changed, 58 insertions, 0 deletions
diff --git a/qa/client/common.sh b/qa/client/common.sh
new file mode 100644
index 000000000..d06368e6e
--- /dev/null
+++ b/qa/client/common.sh
@@ -0,0 +1,58 @@
+
+# defaults
+[ -z "$bindir" ] && bindir=$PWD # location of init-ceph
+[ -z "$conf" ] && conf="$basedir/ceph.conf"
+[ -z "$mnt" ] && mnt="/c"
+[ -z "$monhost" ] && monhost="cosd0"
+
+set -e
+
+mydir=`hostname`_`echo $0 | sed 's/\//_/g'`
+
+client_mount()
+{
+ /bin/mount -t ceph $monhost:/ $mnt
+}
+
+client_umount()
+{
+ /bin/umount $mnt
+ # look for VFS complaints
+ if dmesg | tail -n 50 | grep -c "VFS: Busy inodes" ; then
+ echo "looks like we left inodes pinned"
+ exit 1
+ fi
+}
+
+ceph_start()
+{
+ $bindir/init-ceph -c $conf start ${1}
+}
+
+ceph_stop()
+{
+ $bindir/init-ceph -c $conf stop ${1}
+}
+
+ceph_restart()
+{
+ $bindir/init-ceph -c $conf restart ${1}
+}
+
+ceph_command()
+{
+ $bindir/ceph -c $conf $*
+}
+
+client_enter_mydir()
+{
+ pushd .
+ test -d $mnt/$mydir && rm -r $mnt/$mydir
+ mkdir $mnt/$mydir
+ cd $mnt/$mydir
+}
+
+client_leave_mydir()
+{
+ popd
+}