summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrambk@gmail.com>2011-07-13 18:32:10 +0530
committerRaghavendra Bhat <raghavendrambk@gmail.com>2011-07-13 18:32:10 +0530
commitd0de625d5cf9a84840bdd2fa1a88b9614d428cb6 (patch)
tree78011ee5fd1571a1af0b80f4ef406f6d475b6bb3
parentbf87a7d06b054005040dad8dd7ac878210e8939f (diff)
sanity script for testing the functionality of filesystem
-rw-r--r--INFO1
-rwxr-xr-xsanity/system_light/config139
-rwxr-xr-xsanity/system_light/config~139
-rwxr-xr-xsanity/system_light/pm.config3
-rw-r--r--sanity/system_light/profile_everything119
-rwxr-xr-xsanity/system_light/run.sh407
-rwxr-xr-xsanity/system_light/run.sh~408
-rwxr-xr-xsanity/system_light/run_nfs.sh101
-rwxr-xr-xsanity/system_light/scripts/#kernel.sh#44
-rwxr-xr-xsanity/system_light/scripts/arequal_test.sh23
-rwxr-xr-xsanity/system_light/scripts/blazer.sh25
-rwxr-xr-xsanity/system_light/scripts/bonnie_test.sh18
-rwxr-xr-xsanity/system_light/scripts/dbench_test.sh20
-rwxr-xr-xsanity/system_light/scripts/dd_test.sh19
-rwxr-xr-xsanity/system_light/scripts/ffsb_test.sh19
-rwxr-xr-xsanity/system_light/scripts/fileop_test.sh22
-rwxr-xr-xsanity/system_light/scripts/fsx_test.sh21
-rwxr-xr-xsanity/system_light/scripts/glusterfs_build.sh48
-rwxr-xr-xsanity/system_light/scripts/iozone_test.sh20
-rwxr-xr-xsanity/system_light/scripts/kernel.sh44
-rwxr-xr-xsanity/system_light/scripts/kernel.sh~43
-rwxr-xr-xsanity/system_light/scripts/kernel_compile.sh262
-rwxr-xr-xsanity/system_light/scripts/lmbench_test.sh7
-rwxr-xr-xsanity/system_light/scripts/locks.sh39
-rwxr-xr-xsanity/system_light/scripts/ltp_test.sh335
-rwxr-xr-xsanity/system_light/scripts/ltp_test.sh~335
-rw-r--r--sanity/system_light/scripts/mmapstress.sh83
-rwxr-xr-xsanity/system_light/scripts/multiple_files.sh43
-rwxr-xr-xsanity/system_light/scripts/open.sh45
-rwxr-xr-xsanity/system_light/scripts/posix_compliance.sh6
-rwxr-xr-xsanity/system_light/scripts/postmark.sh19
-rwxr-xr-xsanity/system_light/scripts/read_large.sh17
-rwxr-xr-xsanity/system_light/scripts/rpc-coverage.sh481
-rwxr-xr-xsanity/system_light/scripts/rpc-fops.sh19
-rw-r--r--sanity/system_light/scripts/rpc-fops.sh~20
-rwxr-xr-xsanity/system_light/scripts/syscallbench.sh33
-rwxr-xr-xsanity/system_light/scripts/tiobench.sh17
37 files changed, 3444 insertions, 0 deletions
diff --git a/INFO b/INFO
index 7444eb3..1a76532 100644
--- a/INFO
+++ b/INFO
@@ -1,5 +1,6 @@
sanity/nightly_valgrind/ ---> script used for nightly valgrind run.
sanity/dev_sanity/ ---> script used for dev_sanity test.
+sanity/system_light/ ---> script which checks for the sanity of the filesystem by conducting tests and running tools
===============================================
community-scripts/rename/ ---> few scripts which catch rename related issues in dht(note it might expose rename issues in other xlators too).
diff --git a/sanity/system_light/config b/sanity/system_light/config
new file mode 100755
index 0000000..0377604
--- /dev/null
+++ b/sanity/system_light/config
@@ -0,0 +1,139 @@
+
+#Test path i.e. the path where the configuration file resides.Execution must be done from the saopt location where it resides
+export CONF_FILE=/opt/qa/tools/system_light/config
+
+#Directory from which the script is invoked
+export INVOKEDIR=$PWD
+
+export ERR=0
+
+#The log file where the error optassages and the tiopt duration should be logged
+export TMP="/mnt/logs"
+export LOG_FILE="$TMP/time$$.log"
+export TEST_DIR=$PWD
+export DECISION="n"
+export TYPE="other"
+
+while getopts 'w:t:l:D' option
+do
+ case $option in
+ w)
+ TEST_DIR="$OPTARG"
+ ;;
+ l)
+ LOG_FILE="$OPTARG"
+ ;;
+ D)
+ DECISION="$OPTARG"
+ ;;
+ t)
+ TYPE="$OPTARG"
+ ;;
+ esac
+done
+
+# Do you want thetest to be terminated on first falure? Press y if you want to
+if [ "$DECISION" = "y" ]; then
+ set -e;
+fi
+
+#File where failed tests are saved"
+export LOG_DIR=$(dirname $LOG_FILE)
+#mkdir $LOG_DIR/tests_failed
+export TEST_FAIL=$LOG_DIR/tests_failed
+
+#GlusterFS mount point
+export GF_MP=$TEST_DIR
+export THIS_TEST_DIR=$TEST_DIR/run$$/
+mkdir $THIS_TEST_DIR
+
+#The path which contains the binaries of arequal,postmark,dbench,fileop etc if they are not installed in the system
+export PATH=$PATH:/opt/qa/tools
+export BIN_PATH=/opt/qa/tools
+
+#Arequal related variables
+export ARE_SRC_DIR=/opt/qa/tools/ #The Directory in which the file or the directory being tested is present
+export FILEORDIR=system_light #THe file or the directory to be tested
+export ARE_SRC=$ARE_SRC_DIR$FILEORDIR
+export ARE_DST=$THIS_TEST_DIR$FILEORDIR #The destination directory where the test file should be copied
+
+#Bonnie Related variables
+export USER_NAME=`whoami`
+export WD=$THIS_TEST_DIR
+
+#dbench related variables
+export TIME=300
+export DBENCH_CLNTS=10
+
+#dd related variables
+export OF=dd_test
+export BS_SIZE=100M
+export DD_CNT=10
+
+#Read from the large file
+export LARGE_FILE_SOURCE=$THIS_TEST_DIR/$OF
+export LARGE_FILE_DEST=/dev/null
+
+#fileop related variables
+#export FILEOP_SIZE=100
+export FILEOP_CNT=30
+
+#fsx related variables
+export FSX_FILE_ORIG=/opt/qa/tools/read
+export FSX_FILE=$(basename $FSX_FILE_ORIG)
+export NUM_OPS=100 #Number of operations to be perforoptd default is infinity
+
+#ffsb related variables
+export FFSB_FILE=$THIS_TEST_DIR/profile_everything
+
+#glusterfs build
+export GFS_VERSION=3.0.0pre2
+export GLUSTERFS_TAR_FILE=/opt/qa/tools/glusterfs-$GFS_VERSION.tar.gz
+export GLUSTERFS_DIR=glusterfs.git
+
+#ioblazer related variables
+export BLAZER_DIR=$THIS_TEST_DIR;
+
+#iozone related variables
+export FILE_SIZE=4g
+export RECORD_SIZE=22k
+
+# kernel related variables
+#export SCRIPTS_PATH="/opt/qa/tools/system_light/scripts"
+export VERSION=2.6.31.1
+export KERNEL_PATH=/opt/qa/tools/linux-$VERSION.tar.bz2
+
+#ltp related variables
+export LTP_DIR=/opt/qa/tools/ltp-full-20091031/testcases/kernel/fs/
+
+#locks related variables
+export LOCK_BIN=/opt/qa/tools/locks/locktests
+export CON_PROC=22
+export LOCK_TEST_FILE=$THIS_TEST_DIR/locks_test
+
+#lmbench related variables
+export LM_DIR=lmbench-3.0-a9
+export SRC_DIR=$BIN_PATH/lmbench-3.0-a9
+
+#openssl related variables
+export OPENSSL_TAR_FILE="/opt/qa/tools/openssl-0.9.8c.tar.gz"
+export OPENSSL_DIR="openssl-0.9.8c"
+export PREFIX=''
+export OPENSSLDIR=''
+
+#posix compliance related variables
+export DIR="/opt/qa/tools/posix-testsuite";
+
+#postmark related variables
+export POST_FILE=/opt/qa/tools/system_light/pm.config
+
+#Multiple file related variables
+export NUM_OF_FILES=100000
+
+#syscallbench related variables
+export TOOL_DIR=/opt/qa/tools/tools.git
+export SYSCALL_BIN=$TOOL_DIR/syscallbench/syscallbench
+export SYSCALL_PLOT=$TOOL_DIR/syscallbench/syscallben-plot
+
+#tiobench related variables
+export TIO_BIN=/opt/qa/tools/tiobench-0.3.3/tiotest
diff --git a/sanity/system_light/config~ b/sanity/system_light/config~
new file mode 100755
index 0000000..99b6779
--- /dev/null
+++ b/sanity/system_light/config~
@@ -0,0 +1,139 @@
+
+#Test path i.e. the path where the configuration file resides.Execution must be done from the saopt location where it resides
+export CONF_FILE=/opt/qa/tools/system_light/config
+
+#Directory from which the script is invoked
+export INVOKEDIR=$PWD
+
+export ERR=0
+
+#The log file where the error optassages and the tiopt duration should be logged
+export TMP="/mnt/logs"
+export LOG_FILE="$TMP/time$$.log"
+export TEST_DIR=$PWD
+export DECISION="n"
+export TYPE="other"
+
+while getopts 'w:l:D:t' option
+do
+ case $option in
+ w)
+ TEST_DIR="$OPTARG"
+ ;;
+ l)
+ LOG_FILE="$OPTARG"
+ ;;
+ D)
+ DECISION="$OPTARG"
+ ;;
+ t)
+ TYPE="$OPTARG"
+ ;;
+ esac
+done
+
+# Do you want thetest to be terminated on first falure? Press y if you want to
+if [ "$DECISION" = "y" ]; then
+ set -e;
+fi
+
+#File where failed tests are saved"
+export LOG_DIR=$(dirname $LOG_FILE)
+#mkdir $LOG_DIR/tests_failed
+export TEST_FAIL=$LOG_DIR/tests_failed
+
+#GlusterFS mount point
+export GF_MP=$TEST_DIR
+export THIS_TEST_DIR=$TEST_DIR/run$$/
+mkdir $THIS_TEST_DIR
+
+#The path which contains the binaries of arequal,postmark,dbench,fileop etc if they are not installed in the system
+export PATH=$PATH:/opt/qa/tools
+export BIN_PATH=/opt/qa/tools
+
+#Arequal related variables
+export ARE_SRC_DIR=/opt/qa/tools/ #The Directory in which the file or the directory being tested is present
+export FILEORDIR=system_light #THe file or the directory to be tested
+export ARE_SRC=$ARE_SRC_DIR$FILEORDIR
+export ARE_DST=$THIS_TEST_DIR$FILEORDIR #The destination directory where the test file should be copied
+
+#Bonnie Related variables
+export USER_NAME=`whoami`
+export WD=$THIS_TEST_DIR
+
+#dbench related variables
+export TIME=300
+export DBENCH_CLNTS=10
+
+#dd related variables
+export OF=dd_test
+export BS_SIZE=100M
+export DD_CNT=10
+
+#Read from the large file
+export LARGE_FILE_SOURCE=$THIS_TEST_DIR/$OF
+export LARGE_FILE_DEST=/dev/null
+
+#fileop related variables
+#export FILEOP_SIZE=100
+export FILEOP_CNT=30
+
+#fsx related variables
+export FSX_FILE_ORIG=/opt/qa/tools/read
+export FSX_FILE=$(basename $FSX_FILE_ORIG)
+export NUM_OPS=100 #Number of operations to be perforoptd default is infinity
+
+#ffsb related variables
+export FFSB_FILE=$THIS_TEST_DIR/profile_everything
+
+#glusterfs build
+export GFS_VERSION=3.0.0pre2
+export GLUSTERFS_TAR_FILE=/opt/qa/tools/glusterfs-$GFS_VERSION.tar.gz
+export GLUSTERFS_DIR=glusterfs.git
+
+#ioblazer related variables
+export BLAZER_DIR=$THIS_TEST_DIR;
+
+#iozone related variables
+export FILE_SIZE=4g
+export RECORD_SIZE=22k
+
+# kernel related variables
+#export SCRIPTS_PATH="/opt/qa/tools/system_light/scripts"
+export VERSION=2.6.31.1
+export KERNEL_PATH=/opt/qa/tools/linux-$VERSION.tar.bz2
+
+#ltp related variables
+export LTP_DIR=/opt/qa/tools/ltp-full-20091031/testcases/kernel/fs/
+
+#locks related variables
+export LOCK_BIN=/opt/qa/tools/locks/locktests
+export CON_PROC=22
+export LOCK_TEST_FILE=$THIS_TEST_DIR/locks_test
+
+#lmbench related variables
+export LM_DIR=lmbench-3.0-a9
+export SRC_DIR=$BIN_PATH/lmbench-3.0-a9
+
+#openssl related variables
+export OPENSSL_TAR_FILE="/opt/qa/tools/openssl-0.9.8c.tar.gz"
+export OPENSSL_DIR="openssl-0.9.8c"
+export PREFIX=''
+export OPENSSLDIR=''
+
+#posix compliance related variables
+export DIR="/opt/qa/tools/posix-testsuite";
+
+#postmark related variables
+export POST_FILE=/opt/qa/tools/system_light/pm.config
+
+#Multiple file related variables
+export NUM_OF_FILES=100000
+
+#syscallbench related variables
+export TOOL_DIR=/opt/qa/tools/tools.git
+export SYSCALL_BIN=$TOOL_DIR/syscallbench/syscallbench
+export SYSCALL_PLOT=$TOOL_DIR/syscallbench/syscallben-plot
+
+#tiobench related variables
+export TIO_BIN=/opt/qa/tools/tiobench-0.3.3/tiotest
diff --git a/sanity/system_light/pm.config b/sanity/system_light/pm.config
new file mode 100755
index 0000000..549b143
--- /dev/null
+++ b/sanity/system_light/pm.config
@@ -0,0 +1,3 @@
+run /tmp/postmark-out
+show
+quit
diff --git a/sanity/system_light/profile_everything b/sanity/system_light/profile_everything
new file mode 100644
index 0000000..67972e1
--- /dev/null
+++ b/sanity/system_light/profile_everything
@@ -0,0 +1,119 @@
+directio = 0
+time = 10
+
+[filesystem]
+ location = /mnt/test1
+
+ num_dirs = 100
+
+ size_weight 4k 33
+ size_weight 8k 21
+ size_weight 16k 13
+ size_weight 32k 10
+ size_weight 64k 8
+ size_weight 128k 5
+ size_weight 256k 4
+ size_weight 512k 3
+ size_weight 8m 2
+ size_weight 32m 1
+# size_weight 1g 1
+
+# min_filesize = 4k
+# max_filesize = 10m
+
+# num_files = 0
+ init_size = 100m
+# init_size = 6GB
+# init_size = 1gb
+# init_util = 0.002
+
+ agefs = 0
+ [threadgroup]
+ num_threads = 10
+ write_size = 400
+ write_blocksize = 1024
+ create_weight = 10
+ append_weight = 10
+ delete_weight = 1
+ [end]
+ desired_util = 0.005
+
+
+[end]
+
+#[filesystem]
+# location = /mnt/test1
+# clone = /mnt/test2
+#[end]
+
+[threadgroup]
+ num_threads = 4
+
+# bindfs = /mnt/test1
+
+ append_weight = 1
+ append_fsync_weight = 1
+ stat_weight = 1
+# write_weight = 1
+# write_fsync_weight = 1
+# read_weight = 1
+ create_weight = 1
+ create_fsync_weight = 1
+ delete_weight = 1
+ readall_weight = 1
+ writeall_weight = 1
+ writeall_fsync_weight = 1
+ open_close_weight = 1
+
+ read_random = 0
+ write_random = 0
+
+ write_size = 40k
+ write_blocksize = 4k
+ read_size = 40k
+ read_blocksize = 4k
+
+ op_delay = 0
+
+ [stats]
+ enable_stats = 1
+ enable_range = 0
+
+# ignore = close
+# ignore = open
+# ignore = lseek
+# ignore = write
+# ignore = read
+
+ msec_range 0.00 0.01
+ msec_range 0.01 0.02
+ msec_range 0.02 0.03
+ msec_range 0.03 0.04
+ msec_range 0.04 0.05
+ msec_range 0.05 0.1
+ msec_range 0.1 0.2
+ msec_range 0.2 0.5
+ msec_range 0.5 1.0
+ msec_range 1.0 2.0
+ msec_range 2.0 3.0
+ msec_range 3.0 4.0
+ msec_range 4.0 5.0
+ msec_range 5.0 10.0
+ msec_range 10.0 10000.0
+ [end]
+[end]
+
+#[threadgroup]
+# num_threads = 1
+#
+# readall_weight = 0
+# writeall_weight = 0
+# createdir_weight = 0
+#
+# write_size = 4096
+# write_blocksize = 4096
+# read_size = 4096
+# read_blocksize = 4096
+#
+# op_delay = 12
+#[end]
diff --git a/sanity/system_light/run.sh b/sanity/system_light/run.sh
new file mode 100755
index 0000000..6270fad
--- /dev/null
+++ b/sanity/system_light/run.sh
@@ -0,0 +1,407 @@
+#!/bin/sh
+
+_init ()
+{
+ ulimit -c unlimited
+ set +x
+ set -u;
+ basedir=$(dirname $0);
+ SCRIPTS_PATH=$basedir/scripts;
+ #SCRIPTS_PATH="/opt/qa/tools/system_light/scripts"
+ CNT=0
+ . $basedir/config;
+ #. /opt/qa/tools/system_light/config
+
+ echo " This script runs the tools and scriprts which are used to test the performance.The tests are run on ther glusterFS mountpoint.They are:
+1.dd
+2.dbench
+3.arequal
+4.posix_compliance
+5.kernel compile
+6.fsx
+7.ltp tests
+8.fileop
+9.openssl build
+10.postmark
+11.ffsb
+12.Reading from large file
+13.Multiple file creation(100000)
+14.glusterfs build
+15.syscallbench
+16.tiobench
+17.locktests
+18.ioblazer";
+}
+
+run_ffsb ()
+{
+ echo "Executing ffsb"
+ set +x
+ cp $BIN_PATH/system_light/profile_everything $THIS_TEST_DIR/profile_everything
+ sed -i "s[/mnt/test1[$THIS_TEST_DIR[" profile_everything
+ $SCRIPTS_PATH/ffsb_test.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing data"
+ rm -rfv data && echo "Removed"
+ echo "Removing meta"
+ rm -rfv meta && echo "Removed"
+ echo "Removing profile_everything"
+ rm $FFSB_FILE && echo "Removed"
+ else
+ echo "ffsb failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_ltp ()
+{
+ echo "Executing ltp tests"
+ set +x
+ mkdir ltp
+ cd ltp
+ $SCRIPTS_PATH/ltp_test.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing directory"
+ cd -
+ rm -rfv ltp && echo "removed"
+ else
+ echo "ltp failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_fileop ()
+{
+ echo "Executing fileop"
+ set +x
+ $SCRIPTS_PATH/fileop_test.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ else
+ echo "fileop failed"
+ echo $CNT
+ fi
+}
+
+run_kernel_compile ()
+{
+ echo "Kernel compiling" #Untars the given kernel file and compiles it
+ set +x
+ $SCRIPTS_PATH/kernel.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing linux-$VERSION.tar.bz2 and linux-$VERSION"
+ rm -r linux-$VERSION* && echo "removed"
+ else
+ echo "kernel compile failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+# echo "Executing bonnie++"
+# set +x
+# $SCRIPTS_PATH/bonnie_test.sh
+# if [ "${?}" -eq 0 ]; then
+# CNT=$((CNT+1))
+# echo $CNT
+# else
+# echo "bonnie failed" | tee -a $TEST_FAIL
+# echo $CNT
+# fi
+
+run_dd ()
+{
+ echo "Executing dd"
+ set +x
+ $SCRIPTS_PATH/dd_test.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ else
+ echo "dd failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_read_large ()
+{
+ echo "Reading from large file"
+ set +x
+ $SCRIPTS_PATH/read_large.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing $PWD/$OF"
+ rm $PWD/$OF && echo "Removed"
+ else
+ echo "Large file reading failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_dbench ()
+{
+ echo "Executing dbench"
+ set +x
+ $SCRIPTS_PATH/dbench_test.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing clients"
+ rm -r clients && echo "Removed"
+ else
+ echo "dbench failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_glusterfs_build ()
+{
+ echo "glusterfs build"
+ set +x;
+ $SCRIPTS_PATH/glusterfs_build.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing glusterfs directory"
+ rm -r $GLUSTERFS_DIR && echo "Removed"
+ else
+ echo "glusterfs build failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_posix_compliance ()
+{
+ echo "Checking for POSIX compliance"
+ set +x
+ $SCRIPTS_PATH/posix_compliance.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing posix created directories and files"
+ rm -r fstest* && echo "Removed"
+ else
+ echo "posix failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_openssl_build ()
+{
+ echo "Building opnssl"
+ set +x
+ $SCRIPTS_PATH/open.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing $OPENSSL_DIR"
+ rm -r openssl* && echo "Removed"
+ else
+ echo "openssl failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_postmark ()
+{
+ echo "Running postmark"
+ set +x
+ $SCRIPTS_PATH/postmark.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ else
+ echo "postmark failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_multiple_files ()
+{
+ echo "Multiple files creation(100000),listing,removal"
+ set +x
+ $SCRIPTS_PATH/multiple_files.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ else
+ echo "multiple files failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+# echo "Executing iozone"
+# set +x
+# $SCRIPTS_PATH/iozone_test.sh
+# if [ "${?}" -eq 0 ]; then
+# CNT=$((CNT+1))
+# echo $CNT
+# else
+# echo "iozone failed" | tee -a $TEST_FAIL
+# echo $CNT
+# fi
+
+run_fsx ()
+{
+ echo "Executing fsx"
+ set +x
+ $SCRIPTS_PATH/fsx_test.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing $FSX_FILE,$FSX_FILE.fsxgood and $FSX_FILE.fsxlog"
+ rm $FSX_FILE* && echo "Removed"
+ else
+ echo "fsx failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_arequal ()
+{
+ echo "executing arequal"
+ set +x
+ $SCRIPTS_PATH/arequal_test.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing $ARE_DST"
+ rm -r $ARE_DST && echo "Removed"
+ else
+ echo "arequal failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_syscallbench ()
+{
+ echo "Executing syscallbench"
+ set +x
+ $SCRIPTS_PATH/syscallbench.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ else
+ echo "syscallbench failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_tiobench ()
+{
+ echo "Executing tiobench"
+ set +x
+ $SCRIPTS_PATH/tiobench.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ else
+ echo "tiobench failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_locktests ()
+{
+ echo "Executing locktests"
+ set +x
+ locks_dirname=$(dirname $LOCK_BIN)
+ cp $locks_dirname/test $LOCK_TEST_FILE
+ $SCRIPTS_PATH/locks.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ rm $LOCK_TEST_FILE
+ else
+ echo "locktests failed" | tee -a $TEST_FAIL
+ echo $CNT
+ rm $LOCK_TEST_FILE
+ fi
+}
+
+run_blazer ()
+{
+ echo "Executing ioblazer";
+ set +x;
+ $SCRIPTS_PATH/blazer.sh;
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1));
+ echo $CNT;
+ else
+ echo "blazer failed | tee -a $TEST_FAIL";
+ echo $CNT;
+ fi
+}
+
+run_rpc_coverage ()
+{
+ echo "Executing rpc coverage tests";
+ set +x;
+ $SCRIPTS_PATH/rpc-fops.sh;
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1));
+ echo $CNT;
+ else
+ echo "rpc-coverage failed | tee -a $TEST_FAIL";
+ echo $CNT;
+ fi
+}
+
+main ()
+{
+ echo " Changing to the specified mountpoint";
+ cd $THIS_TEST_DIR;
+ pwd;
+ sleep 1;
+
+ run_rpc_coverage;
+ run_posix_compliance;
+ run_ffsb;
+ run_ltp;
+ run_fileop;
+ run_kernel_compile;
+ run_dd;
+ run_read_large;
+ run_dbench;
+ run_glusterfs_build;
+ run_openssl_build;
+ run_postmark;
+ run_multiple_files;
+ run_fsx;
+ run_arequal;
+ run_syscallbench;
+ run_tiobench;
+ if [ $TYPE != "nfs" ]; then
+ run_locktests;
+ fi
+ #run_blazer;
+
+ echo "Total $CNT tests were successful" | tee -a $TEST_FAIL
+
+ if [ "$INVOKEDIR" == "$THIS_TEST_DIR" ]; then
+ echo "moving to the parent directory"
+ cd ..
+ echo "Removing $THIS_TEST_DIR"
+ rmdir $THIS_TEST_DIR
+ if [ "${?}" -ne 0 ]; then
+ echo "rmdir failed:Directory not empty"
+ fi
+ else
+ echo "Switching over to the previous working directory"
+ cd $INVOKEDIR
+ echo "Removing $THIS_TEST_DIR"
+ rmdir $THIS_TEST_DIR
+ if [ "${?}" -ne 0 ]; then
+ echo "rmdir failed:Directory not empty"
+ fi
+ fi
+}
+
+_init "$@" && main "$@" \ No newline at end of file
diff --git a/sanity/system_light/run.sh~ b/sanity/system_light/run.sh~
new file mode 100755
index 0000000..e7edcb1
--- /dev/null
+++ b/sanity/system_light/run.sh~
@@ -0,0 +1,408 @@
+#!/bin/sh
+
+_init ()
+{
+ ulimit -c unlimited
+ set +x
+ set -u;
+ basedir=$(dirname $0);
+ SCRIPTS_PATH=$basedir/scripts;
+ #SCRIPTS_PATH="/opt/qa/tools/system_light/scripts"
+ CNT=0
+ . $basedir/config;
+ #. /opt/qa/tools/system_light/config
+
+ echo " This script runs the tools and scriprts which are used to test the performance.The tests are run on ther glusterFS mountpoint.They are:
+1.dd
+2.dbench
+3.arequal
+4.posix_compliance
+5.kernel compile
+6.fsx
+7.ltp tests
+8.fileop
+9.openssl build
+10.postmark
+11.ffsb
+12.Reading from large file
+13.Multiple file creation(100000)
+14.glusterfs build
+15.syscallbench
+16.tiobench
+17.locktests
+18.ioblazer";
+}
+
+run_ffsb ()
+{
+ echo "Executing ffsb"
+ set +x
+ cp $BIN_PATH/system_light/profile_everything $THIS_TEST_DIR/profile_everything
+ sed -i "s[/mnt/test1[$THIS_TEST_DIR[" profile_everything
+ $SCRIPTS_PATH/ffsb_test.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing data"
+ rm -rfv data && echo "Removed"
+ echo "Removing meta"
+ rm -rfv meta && echo "Removed"
+ echo "Removing profile_everything"
+ rm $FFSB_FILE && echo "Removed"
+ else
+ echo "ffsb failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_ltp ()
+{
+ echo "Executing ltp tests"
+ set +x
+ mkdir ltp
+ cd ltp
+ $SCRIPTS_PATH/ltp_test.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing directory"
+ cd -
+ rm -rfv ltp && echo "removed"
+ else
+ echo "ltp failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_fileop ()
+{
+ echo "Executing fileop"
+ set +x
+ $SCRIPTS_PATH/fileop_test.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ else
+ echo "fileop failed"
+ echo $CNT
+ fi
+}
+
+run_kernel_compile ()
+{
+ echo "Kernel compiling" #Untars the given kernel file and compiles it
+ set +x
+ $SCRIPTS_PATH/kernel.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing linux-$VERSION.tar.bz2 and linux-$VERSION"
+ rm -r linux-$VERSION* && echo "removed"
+ else
+ echo "kernel compile failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+# echo "Executing bonnie++"
+# set +x
+# $SCRIPTS_PATH/bonnie_test.sh
+# if [ "${?}" -eq 0 ]; then
+# CNT=$((CNT+1))
+# echo $CNT
+# else
+# echo "bonnie failed" | tee -a $TEST_FAIL
+# echo $CNT
+# fi
+
+run_dd ()
+{
+ echo "Executing dd"
+ set +x
+ $SCRIPTS_PATH/dd_test.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ else
+ echo "dd failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_read_large ()
+{
+ echo "Reading from large file"
+ set +x
+ $SCRIPTS_PATH/read_large.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing $PWD/$OF"
+ rm $PWD/$OF && echo "Removed"
+ else
+ echo "Large file reading failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_dbench ()
+{
+ echo "Executing dbench"
+ set +x
+ $SCRIPTS_PATH/dbench_test.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing clients"
+ rm -r clients && echo "Removed"
+ else
+ echo "dbench failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_glusterfs_build ()
+{
+ echo "glusterfs build"
+ set +x;
+ $SCRIPTS_PATH/glusterfs_build.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing glusterfs directory"
+ rm -r $GLUSTERFS_DIR && echo "Removed"
+ else
+ echo "glusterfs build failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_posix_compliance ()
+{
+ echo "Checking for POSIX compliance"
+ set +x
+ $SCRIPTS_PATH/posix_compliance.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing posix created directories and files"
+ rm -r fstest* && echo "Removed"
+ else
+ echo "posix failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_openssl_build ()
+{
+ echo "Building opnssl"
+ set +x
+ $SCRIPTS_PATH/open.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing $OPENSSL_DIR"
+ rm -r openssl* && echo "Removed"
+ else
+ echo "openssl failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_postmark ()
+{
+ echo "Running postmark"
+ set +x
+ $SCRIPTS_PATH/postmark.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ else
+ echo "postmark failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_multiple_files ()
+{
+ echo "Multiple files creation(100000),listing,removal"
+ set +x
+ $SCRIPTS_PATH/multiple_files.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ else
+ echo "multiple files failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+# echo "Executing iozone"
+# set +x
+# $SCRIPTS_PATH/iozone_test.sh
+# if [ "${?}" -eq 0 ]; then
+# CNT=$((CNT+1))
+# echo $CNT
+# else
+# echo "iozone failed" | tee -a $TEST_FAIL
+# echo $CNT
+# fi
+
+run_fsx ()
+{
+ echo "Executing fsx"
+ set +x
+ $SCRIPTS_PATH/fsx_test.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing $FSX_FILE,$FSX_FILE.fsxgood and $FSX_FILE.fsxlog"
+ rm $FSX_FILE* && echo "Removed"
+ else
+ echo "fsx failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_arequal ()
+{
+ echo "executing arequal"
+ set +x
+ $SCRIPTS_PATH/arequal_test.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing $ARE_DST"
+ rm -r $ARE_DST && echo "Removed"
+ else
+ echo "arequal failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_syscallbench ()
+{
+ echo "Executing syscallbench"
+ set +x
+ $SCRIPTS_PATH/syscallbench.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ else
+ echo "syscallbench failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_tiobench ()
+{
+ echo "Executing tiobench"
+ set +x
+ $SCRIPTS_PATH/tiobench.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ else
+ echo "tiobench failed" | tee -a $TEST_FAIL
+ echo $CNT
+ fi
+}
+
+run_locktests ()
+{
+ echo "Executing locktests"
+ set +x
+ locks_dirname=$(dirname $LOCK_BIN)
+ cp $locks_dirname/test $LOCK_TEST_FILE
+ $SCRIPTS_PATH/locks.sh
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ rm $LOCK_TEST_FILE
+ else
+ echo "locktests failed" | tee -a $TEST_FAIL
+ echo $CNT
+ rm $LOCK_TEST_FILE
+ fi
+}
+
+run_blazer ()
+{
+ echo "Executing ioblazer";
+ set +x;
+ $SCRIPTS_PATH/blazer.sh;
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1));
+ echo $CNT;
+ else
+ echo "blazer failed | tee -a $TEST_FAIL";
+ echo $CNT;
+ fi
+}
+
+run_rpc_coverage ()
+{
+ echo "Executing rpc coverage tests";
+ #set +x;
+ set -x;
+ $SCRIPTS_PATH/rpc-fops.sh;
+ if [ "${?}" -eq 0 ]; then
+ CNT=$((CNT+1));
+ echo $CNT;
+ else
+ echo "rpc-coverage failed | tee -a $TEST_FAIL";
+ echo $CNT;
+ fi
+}
+
+main ()
+{
+ echo " Changing to the specified mountpoint";
+ cd $THIS_TEST_DIR;
+ pwd;
+ sleep 1;
+
+ run_rpc_coverage;
+ # run_posix_compliance;
+# run_ffsb;
+# run_ltp;
+# run_fileop;
+ run_kernel_compile;
+ # run_dd;
+# run_read_large;
+# run_dbench;
+# run_glusterfs_build;
+# run_openssl_build;
+# run_postmark;
+# run_multiple_files;
+# run_fsx;
+# run_arequal;
+# run_syscallbench;
+# run_tiobench;
+# if [ $TYPE != "nfs" ]; then
+# run_locktests;
+# fi
+ #run_blazer;
+
+ echo "Total $CNT tests were successful" | tee -a $TEST_FAIL
+
+ if [ "$INVOKEDIR" == "$THIS_TEST_DIR" ]; then
+ echo "moving to the parent directory"
+ cd ..
+ echo "Removing $THIS_TEST_DIR"
+ rmdir $THIS_TEST_DIR
+ if [ "${?}" -ne 0 ]; then
+ echo "rmdir failed:Directory not empty"
+ fi
+ else
+ echo "Switching over to the previous working directory"
+ cd $INVOKEDIR
+ echo "Removing $THIS_TEST_DIR"
+ rmdir $THIS_TEST_DIR
+ if [ "${?}" -ne 0 ]; then
+ echo "rmdir failed:Directory not empty"
+ fi
+ fi
+}
+
+_init "$@" && main "$@" \ No newline at end of file
diff --git a/sanity/system_light/run_nfs.sh b/sanity/system_light/run_nfs.sh
new file mode 100755
index 0000000..94d8262
--- /dev/null
+++ b/sanity/system_light/run_nfs.sh
@@ -0,0 +1,101 @@
+#!/bin/sh
+
+ulimit -c unlimited
+set +x
+SCRIPTS_PATH="/opt/qa/tools/system_light/scripts"
+CNT=0
+. /opt/qa/tools/system_light/config
+echo " Changing to the specified mountpoint"
+cd $THIS_TEST_DIR
+pwd
+
+echo " This script runs the tools and scriprts which are used to test the performance.The tests are run on ther glusterFS mountpoint.They are:
+1.dd
+2.dbench
+3.arequal
+4.posix_compliance
+5.kernel compile
+6.fsx
+7.ltp tests
+8.fileop
+9.bonnie
+10.iozone
+11.openssl build
+12.postmark
+13.ffsb
+14.Reading from large file
+15.Multiple file creation(100000)
+16.glusterfs build";
+
+sleep 1
+
+echo "Executing ffsb"
+ set +x
+ cp $BIN_PATH/system_light/profile_everything $THIS_TEST_DIR/profile_everything
+ sed -i "s[/mnt/test1[$THIS_TEST_DIR[" profile_everything
+ $SCRIPTS_PATH/ffsb_test.sh
+if [ $? -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing data"
+ rm -rfv data && echo "Removed"
+ echo "Removing meta"
+ rm -rfv meta && echo "Removed"
+ echo "Removing profile_everything"
+ rm $FFSB_FILE && echo "Removed"
+else
+ echo "ffsb failed"
+ echo $CNT
+fi
+
+echo "Executing ltp tests"
+ set +x
+ mkdir ltp
+ cd ltp
+ $SCRIPTS_PATH/ltp_test.sh
+if [ $? -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing directory"
+ cd -
+ rm -rfv ltp && echo "removed"
+else
+ echo "ltp failed"
+ echo $CNT
+fi
+
+echo "Executing fileop"
+ set +x
+ $SCRIPTS_PATH/fileop_test.sh
+if [ $? -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+else
+ echo "fileop failed"
+ echo $CNT
+fi
+
+echo "Kernel compiling" #Untars the given kernel file and compiles it
+ set +x
+ $SCRIPTS_PATH/kernel.sh
+if [ $? -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+ echo "Removing linux-$VERSION.tar.bz2 and linux-$VERSION"
+ rm -r linux-$VERSION* && echo "removed"
+else
+ echo "kernel compile failed"
+ echo $CNT
+fi
+
+echo "Executing bonnie++"
+ set +x
+ $SCRIPTS_PATH/bonnie_test.sh
+if [ $? -eq 0 ]; then
+ CNT=$((CNT+1))
+ echo $CNT
+else
+ echo "bonnie failed"
+ echo $CNT
+fi
+
diff --git a/sanity/system_light/scripts/#kernel.sh# b/sanity/system_light/scripts/#kernel.sh#
new file mode 100755
index 0000000..40268a9
--- /dev/null
+++ b/sanity/system_light/scripts/#kernel.sh#
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+#This script 1st searches in the pwd for the kernel tar file. If its not there then based on the value of the vriable KERNEL_PATH it either searches from the path given or searches in http://www.kernel.org
+
+function main()
+{
+ if [ -e "linux-$VERSION.tar.bz2" ]
+ then
+ echo "start:`date +%T`"
+ time $SCRIPTS_PATH/kernel_compile.sh linux-$VERSION.tar.bz2 2>>$LOG_FILE 1>>$LOG_FILE
+ if [ $? -ne 0 ]; then
+
+ f err=$?
+ echo "end:`date +%T`"
+ return 11;
+ else
+ echo "end:`date +%T`"
+ return 0;
+ fi
+ elif [ -z "$KERNEL_PATH" ]
+ then
+ time $SCRIPTS_PATH/kernel_compile.sh 2>>$LOG_FILE 1>>$LOG_FILE
+ if [ $? -ne 0 ]; then
+ err=$?
+ echo "end:`date +%T`"
+ return 11;
+ else
+ echo "end:`date +%T`"
+ return 0;
+ fi
+ else
+ time $SCRIPTS_PATH/kernel_compile.sh $KERNEL_PATH 2>>$LOG_FILE 1>>$LOG_FILE
+ if [ $? -ne 0 ]; then
+ err=$?
+ echo "end:`date +%T`"
+ return 11;
+ else
+ echo "end:`date +%T`"
+ return 0;
+ fi
+ fi;
+}
+
+main "$@"; \ No newline at end of file
diff --git a/sanity/system_light/scripts/arequal_test.sh b/sanity/system_light/scripts/arequal_test.sh
new file mode 100755
index 0000000..3b66680
--- /dev/null
+++ b/sanity/system_light/scripts/arequal_test.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+function main ()
+{
+ stat $ARE_SRC | grep directory > /dev/null
+ if [ $? -eq 0 ] ; then
+ ARE_SRC=$ARE_SRC/
+ fi
+
+ echo "start:`date +%T`"
+ time arequal-run.sh $ARE_SRC $ARE_DST 2>>$LOG_FILE 1>>$LOG_FILE
+ #copies the contents of $4 directory to $5 and calculates the checksum of both src and dst directories to check whether the transfer was successful. We need to redirect the standard output also to the logfile to see the output of arequal.
+
+
+ if [ $? -ne 0 ]; then
+ echo "end:`date +%T`"
+ return 11;
+ else
+ echo "end:`date +%T`"
+ fi
+}
+
+main "$@" \ No newline at end of file
diff --git a/sanity/system_light/scripts/blazer.sh b/sanity/system_light/scripts/blazer.sh
new file mode 100755
index 0000000..3e59cb0
--- /dev/null
+++ b/sanity/system_light/scripts/blazer.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+
+#ioblazer test which tests the IO functionality, and can generate vm related loads.
+
+function main()
+{
+ ioblazer -d $BLAZER_DIR;
+
+ # Since opening a file with O_DIRECT in fuse fails check the exit value for failure. If the test fails for the first time assume that
+ # the mount point was a fuse mount point and re run the test again with buffered IO enabled.
+
+ if [ $? -ne 0 ]; then
+ ioblazer -B 1 -d $BLAZER_DIR
+ if [ $? -ne 0 ]; then
+ return 11;
+ else
+ return 0;
+ fi
+ else
+ return 0;
+ fi
+}
+
+main "$@"; \ No newline at end of file
diff --git a/sanity/system_light/scripts/bonnie_test.sh b/sanity/system_light/scripts/bonnie_test.sh
new file mode 100755
index 0000000..70bc2bd
--- /dev/null
+++ b/sanity/system_light/scripts/bonnie_test.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+function main()
+{
+ echo "start:`date +%T`" >>$LOG_FILE
+ time bonnie++ -u $USER_NAME -d $WD 2>&1 1>>$LOG_FILE 1>>/tmp/bonnie #creates files of double the ram size and tests the performance
+
+
+ if [ $? -ne 0 ]; then
+ echo "end:`date +%T`" >>$LOG_FILE
+ return 11;
+ else
+ echo "end:`date +%T`" >>$LOG_FILE
+ return 0;
+ fi
+}
+
+main "$@"
diff --git a/sanity/system_light/scripts/dbench_test.sh b/sanity/system_light/scripts/dbench_test.sh
new file mode 100755
index 0000000..fee116f
--- /dev/null
+++ b/sanity/system_light/scripts/dbench_test.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+function main()
+{
+#runs $3 multiple clients on mount point and tests the performance and -t option ($2) tells the time for which it should be run
+ echo "start:`date +%T`"
+ time dbench -t $TIME -s -S $DBENCH_CLNTS 2>>$LOG_FILE 1>>$LOG_FILE
+
+
+ if [ $? -ne 0 ]; then
+ echo "end:`date +%T`"
+ return 11;
+ else
+ echo "end:`date +%T`"
+ return 0;
+ fi
+
+}
+
+main "$@"; \ No newline at end of file
diff --git a/sanity/system_light/scripts/dd_test.sh b/sanity/system_light/scripts/dd_test.sh
new file mode 100755
index 0000000..c4df53c
--- /dev/null
+++ b/sanity/system_light/scripts/dd_test.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+function main ()
+{
+ echo "start:`date +%T`"
+ time dd if=/dev/zero of=$PWD/$OF bs=$BS_SIZE count=$DD_CNT 2>>$LOG_FILE #copies specified amount of data from the input file to the output file
+
+
+ if [ $? -ne 0 ]; then
+ echo "end:`date +%T`"
+ return 11;
+ else
+ echo "end:`date +%T`"
+ return 0;
+ fi
+
+}
+
+main "$@"; \ No newline at end of file
diff --git a/sanity/system_light/scripts/ffsb_test.sh b/sanity/system_light/scripts/ffsb_test.sh
new file mode 100755
index 0000000..6a9e8c2
--- /dev/null
+++ b/sanity/system_light/scripts/ffsb_test.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+function main ()
+{
+ echo "start:`date +%T`"
+ time ffsb $FFSB_FILE 2>>$LOG_FILE 1>>$LOG_FILE
+
+
+ if [ $? -ne 0 ]; then
+ echo "end:`date +%T`" >>$LOG_FILE
+ return 11;
+ else
+ echo "end:`date +%T`" >>$LOG_FILE
+ return 0;
+ fi
+
+}
+
+main "$@"; \ No newline at end of file
diff --git a/sanity/system_light/scripts/fileop_test.sh b/sanity/system_light/scripts/fileop_test.sh
new file mode 100755
index 0000000..d99992c
--- /dev/null
+++ b/sanity/system_light/scripts/fileop_test.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+function main()
+{
+
+ echo "start:`date +%T`"
+ time fileop -f $FILEOP_CNT -t 2>>$LOG_FILE 1>>$LOG_FILE
+
+
+#in this example it creates 2 directories.In each directory 2 subdirectories are created and in each subdirectory 2 files are created.
+
+ if [ $? -ne 0 ]; then
+ echo "end:`date +%T`"
+ return 11;
+ else
+ echo "end:`date +%T`"
+ return 0;
+ fi
+
+}
+
+main "$@"; \ No newline at end of file
diff --git a/sanity/system_light/scripts/fsx_test.sh b/sanity/system_light/scripts/fsx_test.sh
new file mode 100755
index 0000000..8cf5fe8
--- /dev/null
+++ b/sanity/system_light/scripts/fsx_test.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+#performs read,write operations on the given file and tests the performance
+
+function main ()
+{
+ cp $FSX_FILE_ORIG $FSX_FILE
+
+ echo "start:`date +%T`"
+ time fsx -R -W -N $NUM_OPS $FSX_FILE 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -ne 0 ]; then
+ echo "end:`date +%T`"
+ return 11;
+ else
+ echo "end:`date +%T`"
+ return 0;
+ fi
+}
+
+main "$@"; \ No newline at end of file
diff --git a/sanity/system_light/scripts/glusterfs_build.sh b/sanity/system_light/scripts/glusterfs_build.sh
new file mode 100755
index 0000000..d12e191
--- /dev/null
+++ b/sanity/system_light/scripts/glusterfs_build.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+# This script takes glusterfs tar file, untars it and builds it.
+
+function main ()
+{
+
+ echo "cloning from the git:`date +%T`" >>$LOG_FILE
+ time git clone git://git.gluster.com/glusterfs.git glusterfs.git 2>>$LOG_FILE 1>>$LOG_FILE
+ if [ $? -ne 0 ]; then
+ echo "Cannot clone the git repository"
+ tar -xvf $GLUSTERFS_TAR_FILE
+ mv glusterfs-$GFS_VERSION glusterfs.git
+ fi
+
+ cd $GLUSTERFS_DIR
+
+ echo "running autogen.sh:`date +%T`"
+ time ./autogen.sh 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -ne 0 ]; then
+ echo "autogen failed:`date +%T`";
+ return 11;
+ fi
+
+ echo "running configure:`date +%T`"
+ time ./configure 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -ne 0 ]; then
+ echo "configure failed:`date +%T`";
+ return 11;
+ fi
+
+
+ echo "running make:`date +%T`"
+ time make -j 32 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -ne 0 ]; then
+ echo "make failed:`date +%T`";
+ return 11;
+ else
+ echo "all successful:`date +%T`"
+ return 0;
+ fi
+
+}
+
+main "$@" \ No newline at end of file
diff --git a/sanity/system_light/scripts/iozone_test.sh b/sanity/system_light/scripts/iozone_test.sh
new file mode 100755
index 0000000..870f18f
--- /dev/null
+++ b/sanity/system_light/scripts/iozone_test.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+
+#tests the performance by performing actions such as read, write etc.
+
+function main()
+{
+ echo "start:`date +%T`"
+ #time iozone -i 0 -i 1 -i 2 -i 3 -i 4 -i 5 -i 6 -i 7 -i 8 -i 9 -i 10 -i 11 -i 12 -s $FILE_SIZE -r $RECORD_SIZE 2>&1 1>>$LOG_FILE 1>>/tmp/iozone
+ time iozone -i 0 -i 1 -i 2 -i 3 -i 4 -i 5 -i 6 -i 7 -i 8 -i 9 -i 10 -i 11 -i 12 -s 1m -r 22k 2>&1 1>>$LOG_FILE 1>>/tmp/iozone
+ if [ $? -ne 0 ]; then
+ echo "end:`date +%T`"
+ return 11;
+ else
+ echo "end:`date +%T`"
+ return 0;
+ fi
+}
+
+main "$@"; \ No newline at end of file
diff --git a/sanity/system_light/scripts/kernel.sh b/sanity/system_light/scripts/kernel.sh
new file mode 100755
index 0000000..1af548c
--- /dev/null
+++ b/sanity/system_light/scripts/kernel.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+#This script 1st searches in the pwd for the kernel tar file. If its not there then based on the value of the vriable KERNEL_PATH it either searches from the path given or searches in http://www.kernel.org
+
+function main()
+{
+ SCRIPTS_DIR=$(dirname $0);
+ if [ -e "linux-$VERSION.tar.bz2" ]
+ then
+ echo "start:`date +%T`"
+ time $SCRIPTS_DIR/kernel_compile.sh linux-$VERSION.tar.bz2 2>>$LOG_FILE 1>>$LOG_FILE
+ if [ $? -ne 0 ]; then
+ err=$?
+ echo "end:`date +%T`"
+ return 11;
+ else
+ echo "end:`date +%T`"
+ return 0;
+ fi
+ elif [ -z "$KERNEL_PATH" ]
+ then
+ time $SCRIPTS_DIR/kernel_compile.sh 2>>$LOG_FILE 1>>$LOG_FILE
+ if [ $? -ne 0 ]; then
+ err=$?
+ echo "end:`date +%T`"
+ return 11;
+ else
+ echo "end:`date +%T`"
+ return 0;
+ fi
+ else
+ time $SCRIPTS_DIR/kernel_compile.sh $KERNEL_PATH 2>>$LOG_FILE 1>>$LOG_FILE
+ if [ $? -ne 0 ]; then
+ err=$?
+ echo "end:`date +%T`"
+ return 11;
+ else
+ echo "end:`date +%T`"
+ return 0;
+ fi
+ fi;
+}
+
+main "$@"; \ No newline at end of file
diff --git a/sanity/system_light/scripts/kernel.sh~ b/sanity/system_light/scripts/kernel.sh~
new file mode 100755
index 0000000..863e3b7
--- /dev/null
+++ b/sanity/system_light/scripts/kernel.sh~
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+#This script 1st searches in the pwd for the kernel tar file. If its not there then based on the value of the vriable KERNEL_PATH it either searches from the path given or searches in http://www.kernel.org
+
+function main()
+{
+ if [ -e "linux-$VERSION.tar.bz2" ]
+ then
+ echo "start:`date +%T`"
+ time $SCRIPTS_PATH/kernel_compile.sh linux-$VERSION.tar.bz2 2>>$LOG_FILE 1>>$LOG_FILE
+ if [ $? -ne 0 ]; then
+ err=$?
+ echo "end:`date +%T`"
+ return 11;
+ else
+ echo "end:`date +%T`"
+ return 0;
+ fi
+ elif [ -z "$KERNEL_PATH" ]
+ then
+ time $SCRIPTS_PATH/kernel_compile.sh 2>>$LOG_FILE 1>>$LOG_FILE
+ if [ $? -ne 0 ]; then
+ err=$?
+ echo "end:`date +%T`"
+ return 11;
+ else
+ echo "end:`date +%T`"
+ return 0;
+ fi
+ else
+ time $SCRIPTS_PATH/kernel_compile.sh $KERNEL_PATH 2>>$LOG_FILE 1>>$LOG_FILE
+ if [ $? -ne 0 ]; then
+ err=$?
+ echo "end:`date +%T`"
+ return 11;
+ else
+ echo "end:`date +%T`"
+ return 0;
+ fi
+ fi;
+}
+
+main "$@"; \ No newline at end of file
diff --git a/sanity/system_light/scripts/kernel_compile.sh b/sanity/system_light/scripts/kernel_compile.sh
new file mode 100755
index 0000000..646d639
--- /dev/null
+++ b/sanity/system_light/scripts/kernel_compile.sh
@@ -0,0 +1,262 @@
+#! /bin/bash
+## vi: ai si et ts=4 sw=4 sts=4 bs=2 sta sr
+
+ENV_me=$(basename $0);
+ENV_medir="$(dirname $0)";
+[ "$ENV_medir" = "." ] && ENV_medir="$(pwd)";
+ENV_retval=0;
+
+ENV_short_options='cs:m:V';
+ENV_long_options='continue,site:,mainline:,verbose,quiet,help,version';
+
+ENV_timestamp_in_log=0; # 0 = Disabled, 1 = Enabled
+ENV_log="/dev/stderr";
+ENV_verbosity=2;
+ENV_debug=1;
+ENV_tmpdir=""; ## Temporary directory. Defined later
+
+ENV_version="0.0";
+ENV_copyright_years="2008";
+
+def_mainline="2.6";
+def_site="http://www.kernel.org";
+
+function print_help () {
+ cat <<-_HERE_
+Usage: $ENV_me [OPTION]... [FILE]...
+<DESCRIPTION HERE>.
+
+Mandatory arguments to long options are mandatory for short options too.
+ --help display this help and exit
+ --version output version information and exit
+_HERE_
+}
+
+function timestamp () {
+ echo "$(date +%F\ %T)";
+}
+
+function log () {
+ if [ "$ENV_timestamp_in_log" = "1" ]; then
+ echo "$ENV_me: $(timestamp): $@" | tee -a $log;
+ else
+ echo "$ENV_me: $(timestamp): $@";
+ fi
+}
+
+function debug () {
+ if [ "$ENV_debug" = 1 -o "$ENV_verbosity" = 3]; then
+ echo "$@";
+ fi
+}
+
+function error () {
+ if [ "$ENV_verbosity" -ge 1 ]; then
+ echo "$ENV_me: $@" 1>&2;
+ quit 1;
+ fi
+}
+
+function warn () {
+ if [ "$ENV_verbosity" -ge 1 ]; then
+ echo "$ENV_me: $@" 1>&2;
+ fi
+}
+
+function outn () {
+ if [ "$ENV_verbosity" -ge 2 ]; then
+ echo -n "$@";
+ fi
+}
+
+function out () {
+ if [ "$ENV_verbosity" -ge 2 ]; then
+ echo "$@";
+ fi
+}
+
+function outln () {
+ if [ "$ENV_verbosity" -ge 2 ]; then
+ echo -n "$@" | tee -a $ENV_log;
+ fi
+}
+
+function outl () {
+ if [ "$ENV_verbosity" -ge 2 ]; then
+ echo "$@" | tee -a $ENV_log;
+ fi
+}
+
+function quit () {
+ [ -d "$ENV_tmpdir" ] && rm -rf "$ENV_tmpdir";
+ exit $1;
+}
+
+function print_version () {
+ if [ "$ENV_package" != "" ]; then
+ version_str="$ENV_me ($ENV_package) $ENV_version";
+ else
+ version_str="$ENV_me $ENV_version";
+ fi
+
+ cat <<-_version_
+ $version_str
+ Copyright (C) ${ENV_copyright_years:-$(date +%Y)} Z Research, Inc.
+_version_
+}
+
+function print_usage () {
+ warn "Try \`$ENV_me --help' for more information.";
+ if [ "$1" != "0" -a "$1" != "" ]; then
+ exit "$1";
+ fi
+}
+
+function parseargs () {
+ unset ${!OPT_@};
+ ARGV=($(getopt --shell bash --name $ENV_me \
+ --option "$ENV_short_options" \
+ --longoptions "$ENV_long_options" \
+ -- "$@")) || print_usage 1;
+
+ local index=0;
+ while [ "${ARGV[$index]}" != "--" ]; do
+ local opt="$(echo ${ARGV[$index]//-/_} | sed 's/^__\?//')";
+ eval local arg=${ARGV[$index+1]}; ## eval to get rid of 's
+
+ if [[ "${ARGV[$index+1]}" =~ ^$'\''.* ]]; then # To
+## debug "Setting OPT_$opt = $arg";
+ eval OPT_${opt}=$arg;
+ index=$((index+1));
+ else
+## debug "Incrementing OPT_$opt";
+ eval OPT_$opt=$((OPT_$opt+1));
+ fi
+ index=$((index+1));
+ done
+ eval ARGV=("${ARGV[@]:$index+1}");
+}
+
+function make_tmp_dir () {
+ local dirname="$ENV_me.$RANDOM.$RANDOM.$RANDOM.$$";
+ ENV_tmpdir="$((umask 077 && \
+ mktemp -d -q ${tmpdir:-/tmp}/$dirname) 2>/dev/null)";
+ [ -z "$ENV_tmpdir" ] || [ ! -d "$ENV_tmpdir" ] && {
+ warn "Unable to create temporary directory. Exiting ..";
+ return 1;
+ }
+ return 0;
+}
+
+function get_tarball () {
+ url="$1";
+ filename=$(basename $url);
+ basedir=$(pwd);
+
+ [ -f "$filename" ] && {
+ [ "$OPT_continue" != "1" ] && error "$filename: file exists.";
+ }
+ wget -c $url;
+## out "Updating Timestamps ..";
+## $UPDATE_TIMESTAMP "$filename";
+
+ return 0;
+}
+
+
+function get_latest_tarball () {
+ basedir=$(pwd);
+ cd $ENV_tmpdir;
+
+ echo -n "Retreiving listing [ $ENV_site ] ... ";
+ wget -q "$ENV_site";
+ echo "Done";
+
+ latest=$(sed -n '/The latest stable version of the Linux kernel is/,/<\/tr>/p' index.html | \
+ sed -n 's/.*"\(.*\)">F<.*/\1/p');
+ [ "$latest" = "" ] && error "$ENV_site: No tarball found";
+
+ cd $basedir;
+ url="$ENV_site$latest";
+ get_tarball "$url";
+
+ return 0;
+}
+
+function init () {
+ parseargs "$@";
+ set -e;
+
+ [ "$OPT_help" = "1" ] && print_help && quit 0;
+ [ "$OPT_version" = "1" ] && print_version && quit 0;
+ trap 'quit 255' 1 2 3 6 13 15;
+ make_tmp_dir || quit 1;
+
+ OPT_verbosity=$((${OPT_verbose:-0} + ${OPT_v:-0}));
+
+ ENV_mainline=${OPT_mainline:-${OPT_m:-$def_mainline}};
+ ENV_site=${OPT_site:-${OPT_s:-$def_site}};
+
+ return 0;
+}
+
+function main () {
+ filename=;
+
+ if [ ${#ARGV[@]} = 0 ]; then
+ out "No input specified. Fetching latest kernel tarball ..";
+ get_latest_tarball;
+ elif [[ "${ARGV[0]}" =~ ^http|ftp ]]; then
+ out "URL detected. Fetching from URL ..";
+ get_tarball "$@";
+ elif [ -f "${ARGV[0]}" ]; then
+ filename=$(basename ${ARGV[0]});
+ if [[ ("${ARGV[0]}" =~ /) && ("${ARGV[0]::2}" != "./") ]]; then
+ out "File detected. Copying from location ..";
+ cp "${ARGV[0]}" .;
+ fi
+ else
+ error "${ARGV[0]}: Unknown input method";
+ fi
+
+ out "Extracting Tarball ..";
+ tar -jxf $filename;
+ cd ${filename%.tar.bz2};
+ find . -exec touch '{}' \;
+ out "Making defconfig";
+ make defconfig;
+ if [ $? -ne 0 ]; then
+ err=$?
+ echo "Make defconfig failed"
+ return $err
+ fi
+ echo "its not coming here"
+ out "Making depmod ..";
+ #make depmod;
+ make dep;
+ if [ $? -ne 0 ]; then
+ err=$?
+ echo "Make dep failed"
+ return $err
+ fi
+ out "Making bzImage ..";
+ make bzImage;
+ if [ $? -ne 0 ]; then
+ err=$?
+ echo "Make bzImage failed"
+ return $err
+ fi
+ out "Making modules ..";
+ make modules;
+ if [ $? -ne 0 ]; then
+ err=$?
+ echo "Make modules failed"
+ return $err
+ fi
+ quit 0;
+}
+
+init "$@" && main "$@";
+#quit $ENV_retval;
+
+
diff --git a/sanity/system_light/scripts/lmbench_test.sh b/sanity/system_light/scripts/lmbench_test.sh
new file mode 100755
index 0000000..30c5f6d
--- /dev/null
+++ b/sanity/system_light/scripts/lmbench_test.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+#(time sudo lmbench-run) 2>> $LOG_FILE #Used for perrformance testing such as hardware,OS,development etc.
+
+cp -r $SRC_DIR $GF_MP
+cd $LM_DIR
+(time make results) 2>> $LOG_FILE \ No newline at end of file
diff --git a/sanity/system_light/scripts/locks.sh b/sanity/system_light/scripts/locks.sh
new file mode 100755
index 0000000..2c3db0e
--- /dev/null
+++ b/sanity/system_light/scripts/locks.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+# GOAL : This tests try to stress fcntl locking functions. A master process set a lock on a file region (byte range locking).
+# * Some slaves process tries to perform operations on this region, like read, write, set a new lock ... Expected results of this
+# * operations are known. If the operation result is the same as the expected one, the test sucess, else it fails.
+
+function main()
+{
+ echo "testing the locking through concurrent processes:`date +%T`"
+ time $LOCK_BIN -n $CON_PROC -f $LOCK_TEST_FILE 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -ne 0 ]; then
+ echo "locks by processes failed:`date +%T`"
+ err=11
+ else
+ echo "end:`date +%T`"
+ err=0
+ fi
+
+ echo "DONE"
+
+ echo "testing the locking through concurrent threads:`date +%T`"
+ time $LOCK_BIN -n $CON_PROC -f $LOCK_TEST_FILE -T 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -ne 0 ]; then
+ echo "locks by threads failed:`date +%T`"
+ return 11;
+ else
+ echo "end threads:`date +%T`"
+ if [ $err -ne 0 ]; then
+ return 11;
+ else
+ return 0;
+ fi
+ fi
+
+}
+
+main "$@"; \ No newline at end of file
diff --git a/sanity/system_light/scripts/ltp_test.sh b/sanity/system_light/scripts/ltp_test.sh
new file mode 100755
index 0000000..a4242b6
--- /dev/null
+++ b/sanity/system_light/scripts/ltp_test.sh
@@ -0,0 +1,335 @@
+#!/bin/bash
+
+_init ()
+{
+ TOTAL=20;
+ PASS=0;
+}
+
+
+run_fs_perms_simpletest ()
+{
+ echo "Executing $LTP_DIR/fs_perms/fs_perms_simpletest.sh"
+#cp $LTP_DIR/fs_perms/fs_perms.sh .
+ cp $LTP_DIR/fs_perms/fs_perms .
+ cp $LTP_DIR/fs_perms/testx .
+ time $LTP_DIR/fs_perms/fs_perms_simpletest.sh 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "fs_perms_simpletest failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_lftest ()
+{
+ echo "Executing $LTP_DIR/lftest/lftest"
+ time $LTP_DIR/lftest/lftest 5000 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "lftest failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_stream1 ()
+{
+ echo "Executing $LTP_DIR/stream/stream01"
+ time $LTP_DIR/stream/stream01 -c 22 -i 22 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "stream01 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_stream2 ()
+{
+ echo "Executing $LTP_DIR/stream/stream02"
+ time $LTP_DIR/stream/stream02 -c 22 -i 22 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "stream02 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_stream3 ()
+{
+ echo "Executing $LTP_DIR/stream/stream03"
+ time $LTP_DIR/stream/stream03 -c 22 -i 22 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "stream03 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_stream4 ()
+{
+ echo "Executing $LTP_DIR/stream/stream04"
+ time $LTP_DIR/stream/stream04 -c 22 -i 22 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "stream04 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_stream5 ()
+{
+ echo "Executing $LTP_DIR/stream/stream05"
+ time $LTP_DIR/stream/stream05 -c 22 -i 22 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "stream05 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_stream ()
+{
+ run_stream1;
+ run_stream2;
+ run_stream3;
+ run_stream4;
+ run_stream5;
+}
+
+run_openfile ()
+{
+ echo "Executing $LTP_DIR/openfile/openfile"
+ time $LTP_DIR/openfile/openfile -f 100 -t 100 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "openfile failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_inode1 ()
+{
+ echo "Executing $LTP_DIR/inode/inode01"
+ time $LTP_DIR/inode/inode01 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "inode01 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_inode2 ()
+{
+ echo "Executing $LTP_DIR/inode/inode02"
+ time $LTP_DIR/inode/inode02 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "inode02 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_inode ()
+{
+ run_inode1;
+ run_inode2;
+}
+
+run_ftest1 ()
+{
+ echo "Executing $LTP_DIR/ftest/ftest01"
+ time $LTP_DIR/ftest/ftest01 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "ftest01 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_ftest2 ()
+{
+ echo "Executing $LTP_DIR/ftest/ftest02"
+ time $LTP_DIR/ftest/ftest02 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "ftest02 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_ftest3 ()
+{
+ echo "Executing $LTP_DIR/ftest/ftest03"
+ time $LTP_DIR/ftest/ftest03 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "ftest03 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_ftest4 ()
+{
+ echo "Executing $LTP_DIR/ftest/ftest04"
+ time $LTP_DIR/ftest/ftest04 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "ftest04 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_ftest5 ()
+{
+ echo "Executing $LTP_DIR/ftest/ftest05"
+ time $LTP_DIR/ftest/ftest05 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "ftest05 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_ftest6 ()
+{
+ echo "Executing $LTP_DIR/ftest/ftest06"
+ time $LTP_DIR/ftest/ftest06 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "ftest06 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_ftest7 ()
+{
+ echo "Executing $LTP_DIR/ftest/ftest07"
+ time $LTP_DIR/ftest/ftest07 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "ftest07 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_ftest8 ()
+{
+ echo "Executing $LTP_DIR/ftest/ftest08"
+ time $LTP_DIR/ftest/ftest08 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "ftest08 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_ftest ()
+{
+ run_ftest1;
+ run_ftest2;
+ run_ftest3;
+ run_ftest4;
+ run_ftest5;
+ run_ftest6;
+ run_ftest7;
+ run_ftest8;
+}
+
+run_fsstress ()
+{
+ echo "Executing $LTP_DIR/fsstress/fsstress"
+ time $LTP_DIR/fsstress/fsstress -d $THIS_TEST_DIR -l 22 -n 22 -p 22 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "fsstress failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_fs_inod ()
+{
+ echo "Executing $LTP_DIR/fs_inod/fs_inod"
+ time $LTP_DIR/fs_inod/fs_inod $THIS_TEST_DIR 22 22 22 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "fs_inod failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+main ()
+{
+ echo "start ltp tests:$(date +%T)";
+ run_fs_perms_simpletest;
+ run_lftest;
+ run_stream;
+ run_openfile;
+ run_inode;
+ run_ftest;
+ run_fsstress;
+ run_fs_inod;
+ echo "end ltp tests: $(date +%T)";
+ echo "total $PASS tests were successful out of $TOTAL tests"
+}
+
+_init && main "$@" \ No newline at end of file
diff --git a/sanity/system_light/scripts/ltp_test.sh~ b/sanity/system_light/scripts/ltp_test.sh~
new file mode 100755
index 0000000..090b663
--- /dev/null
+++ b/sanity/system_light/scripts/ltp_test.sh~
@@ -0,0 +1,335 @@
+#!/bin/bash
+
+_init ()
+{
+ TOTAL=20;
+ PASS=0;
+}
+
+
+run_fs_perms_simpletest ()
+{
+ echo "Executing $LTP_DIR/fs_perms/fs_perms_simpletest.sh"
+#cp $LTP_DIR/fs_perms/fs_perms.sh .
+ cp $LTP_DIR/fs_perms/fs_perms .
+ cp $LTP_DIR/fs_perms/testx .
+ time $LTP_DIR/fs_perms/fs_perms_simpletest.sh 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "fs_perms_simpletest failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_lftest ()
+{
+ echo "Executing $LTP_DIR/lftest/lftest"
+ time $LTP_DIR/lftest/lftest 5000 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "lftest failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_stream1 ()
+{
+ echo "Executing $LTP_DIR/stream/stream01"
+ time $LTP_DIR/stream/stream01 -c 22 -i 22 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "stream01 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_stream2 ()
+{
+ echo "Executing $LTP_DIR/stream/stream02"
+ time $LTP_DIR/stream/stream02 -c 22 -i 22 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "stream02 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_stream2 ()
+{
+ echo "Executing $LTP_DIR/stream/stream03"
+ time $LTP_DIR/stream/stream03 -c 22 -i 22 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "stream03 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_stream4 ()
+{
+ echo "Executing $LTP_DIR/stream/stream04"
+ time $LTP_DIR/stream/stream04 -c 22 -i 22 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "stream04 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_stream5 ()
+{
+ echo "Executing $LTP_DIR/stream/stream05"
+ time $LTP_DIR/stream/stream05 -c 22 -i 22 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "stream05 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_stream ()
+{
+ run_stream1;
+ run_stream2;
+ run_stream3;
+ run_stream4;
+ run_stream5;
+}
+
+run_openfile ()
+{
+ echo "Executing $LTP_DIR/openfile/openfile"
+ time $LTP_DIR/openfile/openfile -f 100 -t 100 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "openfile failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_inode1 ()
+{
+ echo "Executing $LTP_DIR/inode/inode01"
+ time $LTP_DIR/inode/inode01 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "inode01 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_inode2 ()
+{
+ echo "Executing $LTP_DIR/inode/inode02"
+ time $LTP_DIR/inode/inode02 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "inode02 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_inode ()
+{
+ run_inode1;
+ run_inode2;
+}
+
+run_ftest1 ()
+{
+ echo "Executing $LTP_DIR/ftest/ftest01"
+ time $LTP_DIR/ftest/ftest01 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "ftest01 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_ftest2 ()
+{
+ echo "Executing $LTP_DIR/ftest/ftest02"
+ time $LTP_DIR/ftest/ftest02 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "ftest02 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_ftest3 ()
+{
+ echo "Executing $LTP_DIR/ftest/ftest03"
+ time $LTP_DIR/ftest/ftest03 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "ftest03 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_ftest4 ()
+{
+ echo "Executing $LTP_DIR/ftest/ftest04"
+ time $LTP_DIR/ftest/ftest04 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "ftest04 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_ftest5 ()
+{
+ echo "Executing $LTP_DIR/ftest/ftest05"
+ time $LTP_DIR/ftest/ftest05 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "ftest05 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_ftest6 ()
+{
+ echo "Executing $LTP_DIR/ftest/ftest06"
+ time $LTP_DIR/ftest/ftest06 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "ftest06 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_ftest7 ()
+{
+ echo "Executing $LTP_DIR/ftest/ftest07"
+ time $LTP_DIR/ftest/ftest07 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "ftest07 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_ftest8 ()
+{
+ echo "Executing $LTP_DIR/ftest/ftest08"
+ time $LTP_DIR/ftest/ftest08 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "ftest08 failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_ftest ()
+{
+ run_ftest1;
+ run_ftest2;
+ run_ftest3;
+ run_ftest4;
+ run_ftest5;
+ run_ftest6;
+ run_ftest7;
+ run_ftest8;
+}
+
+run_fsstress ()
+{
+ echo "Executing $LTP_DIR/fsstress/fsstress"
+ time $LTP_DIR/fsstress/fsstress -d $THIS_TEST_DIR -l 22 -n 22 -p 22 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "fsstress failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+run_fs_inod ()
+{
+ echo "Executing $LTP_DIR/fs_inod/fs_inod"
+ time $LTP_DIR/fs_inod/fs_inod $THIS_TEST_DIR 22 22 22 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+ else
+ echo "fs_inod failed:$(date +%T)"
+ echo $PASS
+ fi
+}
+
+main ()
+{
+ echo "start ltp tests:$(date +%T)";
+ run_fs_perms_simpletest;
+ run_lftest;
+ run_stream;
+ run_openfile;
+ run_inode;
+ run_ftest;
+ run_fsstress;
+ run_fs_inod;
+ echo "end ltp tests: $(date +%T)";
+ echo "total $PASS tests were successful out of $TOTAL tests"
+}
+
+_init && main "$@" \ No newline at end of file
diff --git a/sanity/system_light/scripts/mmapstress.sh b/sanity/system_light/scripts/mmapstress.sh
new file mode 100644
index 0000000..bfcb206
--- /dev/null
+++ b/sanity/system_light/scripts/mmapstress.sh
@@ -0,0 +1,83 @@
+#!/bin/sh
+
+echo "Executing $MMAP_DIR/mmapstress/mmapstress01.sh"
+#cp $LTP_DIR/fs_perms/fs_perms.sh .
+time $MMAP_DIR/mmapstress/mmapstress01 -p $MMAP_PROC -t $MMAP_TIME -f $MMAP_FILE_SIZE -r -o -l -m -d 2>>$LOG_FILE 1>>$LOG_FILE
+
+if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+else
+ echo "mmapstress01 failed"
+ echo $PASS
+fi
+
+echo "Executing $MMAP_DIR/mmapstress/mmapstress02"
+time $MMAP_DIR/mmapstress/mmapstress02 2>>$LOG_FILE 1>>$LOG_FILE
+
+if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+else
+ echo "mmapstress02 failed"
+ echo $PASS
+fi
+
+echo "Executing $MMAP_DIR/mmapstress/mmapstress03"
+time $MMAP_DIR/mmapstress/mmapstress03 2>>$LOG_FILE 1>>$LOG_FILE
+
+if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+else
+ echo "mmapstress03 failed"
+ echo $PASS
+fi
+
+echo "Executing $MMAP_DIR/mmapstress/mmapstress04"
+echo "Creating the file needed to be tested by mmapstress03"
+touch mmap_file
+time $MMAP_DIR/mmapstress/mmapstress04 mmap_file 0 2>>$LOG_FILE 1>>$LOG_FILE
+
+if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ rm mmap_file
+ echo $PASS
+else
+ echo "mmapstress04 failed"
+ rm mmap_file
+ echo $PASS
+fi
+
+echo "Executing $MMAP_DIR/mmapstress/mmapstress05"
+time $MMAP_DIR/mmapstress/mmapstress05 2>>$LOG_FILE 1>>$LOG_FILE
+
+if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+else
+ echo "mmapstress05 failed"
+ echo $PASS
+fi
+
+echo "Executing $MMAP_DIR/mmapstress/mmapstress06"
+time $MMAP_DIR/mmapstress/mmapstress06 $MMAP_SLEEP_TIME 2>>$LOG_FILE 1>>$LOG_FILE
+if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+else
+ echo "mmapstress06 failed"
+ echo $PASS
+fi
+
+#not working below
+echo "Executing $MMAP_DIR/mmapstress/mmapstress02"
+time $MMAP_DIR/mmapstress/mmapstress02 2>>$LOG_FILE 1>>$LOG_FILE
+
+if [ $? -eq 0 ]; then
+ let PASS=$PASS+1
+ echo $PASS
+else
+ echo "mmapstress02 failed"
+ echo $PASS
+fi \ No newline at end of file
diff --git a/sanity/system_light/scripts/multiple_files.sh b/sanity/system_light/scripts/multiple_files.sh
new file mode 100755
index 0000000..8f36b5f
--- /dev/null
+++ b/sanity/system_light/scripts/multiple_files.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+# This script creates a directory,creates large number of files in it, lists the contnts of the directory and removes the files
+
+function main ()
+{
+ mkdir test
+ cd test
+
+ echo "start:`date +%T`"
+ for i in `seq 1 $NUM_OF_FILES` ; do
+ dd if=/dev/zero of=file$i bs=10K count=1 1>/dev/null 2>/dev/null
+ done
+ echo "end:`date +%T`"
+
+ echo "Creation of $NUM_OF_FILES done"
+
+ TOTAL_FILES=$(ls | wc -l)
+
+ if [ $TOTAL_FILES -ne $NUM_OF_FILES ]; then
+ echo "Total files created is not $NUM_OF_FILES"
+ err=11
+ else
+ err=0
+ fi
+
+ echo "Removing all the files"
+
+ for i in `seq 1 $NUM_OF_FILES` ; do
+ rm file$i
+ done
+
+ cd ..
+ rmdir test
+ if [ $err -ne 0 ]; then
+ return $err
+ else
+ return 0;
+ fi
+}
+
+
+main "$@";
diff --git a/sanity/system_light/scripts/open.sh b/sanity/system_light/scripts/open.sh
new file mode 100755
index 0000000..366c3a7
--- /dev/null
+++ b/sanity/system_light/scripts/open.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+#This scripts takes openssl tar file,untars it and builds it.
+
+function main()
+{
+ echo "untarring the openssl tarball"
+ echo "start:`date +%T`"
+ time tar -xvf $OPENSSL_TAR_FILE 2>>$LOG_FILE 1>>$LOG_FILE
+ cd $OPENSSL_DIR
+
+ if [ -z "$PREFIX" -a -z "$OPENSSLDIR" ]; then
+ echo "executing ./config:`date +%T`"
+ time ./config 2>>$LOG_FILE 1>>$LOG_FILE
+ if [ $? -ne 0 ]; then
+ echo "./config failed:`date +%T`"
+ return 11;
+ fi
+ else
+ echo "executing ./config with prefix:`date +%T`"
+ time ./config --prefix=$PREFIX --openssldir=$OPENSSLDIR 2>>$LOG_FILE 1>>$LOG_FILE
+ if [ $? -ne 0 ]; then
+ echo "config prefix failed:`date +%T`"
+ return 11;
+ fi
+ fi
+
+ echo "executing make:`date +%T`"
+ time make 2>>$LOG_FILE 1>>$LOG_FILE
+ if [ $? -ne 0 ]; then
+ echo "make failed:`date +%T`"
+ return 11
+ fi
+
+ echo "executing make test:`date +%T`"
+ time make test 2>>$LOG_FILE 1>>$LOG_FILE
+ if [ $? -ne 0 ]; then
+ echo "make test failed:`date +%T`"
+ return 11;
+ else
+ return 0;
+ fi
+}
+
+main "$@";
diff --git a/sanity/system_light/scripts/posix_compliance.sh b/sanity/system_light/scripts/posix_compliance.sh
new file mode 100755
index 0000000..69c8dcd
--- /dev/null
+++ b/sanity/system_light/scripts/posix_compliance.sh
@@ -0,0 +1,6 @@
+#! /bin/bash
+
+(time prove -r $DIR/tests "$@" | tee -a /tmp/posix
+
+grep FAILED /tmp/posix 2> /dev/null) 2>>$LOG_FILE 1>>$LOG_FILE
+
diff --git a/sanity/system_light/scripts/postmark.sh b/sanity/system_light/scripts/postmark.sh
new file mode 100755
index 0000000..51ce440
--- /dev/null
+++ b/sanity/system_light/scripts/postmark.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+#This program runs the tool postmark which is a filesystem benchmark program. To know the details of it see the man page.
+function main()
+{
+
+ echo "start:`date +%T`"
+ time postmark $POST_FILE 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -ne 0 ]; then
+ echo "end:`date +%T`"
+ return 11;
+ else
+ echo "end:`date +%T`"
+ return 0;
+ fi
+}
+
+main "$@"; \ No newline at end of file
diff --git a/sanity/system_light/scripts/read_large.sh b/sanity/system_light/scripts/read_large.sh
new file mode 100755
index 0000000..7a315a0
--- /dev/null
+++ b/sanity/system_light/scripts/read_large.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+function main()
+{
+ echo "start:`date +%T`"
+ time cat $LARGE_FILE_SOURCE > $LARGE_FILE_DEST 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -ne 0 ]; then
+ echo "end:`date +%T`"
+ return 11;
+ else
+ echo "end:`date +%T`"
+ return 0;
+ fi
+}
+
+main "$@"; \ No newline at end of file
diff --git a/sanity/system_light/scripts/rpc-coverage.sh b/sanity/system_light/scripts/rpc-coverage.sh
new file mode 100755
index 0000000..ebb92a2
--- /dev/null
+++ b/sanity/system_light/scripts/rpc-coverage.sh
@@ -0,0 +1,481 @@
+#!/bin/bash
+
+# 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;
+set -o pipefail;
+
+function fail() {
+ echo "$*: failed.";
+ exit 1;
+}
+
+function test_mkdir()
+{
+ mkdir -p $PFX/dir;
+ test $(stat -c '%F' $PFX/dir) == "directory" || fail "mkdir"
+}
+
+
+function test_create()
+{
+ : > $PFX/dir/file;
+
+ test "$(stat -c '%F' $PFX/dir/file)" == "regular empty file" || fail "create"
+}
+
+
+function test_statfs()
+{
+ local size;
+
+ size=$(stat -f -c '%s' $PFX/dir/file);
+ test "x$size" != "x0" || fail "statfs"
+}
+
+
+function test_open()
+{
+ exec 4<$PFX/dir/file || fail "open"
+ exec 4>&- || fail "open"
+}
+
+
+function test_write()
+{
+ dd if=/dev/zero of=$PFX/dir/file bs=65536 count=16 2>/dev/null;
+ test $(stat -c '%s' $PFX/dir/file) == 1048576 || fail "open"
+}
+
+
+function test_read()
+{
+ local count;
+
+ count=$(dd if=$PFX/dir/file bs=64k count=16 2>/dev/null | wc -c);
+ test $count == 1048576 || fail "read"
+}
+
+
+function test_truncate()
+{
+ truncate -s 512 $PFX/dir/file;
+ test $(stat -c '%s' $PFX/dir/file) == 512 || fail "truncate"
+
+ truncate -s 0 $PFX/dir/file;
+ test $(stat -c '%s' $PFX/dir/file) == 0 || fail "truncate"
+}
+
+
+function test_fstat()
+{
+ local msg;
+
+ export PFX;
+ msg=$(sh -c 'tail -f $PFX/dir/file --pid=$$ & sleep 1 && echo hooha > $PFX/dir/file && sleep 1');
+ test "x$msg" == "xhooha" || fail "fstat"
+}
+
+
+function test_mknod()
+{
+ mknod -m 0666 $PFX/dir/block b 13 42;
+ test "$(stat -c '%F %a %t %T' $PFX/dir/block)" == "block special file 666 d 2a" \
+ || fail "mknod for block device"
+
+ mknod -m 0666 $PFX/dir/char c 13 42;
+ test "$(stat -c '%F %a %t %T' $PFX/dir/char)" == "character special file 666 d 2a" \
+ || fail "mknod for character device"
+
+ mknod -m 0666 $PFX/dir/fifo p;
+ test "$(stat -c '%F %a' $PFX/dir/fifo)" == "fifo 666" || \
+ fail "mknod for fifo"
+}
+
+
+function test_symlink()
+{
+ local msg;
+
+ ln -s $PFX/dir/file $PFX/dir/symlink;
+ test "$(stat -c '%F' $PFX/dir/symlink)" == "symbolic link" || fail "Creation of symlink"
+
+ msg=$(cat $PFX/dir/symlink);
+ test "x$msg" == "xhooha" || fail "Content match for symlink"
+}
+
+
+function test_hardlink()
+{
+ local ino1;
+ local ino2;
+ local nlink1;
+ local nlink2;
+ local msg;
+
+ ln $PFX/dir/file $PFX/dir/hardlink;
+
+ ino1=$(stat -c '%i' $PFX/dir/file);
+ nlink1=$(stat -c '%h' $PFX/dir/file);
+ ino2=$(stat -c '%i' $PFX/dir/hardlink);
+ nlink2=$(stat -c '%h' $PFX/dir/hardlink);
+
+ test $ino1 == $ino2 || fail "Inode comparison for hardlink"
+ test $nlink1 == 2 || fail "Link count for hardlink"
+ test $nlink2 == 2 || fail "Link count for hardlink"
+
+ msg=$(cat $PFX/dir/hardlink);
+
+ test "x$msg" == "xhooha" || fail "Content match for hardlinks"
+}
+
+
+function test_rename()
+{
+ local ino1;
+ local ino2;
+ local ino3;
+ local msg;
+
+ #### file
+
+ ino1=$(stat -c '%i' $PFX/dir/file);
+
+ mv $PFX/dir/file $PFX/dir/file2 || fail "mv"
+ msg=$(cat $PFX/dir/file2);
+ test "x$msg" == "xhooha" || fail "File contents comparison after mv"
+
+ ino2=$(stat -c '%i' $PFX/dir/file2);
+ test $ino1 == $ino2 || fail "Inode comparison after mv"
+
+ mv $PFX/dir/file2 $PFX/dir/file;
+ msg=$(cat $PFX/dir/file);
+ test "x$msg" == "xhooha" || fail "File contents comparison after mv"
+
+ ino3=$(stat -c '%i' $PFX/dir/file);
+ test $ino1 == $ino3 || fail "Inode comparison after mv"
+
+ #### dir
+
+ ino1=$(stat -c '%i' $PFX/dir);
+
+ mv $PFX/dir $PFX/dir2 || fail "Directory mv"
+ ino2=$(stat -c '%i' $PFX/dir2);
+ test $ino1 == $ino2 || fail "Inode comparison after directory mv"
+
+ mv $PFX/dir2 $PFX/dir || fail "Directory mv"
+ ino3=$(stat -c '%i' $PFX/dir);
+ test $ino1 == $ino3 || fail "Inode comparison after directory mv"
+}
+
+
+function test_chmod()
+{
+ local mode0;
+ local mode1;
+ local mode2;
+
+
+ #### file
+
+ mode0=$(stat -c '%a' $PFX/dir/file);
+ chmod 0753 $PFX/dir/file || fail "chmod"
+
+ mode1=$(stat -c '%a' $PFX/dir/file);
+ test 0$mode1 == 0753 || fail "Mode comparison after chmod"
+
+ chmod 0$mode0 $PFX/dir/file || fail "chmod"
+ mode2=$(stat -c '%a' $PFX/dir/file);
+ test 0$mode2 == 0$mode0 || fail "Mode comparison after chmod"
+
+ #### dir
+
+ mode0=$(stat -c '%a' $PFX/dir);
+ chmod 0753 $PFX/dir || fail "chmod"
+
+ mode1=$(stat -c '%a' $PFX/dir);
+ test 0$mode1 == 0753 || fail "Mode comparison after chmod"
+
+ chmod 0$mode0 $PFX/dir || fail "chmod"
+ mode2=$(stat -c '%a' $PFX/dir);
+ test 0$mode2 == 0$mode0 || fail "Mode comparison after chmod"
+}
+
+
+function test_chown()
+{
+ local user1;
+ local user2;
+ local group1;
+ local group2;
+
+ #### file
+
+ user1=$(stat -c '%u' $PFX/dir/file);
+ group1=$(stat -c '%g' $PFX/dir/file);
+
+ chown 13:42 $PFX/dir/file || fail "chown"
+
+ user2=$(stat -c '%u' $PFX/dir/file);
+ group2=$(stat -c '%g' $PFX/dir/file);
+
+ test $user2 == 13 || fail "User comparison after chown"
+ test $group2 == 42 || fail "Group comparison after chown"
+
+ chown $user1:$group1 $PFX/dir/file || fail "chown"
+
+ user2=$(stat -c '%u' $PFX/dir/file);
+ group2=$(stat -c '%g' $PFX/dir/file);
+
+ test $user2 == $user1 || fail "User comparison after chown"
+ test $group2 == $group1 || fail "Group comparison after chown"
+
+ #### dir
+
+ user1=$(stat -c '%u' $PFX/dir);
+ group1=$(stat -c '%g' $PFX/dir);
+
+ chown 13:42 $PFX/dir || fail "chown"
+
+ user2=$(stat -c '%u' $PFX/dir);
+ group2=$(stat -c '%g' $PFX/dir);
+
+ test $user2 == 13 || fail "User comparison after chown"
+ test $group2 == 42 || fail "Group comparison after chown"
+
+ chown $user1:$group1 $PFX/dir || fail "chown"
+
+ user2=$(stat -c '%u' $PFX/dir);
+ group2=$(stat -c '%g' $PFX/dir);
+
+ test $user2 == $user1 || fail "User comparison after chown"
+ test $group2 == $group1 || fail "Group comparison after chown"
+}
+
+
+function test_utimes()
+{
+ local acc0;
+ local acc1;
+ local acc2;
+ local mod0;
+ local mod1;
+ local mod2;
+
+ #### file
+
+ acc0=$(stat -c '%X' $PFX/dir/file);
+ mod0=$(stat -c '%Y' $PFX/dir/file);
+
+ sleep 1;
+ touch -a $PFX/dir/file || fail "atime change on file"
+
+ acc1=$(stat -c '%X' $PFX/dir/file);
+ mod1=$(stat -c '%Y' $PFX/dir/file);
+
+ sleep 1;
+ touch -m $PFX/dir/file || fail "mtime change on file"
+
+ acc2=$(stat -c '%X' $PFX/dir/file);
+ mod2=$(stat -c '%Y' $PFX/dir/file);
+
+ test $acc0 != $acc1 || fail "atime mismatch comparison on file"
+ test $acc1 == $acc2 || fail "atime match comparison on file"
+ test $mod0 == $mod1 || fail "mtime match comparison on file"
+ test $mod1 != $mod2 || fail "mtime mismatch comparison on file"
+
+ #### dir
+
+ acc0=$(stat -c '%X' $PFX/dir);
+ mod0=$(stat -c '%Y' $PFX/dir);
+
+ sleep 1;
+ touch -a $PFX/dir || fail "atime change on directory"
+
+ acc1=$(stat -c '%X' $PFX/dir);
+ mod1=$(stat -c '%Y' $PFX/dir);
+
+ sleep 1;
+ touch -m $PFX/dir || fail "mtime change on directory"
+
+ acc2=$(stat -c '%X' $PFX/dir);
+ mod2=$(stat -c '%Y' $PFX/dir);
+
+ test $acc0 != $acc1 || fail "atime mismatch comparison on directory"
+ test $acc1 == $acc2 || fail "atime match comparison on directory"
+ test $mod0 == $mod1 || fail "mtime match comparison on directory"
+ test $mod1 != $mod2 || fail "mtime mismatch comparison on directory"
+}
+
+
+function test_locks()
+{
+ exec 200>$PFX/dir/lockfile || fail "exec"
+
+ ## exclusive locks test
+ flock -e 200 || fail "flock -e"
+ ! flock -n -e $PFX/dir/lockfile -c true || fail "! flock -n -e"
+ ! flock -n -s $PFX/dir/lockfile -c true || fail "! flock -n -s"
+ flock -u 200 || fail "flock -u"
+
+ ## shared locks test
+ flock -s 200 || fail "flock -s"
+ ! flock -n -e $PFX/dir/lockfile -c true || fail "! flock -n -e"
+ flock -n -s $PFX/dir/lockfile -c true || fail "! flock -n -s"
+ flock -u 200 || fail "flock -u"
+
+ exec 200>&- || fail "exec"
+
+}
+
+
+function test_readdir()
+{
+ /bin/ls $PFX/dir >/dev/null || fail "ls"
+}
+
+
+function test_setxattr()
+{
+ setfattr -n trusted.testing -v c00k33 $PFX/dir/file || fail "setfattr"
+}
+
+
+function test_listxattr()
+{
+ getfattr -m trusted $PFX/dir/file 2>/dev/null | grep -q trusted.testing || fail "getfattr"
+}
+
+
+function test_getxattr()
+{
+ getfattr -n trusted.testing $PFX/dir/file 2>/dev/null | grep -q c00k33 || fail "getfattr"
+}
+
+
+function test_removexattr()
+{
+ setfattr -x trusted.testing $PFX/dir/file || fail "setfattr remove"
+ getfattr -n trusted.testing $PFX/dir/file 2>&1 | grep -q 'No such attribute' \
+ || fail "getfattr"
+}
+
+
+function test_unlink()
+{
+ rm $PFX/dir/file || fail "rm"
+}
+
+
+function test_rmdir()
+{
+ rm -rf $PFX || fail "rm -rf"
+}
+
+
+function run_tests()
+{
+ test_mkdir;
+ test_create;
+ test_statfs;
+ test_open;
+ test_write;
+ test_read;
+ test_truncate;
+ test_fstat;
+ test_mknod;
+ test_hardlink;
+ test_symlink;
+ test_rename;
+ test_chmod;
+ test_chown;
+ test_utimes;
+ test_locks;
+ test_readdir;
+ test_setxattr;
+ test_listxattr;
+ test_getxattr;
+ test_removexattr;
+ test_unlink;
+ test_rmdir;
+}
+
+
+function _init()
+{
+ DIR=$(pwd);
+}
+
+
+function parse_cmdline()
+{
+ if [ "x$1" == "x" ] ; then
+ echo "Usage: $0 /path/mount"
+ exit 1
+ fi
+
+ DIR=$1;
+
+ if [ ! -d "$DIR" ] ; then
+ echo "$DIR: not a directory"
+ exit 1
+ fi
+
+ PFX="$DIR/coverage";
+ rm -rvf $PFX;
+}
+
+
+function main()
+{
+ parse_cmdline "$@";
+
+ run_tests;
+
+ exit 0;
+}
+
+
+_init && main "$@";
diff --git a/sanity/system_light/scripts/rpc-fops.sh b/sanity/system_light/scripts/rpc-fops.sh
new file mode 100755
index 0000000..07ad9d6
--- /dev/null
+++ b/sanity/system_light/scripts/rpc-fops.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+function main ()
+{
+ SCRIPTS_DIR=$(dirname $0);
+
+ echo "start: $(date +%T)";
+ #time $SCRIPTS_PATH/rpc-coverage.sh $THIS_TEST_DIR 2>>$LOG_FILE 1>>$LOG_FILE;
+ time $SCRIPTS_DIR/rpc-coverage.sh $THIS_TEST_DIR 2>>$LOG_FILE 1>>$LOG_FILE;
+ if [ $? -ne 0 ]; then
+ echo "end: $(date +%T)";
+ return 22;
+ else
+ echo "end: $(date +%T)";
+ return 0;
+ fi
+}
+
+main "$@" \ No newline at end of file
diff --git a/sanity/system_light/scripts/rpc-fops.sh~ b/sanity/system_light/scripts/rpc-fops.sh~
new file mode 100644
index 0000000..07d2b89
--- /dev/null
+++ b/sanity/system_light/scripts/rpc-fops.sh~
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+function main ()
+{
+ set -x;
+ SCRIPTS_DIR=$(dirname $0);
+
+ echo "start: $(date +%T)";
+ #time $SCRIPTS_PATH/rpc-coverage.sh $THIS_TEST_DIR 2>>$LOG_FILE 1>>$LOG_FILE;
+ time $SCRIPTS_DIR/rpc-coverage.sh $THIS_TEST_DIR 2>>$LOG_FILE 1>>$LOG_FILE;
+ if [ $? -ne 0 ]; then
+ echo "end: $(date +%T)";
+ return 22;
+ else
+ echo "end: $(date +%T)";
+ return 0;
+ fi
+}
+
+main "$@" \ No newline at end of file
diff --git a/sanity/system_light/scripts/syscallbench.sh b/sanity/system_light/scripts/syscallbench.sh
new file mode 100755
index 0000000..c257e41
--- /dev/null
+++ b/sanity/system_light/scripts/syscallbench.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+function update_tools()
+{
+ cd $TOOL_DIR
+ echo "In $TOOL_DIR"
+ git pull
+ make
+ echo "Switching to previous directory"
+ cd -
+}
+
+function syscall_test()
+{
+ $SYSCALL_BIN > $LOG_DIR/`date +%F`
+ if [ $? -ne 0 ]; then
+ echo "syscall_test failed"
+ return 11;
+ fi
+}
+
+function main()
+{
+ update_tools;
+ echo "start:`date +%T`"
+ syscall_test;
+ if [ $? -ne 0 ]; then
+ echo "end:`date +%T`"
+ return 11;
+ fi
+}
+
+main "$@"
diff --git a/sanity/system_light/scripts/tiobench.sh b/sanity/system_light/scripts/tiobench.sh
new file mode 100755
index 0000000..593bf6a
--- /dev/null
+++ b/sanity/system_light/scripts/tiobench.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+function main ()
+{
+ echo "start:`date +%T`"
+ time $TIO_BIN -d $THIS_TEST_DIR -W -S -c 2>>$LOG_FILE 1>>$LOG_FILE
+
+ if [ $? -ne 0 ]; then
+ echo "end:`date +%T`"
+ return 11;
+ else
+ echo "end:`date +%T`"
+ return 0;
+ fi
+}
+
+main "$@"; \ No newline at end of file