From e4a43cf475f5a2d908cffdb518028ba74dc9f8b1 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 21 Oct 2010 04:51:47 +0000 Subject: added a test script to test rpc procedures Signed-off-by: Amar Tumballi Signed-off-by: Anand V. Avati BUG: 875 (Implement a new protocol to provide proper backward/forward compatibility) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=875 --- extras/rpc-coverage.sh | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100755 extras/rpc-coverage.sh 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} + -- cgit