diff options
Diffstat (limited to 'extras')
-rwxr-xr-x | extras/rpc-coverage.sh | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/extras/rpc-coverage.sh b/extras/rpc-coverage.sh new file mode 100755 index 00000000000..1f4dfcc9a9d --- /dev/null +++ b/extras/rpc-coverage.sh @@ -0,0 +1,83 @@ +#!/bin/sh + +# This script can be used to provoke 35 fops (if afr is used), +# 28 fops (if afr is not used) (-fstat,-readdirp, and lk,xattrop calls) +# Pending are 7 procedures. +# getspec, fsyncdir, access, fentrylk, fsetxattr, fgetxattr, rchecksum +# TODO: add commands which can generate fops for missing fops + +## Script tests below File Operations over RPC (when afr is used) + +# CREATE +# ENTRYLK +# FINODELK +# FLUSH +# FSTAT +# FSYNC +# FTRUNCATE +# FXATTROP +# GETXATTR +# INODELK +# LINK +# LK +# LOOKUP +# MKDIR +# MKNOD +# OPEN +# OPENDIR +# READ +# READDIR +# READDIRP +# READLINK +# RELEASE +# RELEASEDIR +# REMOVEXATTR +# RENAME +# RMDIR +# SETATTR +# SETXATTR +# STAT +# STATFS +# SYMLINK +# TRUNCATE +# UNLINK +# WRITE +# XATTROP + +set -e + +MOUNTPOINT=$1; + +[ -z $MOUNTPOINT ] && { + MOUNTPOINT="/mnt/glusterfs"; +} +current_dir=$PWD; + +TESTDIR="${MOUNTPOINT}/fop-test-$(date +%Y%m%d%H%M%S)" +mkdir $TESTDIR; +cd $TESTDIR; + +echo "Lets see open working" >> testfile; +echo "Lets see truncate working 012345678" > testfile; +truncate -s 30 testfile; +mkdir testdir; +mkfifo testfifo; +ln testfile testfile-ln; +ln -sf testfile testfile-symlink; +mv testfile-symlink testfile-symlink-mv; +chmod 0777 testfile; +flock -x testfile.lock dd if=/dev/zero of=testfile1 conv=fsync bs=1M count=2 > /dev/null 2>&1; +cat testfile1 > /dev/null; +ls -lR . > /dev/null; +setfattr -n trusted.rpc.coverage -v testing testfile; +getfattr -d -m . testfile > /dev/null; +setfattr -x trusted.rpc.coverage testfile; +df -h testdir > /dev/null; + +rm -f testfifo testfile testfile1 testfile-ln testfile.lock testfile-symlink-mv; +rmdir testdir; + +cd $current_dir; + +rmdir ${TESTDIR} + |