summaryrefslogtreecommitdiffstats
path: root/extras/rpc-coverage.sh
blob: 1f4dfcc9a9daff21aed17b81e48966afcbbd33ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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}