From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- qa/client/common.sh | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 qa/client/common.sh (limited to 'qa/client/common.sh') diff --git a/qa/client/common.sh b/qa/client/common.sh new file mode 100644 index 00000000..d06368e6 --- /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 +} -- cgit v1.2.3