X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fqa%2Fclient%2Fcommon.sh;fp=src%2Fceph%2Fqa%2Fclient%2Fcommon.sh;h=d06368e6ea758a52960d66b8ebc7923f12ba64a8;hb=812ff6ca9fcd3e629e49d4328905f33eee8ca3f5;hp=0000000000000000000000000000000000000000;hpb=15280273faafb77777eab341909a3f495cf248d9;p=stor4nfv.git diff --git a/src/ceph/qa/client/common.sh b/src/ceph/qa/client/common.sh new file mode 100644 index 0000000..d06368e --- /dev/null +++ b/src/ceph/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 +}