From d0de625d5cf9a84840bdd2fa1a88b9614d428cb6 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Wed, 13 Jul 2011 18:32:10 +0530 Subject: sanity script for testing the functionality of filesystem --- sanity/system_light/scripts/#kernel.sh# | 44 +++ sanity/system_light/scripts/arequal_test.sh | 23 ++ sanity/system_light/scripts/blazer.sh | 25 ++ sanity/system_light/scripts/bonnie_test.sh | 18 + sanity/system_light/scripts/dbench_test.sh | 20 + sanity/system_light/scripts/dd_test.sh | 19 + sanity/system_light/scripts/ffsb_test.sh | 19 + sanity/system_light/scripts/fileop_test.sh | 22 ++ sanity/system_light/scripts/fsx_test.sh | 21 ++ sanity/system_light/scripts/glusterfs_build.sh | 48 +++ sanity/system_light/scripts/iozone_test.sh | 20 + sanity/system_light/scripts/kernel.sh | 44 +++ sanity/system_light/scripts/kernel.sh~ | 43 +++ sanity/system_light/scripts/kernel_compile.sh | 262 +++++++++++++ sanity/system_light/scripts/lmbench_test.sh | 7 + sanity/system_light/scripts/locks.sh | 39 ++ sanity/system_light/scripts/ltp_test.sh | 335 +++++++++++++++++ sanity/system_light/scripts/ltp_test.sh~ | 335 +++++++++++++++++ sanity/system_light/scripts/mmapstress.sh | 83 ++++ sanity/system_light/scripts/multiple_files.sh | 43 +++ sanity/system_light/scripts/open.sh | 45 +++ sanity/system_light/scripts/posix_compliance.sh | 6 + sanity/system_light/scripts/postmark.sh | 19 + sanity/system_light/scripts/read_large.sh | 17 + sanity/system_light/scripts/rpc-coverage.sh | 481 ++++++++++++++++++++++++ sanity/system_light/scripts/rpc-fops.sh | 19 + sanity/system_light/scripts/rpc-fops.sh~ | 20 + sanity/system_light/scripts/syscallbench.sh | 33 ++ sanity/system_light/scripts/tiobench.sh | 17 + 29 files changed, 2127 insertions(+) create mode 100755 sanity/system_light/scripts/#kernel.sh# create mode 100755 sanity/system_light/scripts/arequal_test.sh create mode 100755 sanity/system_light/scripts/blazer.sh create mode 100755 sanity/system_light/scripts/bonnie_test.sh create mode 100755 sanity/system_light/scripts/dbench_test.sh create mode 100755 sanity/system_light/scripts/dd_test.sh create mode 100755 sanity/system_light/scripts/ffsb_test.sh create mode 100755 sanity/system_light/scripts/fileop_test.sh create mode 100755 sanity/system_light/scripts/fsx_test.sh create mode 100755 sanity/system_light/scripts/glusterfs_build.sh create mode 100755 sanity/system_light/scripts/iozone_test.sh create mode 100755 sanity/system_light/scripts/kernel.sh create mode 100755 sanity/system_light/scripts/kernel.sh~ create mode 100755 sanity/system_light/scripts/kernel_compile.sh create mode 100755 sanity/system_light/scripts/lmbench_test.sh create mode 100755 sanity/system_light/scripts/locks.sh create mode 100755 sanity/system_light/scripts/ltp_test.sh create mode 100755 sanity/system_light/scripts/ltp_test.sh~ create mode 100644 sanity/system_light/scripts/mmapstress.sh create mode 100755 sanity/system_light/scripts/multiple_files.sh create mode 100755 sanity/system_light/scripts/open.sh create mode 100755 sanity/system_light/scripts/posix_compliance.sh create mode 100755 sanity/system_light/scripts/postmark.sh create mode 100755 sanity/system_light/scripts/read_large.sh create mode 100755 sanity/system_light/scripts/rpc-coverage.sh create mode 100755 sanity/system_light/scripts/rpc-fops.sh create mode 100644 sanity/system_light/scripts/rpc-fops.sh~ create mode 100755 sanity/system_light/scripts/syscallbench.sh create mode 100755 sanity/system_light/scripts/tiobench.sh (limited to 'sanity/system_light/scripts') 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]... +. + +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 -- cgit