From fd734cffb3f6ce2d995de89a09a6d83458de7ca4 Mon Sep 17 00:00:00 2001 From: grev Date: Fri, 20 Feb 2009 20:10:39 +0000 Subject: [PATCH] b=18443 i=Adilger remove obsolete tests scripts --- lustre/tests/2ost.sh | 54 ---- lustre/tests/Makefile.am | 14 +- lustre/tests/acceptance-metadata-double.sh | 128 -------- lustre/tests/acceptance-metadata-parallel.sh | 105 ------- lustre/tests/acceptance-metadata-single.sh | 153 --------- lustre/tests/busy.sh | 7 - lustre/tests/cfg/insanity-adev.sh | 37 --- lustre/tests/cfg/insanity-mdev.sh | 37 --- lustre/tests/cfg/mdev.sh | 32 -- lustre/tests/cmknod.c | 167 ---------- lustre/tests/cobd.sh | 34 -- lustre/tests/crash-mod.sh | 11 - lustre/tests/createdestroy.c | 258 --------------- lustre/tests/createtest.c | 12 +- lustre/tests/fchdir_test.c | 77 ----- lustre/tests/gensymmap.c | 132 -------- lustre/tests/getdents.c | 67 ---- lustre/tests/ldaptest.c | 63 ---- lustre/tests/liblustre_sanity_uml.sh | 83 ----- lustre/tests/llecho.sh | 23 -- lustre/tests/mcr.sh | 45 --- lustre/tests/o_directory.c | 85 ----- lustre/tests/openclose.c | 178 ----------- lustre/tests/openme.c | 59 ---- lustre/tests/replay-single.sh | 9 +- lustre/tests/sanity-lmv.sh | 451 --------------------------- lustre/tests/sanity.sh | 30 +- lustre/tests/sanityN.sh | 2 - lustre/tests/set_dates.sh | 4 - lustre/tests/sleeptest.c | 151 --------- lustre/tests/test2.c | 89 ------ lustre/tests/toexcl.c | 113 ------- 32 files changed, 40 insertions(+), 2670 deletions(-) delete mode 100644 lustre/tests/2ost.sh delete mode 100644 lustre/tests/acceptance-metadata-double.sh delete mode 100644 lustre/tests/acceptance-metadata-parallel.sh delete mode 100644 lustre/tests/acceptance-metadata-single.sh delete mode 100644 lustre/tests/busy.sh delete mode 100644 lustre/tests/cfg/insanity-adev.sh delete mode 100644 lustre/tests/cfg/insanity-mdev.sh delete mode 100644 lustre/tests/cfg/mdev.sh delete mode 100644 lustre/tests/cmknod.c delete mode 100755 lustre/tests/cobd.sh delete mode 100644 lustre/tests/crash-mod.sh delete mode 100644 lustre/tests/createdestroy.c delete mode 100644 lustre/tests/fchdir_test.c delete mode 100644 lustre/tests/gensymmap.c delete mode 100644 lustre/tests/getdents.c delete mode 100644 lustre/tests/ldaptest.c delete mode 100644 lustre/tests/liblustre_sanity_uml.sh delete mode 100644 lustre/tests/llecho.sh delete mode 100755 lustre/tests/mcr.sh delete mode 100644 lustre/tests/o_directory.c delete mode 100644 lustre/tests/openclose.c delete mode 100644 lustre/tests/openme.c delete mode 100644 lustre/tests/sanity-lmv.sh delete mode 100644 lustre/tests/set_dates.sh delete mode 100644 lustre/tests/sleeptest.c delete mode 100755 lustre/tests/test2.c delete mode 100644 lustre/tests/toexcl.c diff --git a/lustre/tests/2ost.sh b/lustre/tests/2ost.sh deleted file mode 100644 index 57ddc08..0000000 --- a/lustre/tests/2ost.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash - -export PATH=`dirname $0`/../utils:$PATH - -config=${1:-`basename $0 .sh`.xml} - -LMC="${LMC:-lmc} -m $config" -TMP=${TMP:-/tmp} - -HOSTNAME=`hostname` - -MDSDEV=${MDSDEV:-$TMP/mds1-`hostname`} -MDSSIZE=${MDSSIZE:-400000} -FSTYPE=${FSTYPE:-ext3} -MOUNT=${MOUNT:-/mnt/lustre} -MOUNT2=${MOUNT2:-${MOUNT}2} -NETTYPE=${NETTYPE:-tcp} - -OSTDEV=${OSTDEV:-$TMP/ost-`hostname`} -OSTSIZE=${OSTSIZE:-400000} - -# specific journal size for the ost, in MB -JSIZE=${JSIZE:-0} -[ "$JSIZE" -gt 0 ] && JARG="--journal_size $JSIZE" -MDSISIZE=${MDSISIZE:-0} -[ "$MDSISIZE" -gt 0 ] && IARG="--inode_size $MDSISIZE" - -STRIPE_BYTES=${STRIPE_BYTES:-1048576} -STRIPES_PER_OBJ=0 # 0 means stripe over all OSTs - -rm -f $config - -# create nodes -${LMC} --add node --node $HOSTNAME || exit 10 -${LMC} --add net --node $HOSTNAME --nid `hostname` --nettype $NETTYPE || exit 11 -${LMC} --add net --node client --nid '*' --nettype $NETTYPE || exit 12 - -# configure mds server -${LMC} --add mds --node $HOSTNAME --mds mds1 --fstype $FSTYPE \ - --dev $MDSDEV --size $MDSSIZE $JARG $IARG $MDSOPT || exit 20 - -# configure ost -${LMC} -m $config --add lov --lov lov1 --mds mds1 --stripe_sz $STRIPE_BYTES \ - --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0 $LOVOPT || exit 20 -${LMC} --add ost --ost ost1 --node $HOSTNAME --lov lov1 \ - --fstype $FSTYPE --dev $OSTDEV --size $OSTSIZE $JARG $OSTOPT || exit 30 -${LMC} --add ost --ost ost2 --node $HOSTNAME --lov lov1 \ - --fstype $FSTYPE --dev ${OSTDEV}2 --size $OSTSIZE $JARG $OSTOPT || exit 30 - -# create client config -${LMC} --add mtpt --node $HOSTNAME --path $MOUNT --mds mds1 --lov lov1 \ - $CLIENTOPT || exit 40 -${LMC} --add mtpt --node client --path $MOUNT2 --mds mds1 --lov lov1 \ - $CLIENTOPT || exit 41 diff --git a/lustre/tests/Makefile.am b/lustre/tests/Makefile.am index 753f67a..fae5f37 100644 --- a/lustre/tests/Makefile.am +++ b/lustre/tests/Makefile.am @@ -5,7 +5,7 @@ AM_CFLAGS = $(LLCFLAGS) # LDADD := -lreadline -ltermcap # -lefence noinst_DATA = disk1_8.tar.bz2 -noinst_SCRIPTS = leak_finder.pl llecho.sh llmount.sh llmountcleanup.sh +noinst_SCRIPTS = leak_finder.pl llmount.sh llmountcleanup.sh noinst_SCRIPTS += test-framework.sh runvmstat runiozone runtests noinst_SCRIPTS += sanity.sh rundbench acceptance-small.sh compile.sh noinst_SCRIPTS += conf-sanity.sh insanity.sh lfscktest.sh oos.sh oos2.sh @@ -35,12 +35,12 @@ EXTRA_DIST = $(noinst_SCRIPTS) $(noinst_DATA) \ $(nobase_noinst_SCRIPTS) $(nobase_noinst_DATA) if TESTS -noinst_PROGRAMS = openunlink truncate directio openme writeme mlink utime it_test -noinst_PROGRAMS += tchmod toexcl fsx test_brw openclose createdestroy sendfile +noinst_PROGRAMS = openunlink truncate directio writeme mlink utime it_test +noinst_PROGRAMS += tchmod fsx test_brw sendfile noinst_PROGRAMS += createmany chownmany statmany multifstat createtest -noinst_PROGRAMS += opendirunlink opendevunlink unlinkmany fchdir_test checkstat -noinst_PROGRAMS += statone runas openfile getdents o_directory rmdirmany -noinst_PROGRAMS += small_write multiop sleeptest ll_sparseness_verify cmknod +noinst_PROGRAMS += opendirunlink opendevunlink unlinkmany checkstat +noinst_PROGRAMS += statone runas openfile rmdirmany +noinst_PROGRAMS += small_write multiop ll_sparseness_verify noinst_PROGRAMS += ll_sparseness_write mrename ll_dirstripe_verify mkdirmany noinst_PROGRAMS += openfilleddirunlink rename_many memhog iopentest1 iopentest2 noinst_PROGRAMS += mmap_sanity flock_test writemany reads flocks_test @@ -48,7 +48,7 @@ noinst_PROGRAMS += ll_getstripe_info write_time_limit rwv if MPITESTS noinst_PROGRAMS += parallel_grouplock write_append_truncate createmany_mpi mdsrate endif -# noinst_PROGRAMS += ldaptest copy_attr mkdirdeep +# noinst_PROGRAMS += copy_attr mkdirdeep bin_PROGRAMS = mcreate munlink testdir = $(libdir)/lustre/tests test_SCRIPTS = $(noinst_SCRIPTS) $(noinst_PROGRAMS) diff --git a/lustre/tests/acceptance-metadata-double.sh b/lustre/tests/acceptance-metadata-double.sh deleted file mode 100644 index 6027db7..0000000 --- a/lustre/tests/acceptance-metadata-double.sh +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -set -e - -# -# Runs create.pl and rename.pl on two mountpoints with increasing load, varying -# debug levels. Assumes that the node is already setup with llmount2.sh -# - -SRCDIR="`dirname $0`" -CREATE=$SRCDIR/create.pl -RENAME=$SRCDIR/rename.pl - -TIME=${TIME:-/usr/bin/time} - -display_elapsed_time() { - PREVIOUS_TS=$CURRENT_TS - CURRENT_TS=`date +%s` - BLOCK_ELAPSED=`expr $CURRENT_TS - $PREVIOUS_TS` - TOTAL_ELAPSED=`expr $CURRENT_TS - $START_TS` - - echo " " - echo "Elapsed time (block): ${BLOCK_ELAPSED} seconds" - echo "Elapsed time (TOTAL): ${TOTAL_ELAPSED} seconds" - echo " " -} - -debug_client_on() -{ - lctl set_param -n debug=-1 -} - -debug_client_off() -{ - lctl set_param -n debug=0x3f0400 -} - -MNT=${MNT:-/mnt/lustre} - -# Get our initial timestamps. -START_TS=`date +%s` -CURRENT_TS=$START_TS -PREVIOUS_TS=$START_TS - -debug_client_on -echo "create.pl, 2 mounts, 1 thread, 10 ops, debug on" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=10 -echo "create.pl, 2 mounts, 1 thread, 100 ops, debug on" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=100 --silent -echo "create.pl --use_mcreate=0, 2 mounts, 1 thread, 10 ops, debug on" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=10 --use_mcreate=0 -echo "create.pl --use_mcreate=0, 2 mounts, 1 thread, 100 ops, debug on" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=100 --use_mcreate=0 --silent -echo "rename.pl, 2 mounts, 1 thread, 10 ops, debug on" -$TIME perl $RENAME --mountpt=${MNT} --num_mounts=2 --iterations=10 -echo "rename.pl, 2 mounts, 1 thread, 100 ops, debug on" -$TIME perl $RENAME --mountpt=${MNT} --num_mounts=2 --iterations=100 --silent - -display_elapsed_time - -debug_client_off -echo "create.pl, 2 mounts, 1 thread, 1000 ops, debug off" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=1000 --silent -echo "create.pl --use_mcreate=0, 2 mounts, 1 thread, 1000 ops, debug off" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=1000 --use_mcreate=0 --silent -echo "rename.pl, 2 mounts, 1 thread, 1000 ops, debug off" -$TIME perl $RENAME --mountpt=${MNT} --num_mounts=2 --iterations=1000 --silent - -display_elapsed_time - -debug_client_on -echo "create.pl, 2 mounts, 2 threads, 100 ops, debug on" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=100 --num_threads=2 --silent -echo "create.pl --use_mcreate=0, 2 mounts, 2 threads, 100 ops, debug on" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=100 --num_threads=2 --use_mcreate=0 --silent -echo "rename.pl, 2 mounts, 2 thread, 1000 ops, debug on" -$TIME perl $RENAME --mountpt=${MNT} --num_mounts=2 --iterations=1000 --num_threads=2 --silent - -display_elapsed_time - -debug_client_off -echo "create.pl, 2 mounts, 2 threads, 2000 ops, debug off" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=2 --silent -echo "create.pl --use_mcreate=0, 2 mounts, 2 threads, 2000 ops, debug off" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=2 --use_mcreate=0 --silent -echo "rename.pl, 2 mounts, 2 threads, 2000 ops, debug off" -$TIME perl $RENAME --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=2 --silent - -display_elapsed_time - -debug_client_on -echo "create.pl, 2 mounts, 4 threads, 100 ops, debug on" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=100 --num_threads=4 --silent -echo "create.pl --use_mcreate=0, 2 mounts, 4 threads, 100 ops, debug on" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=100 --num_threads=4 --use_mcreate=0 --silent -echo "rename.pl, 2 mounts, 4 threads, 2000 ops, debug on" -$TIME perl $RENAME --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=4 --silent - -display_elapsed_time - -debug_client_off -echo "create.pl, 2 mounts, 4 threads, 2000 ops, debug off" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=4 --silent -echo "create.pl --use_mcreate=0, 2 mounts, 4 threads, 2000 ops, debug off" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=4 --use_mcreate=0 --silent -echo "rename.pl, 2 mounts, 4 threads, 2000 ops, debug off" -$TIME perl $RENAME --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=4 --silent - -display_elapsed_time - -debug_client_on -echo "create.pl, 2 mounts, 8 threads, 500 ops, debug on" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=500 --num_threads=8 --silent -echo "create.pl --use_mcreate=0, 2 mounts, 8 threads, 500 ops, debug on" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=500 --num_threads=8 --use_mcreate=0 --silent -echo "rename.pl, 2 mounts, 8 threads, 2000 ops, debug on" -$TIME perl $RENAME --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=8 --silent - -display_elapsed_time - -debug_client_off -echo "create.pl, 2 mounts, 8 threads, 2000 ops, debug off" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=8 --silent -echo "create.pl --use_mcreate=0, 2 mounts, 8 threads, 2000 ops, debug off" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=8 --use_mcreate=0 --silent -echo "rename.pl, 2 mounts, 8 threads, 2000 ops, debug off" -$TIME perl $RENAME --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=8 --silent - -display_elapsed_time diff --git a/lustre/tests/acceptance-metadata-parallel.sh b/lustre/tests/acceptance-metadata-parallel.sh deleted file mode 100644 index e302ecf..0000000 --- a/lustre/tests/acceptance-metadata-parallel.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/sh -set -e - -######################################################################### -# Runs create.pl on a single mountpoint and directory with increasing -# load across multiple clients. -######################################################################### - -LUSTRE=${LUSTRE:-`dirname $0`/..} -LTESTDIR=${LTESTDIR:-$LUSTRE/../ltest} -PATH=$LUSTRE/utils:$LUSTRE/tests:$PATH - -RLUSTRE=${RLUSTRE:-$LUSTRE} -RPWD=${RPWD:-$PWD} - -. $LUSTRE/tests/test-framework.sh - -TIME=${TIME:-/usr/bin/time} -PDSH=${PDSH:-"pdsh -S -w"} -MOUNTPT=${MOUNTPT:-"/mnt/lustre"} - -CREATE=$LUSTRE/tests/create.pl -RENAME=$LUSTRE/tests/rename.pl - -[ -z "$CLIENTS" ] && exit 1 -#CLIENTS=`comma_list $CLIENTS` - -display_elapsed_time() { - PREVIOUS_TS=$CURRENT_TS - CURRENT_TS=`date +%s` - BLOCK_ELAPSED=`expr $CURRENT_TS - $PREVIOUS_TS` - TOTAL_ELAPSED=`expr $CURRENT_TS - $START_TS` - - echo " " - echo "Elapsed time (block): ${BLOCK_ELAPSED} seconds" - echo "Elapsed time (TOTAL): ${TOTAL_ELAPSED} seconds" - echo " " -} - -set_debug_level() -{ - $PDSH $CLIENTS "echo $1 > /proc/sys/lnet/debug" -} - -debug_client_on() -{ - set_debug_level -1 -} - -debug_client_partial() -{ - set_debug_level 0x3f0400 -} - -debug_client_off() -{ - set_debug_level 0 -} - -# Get our initial timestamps. -START_TS=`date +%s` -CURRENT_TS=$START_TS -PREVIOUS_TS=$START_TS - -debug_client_off - -echo "create.pl, 1 mount, 1 thread, 1000 ops" -$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=1000 --silent" -#echo "create.pl --mcreate=0, 1 mount, 1 thread, 1000 ops, debug off" -#$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=1000 --use_mcreate=0 --silent" -wait -#echo "rename.pl, 1 mount, 1 thread, 1000 ops, debug off" -#$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $RENAME --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=1000 --silent" - -display_elapsed_time - -echo "create.pl, 1 mount, 2 threads, 2000 ops, debug off" -$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=2 --silent" -#echo "create.pl --mcreate=0, 1 mount, 2 threads, 2000 ops, debug off" -#$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=2 --use_mcreate=0 --silent" -wait -#echo "rename.pl, 1 mount, 2 threads, 2000 ops, debug off" -#$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $RENAME --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=2 --silent# - -display_elapsed_time - -echo "create.pl, 1 mount, 4 threads, 2000 ops, debug off" -$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=4 --silent" -#echo "create.pl --mcreate=0, 1 mount, 4 threads, 2000 ops, debug off" -#$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=4 --use_mcreate=0 --silent" -wait -#echo "rename.pl, 1 mount, 4 threads, 2000 ops, debug off" -#$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $RENAME --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=4 --silent" - -display_elapsed_time - -echo "create.pl, 1 mount, 8 threads, 2000 ops, debug off" -$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=8 --silent" -#echo "create.pl --mcreate=0, 1 mount, 8 threads, 2000 ops, debug off" -#$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=8 --use_mcreate=0 --silent" -wait -#echo "rename.pl, 1 mount, 8 threads, 2000 ops, debug off" -#$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $RENAME --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=8 --silent" - -display_elapsed_time diff --git a/lustre/tests/acceptance-metadata-single.sh b/lustre/tests/acceptance-metadata-single.sh deleted file mode 100644 index 685f9f4..0000000 --- a/lustre/tests/acceptance-metadata-single.sh +++ /dev/null @@ -1,153 +0,0 @@ -#!/bin/sh -set -e - -# -# Runs create.pl and rename.pl on a single mountpoint with increasing -# load, varying debug levels -# - -SRCDIR="`dirname $0`" -CREATE=$SRCDIR/create.pl -RENAME=$SRCDIR/rename.pl - -TIME=${TIME:-/usr/bin/time} - -display_elapsed_time() { - PREVIOUS_TS=$CURRENT_TS - CURRENT_TS=`date +%s` - BLOCK_ELAPSED=`expr $CURRENT_TS - $PREVIOUS_TS` - TOTAL_ELAPSED=`expr $CURRENT_TS - $START_TS` - - echo " " - echo "Elapsed time (block): ${BLOCK_ELAPSED} seconds" - echo "Elapsed time (TOTAL): ${TOTAL_ELAPSED} seconds" - echo " " -} - -debug_client_on() -{ - lctl set_param -n debug=-1 -} - -debug_client_off() -{ - lctl set_param -n debug=0x3f0400 -} - -MNT=${MNT:-/mnt/lustre} - -# Get our initial timestamps. -START_TS=`date +%s` -CURRENT_TS=$START_TS -PREVIOUS_TS=$START_TS - -debug_client_on -echo "create.pl, 1 mount, 1 thread, 10 ops, debug on" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=-1 --iterations=10 -echo "create.pl, 1 mount, 1 thread, 100 ops, debug on" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=-1 --iterations=100 --silent -echo "create.pl --mcreate=0, 1 mount, 1 thread, 10 ops, debug on" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=-1 --iterations=10 --use_mcreate=0 -echo "create.pl --mcreate=0, 1 mount, 1 thread, 100 ops, debug on" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=-1 --iterations=100 --use_mcreate=0 --silent -echo "rename.pl, 1 mount, 1 thread, 10 ops, debug on" -$TIME perl $RENAME --mountpt=${MNT} --num_mounts=-1 --iterations=10 -echo "rename.pl, 1 mount, 1 thread, 100 ops, debug on" -$TIME perl $RENAME --mountpt=${MNT} --num_mounts=-1 --iterations=100 --silent - -display_elapsed_time - -debug_client_off -echo "create.pl, 1 mount, 1 thread, 1000 ops, debug off" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=-1 --iterations=1000 --silent -echo "create.pl --mcreate=0, 1 mount, 1 thread, 1000 ops, debug off" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=-1 --iterations=1000 --use_mcreate=0 --silent -echo "rename.pl, 1 mount, 1 thread, 1000 ops, debug off" -$TIME perl $RENAME --mountpt=${MNT} --num_mounts=-1 --iterations=1000 --silent - -display_elapsed_time - -debug_client_on -echo "create.pl, 1 mount, 2 threads, 100 ops, debug on" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=-1 --iterations=100 --num_threads=2 --silent -echo "create.pl --mcreate=0, 1 mount, 2 threads, 100 ops, debug on" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=-1 --iterations=100 --num_threads=2 --use_mcreate=0 --silent -echo "rename.pl, 1 mount, 2 thread, 1000 ops, debug on" -$TIME perl $RENAME --mountpt=${MNT} --num_mounts=-1 --iterations=1000 --num_threads=2 --silent - -display_elapsed_time - -debug_client_off -echo "create.pl, 1 mount, 2 threads, 2000 ops, debug off" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=-1 --iterations=2000 --num_threads=2 --silent -echo "create.pl --mcreate=0, 1 mount, 2 threads, 2000 ops, debug off" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=-1 --iterations=2000 --num_threads=2 --use_mcreate=0 --silent -wait -echo "rename.pl, 1 mount, 2 threads, 2000 ops, debug off" -$TIME perl $RENAME --mountpt=${MNT} --num_mounts=-1 --iterations=2000 --num_threads=2 --silent - -display_elapsed_time - -debug_client_on -echo "create.pl, 1 mount, 4 threads, 100 ops, debug on" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=-1 --iterations=100 --num_threads=4 --silent -echo "create.pl --mcreate=0, 1 mount, 4 threads, 100 ops, debug on" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=-1 --iterations=100 --num_threads=4 --use_mcreate=0 --silent -echo "rename.pl, 1 mount, 4 threads, 2000 ops, debug on" -$TIME perl $RENAME --mountpt=${MNT} --num_mounts=-1 --iterations=2000 --num_threads=4 --silent - -display_elapsed_time - -debug_client_off -echo "create.pl, 1 mount, 4 threads, 2000 ops, debug off" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=-1 --iterations=2000 --num_threads=4 --silent -echo "create.pl --mcreate=0, 1 mount, 4 threads, 2000 ops, debug off" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=-1 --iterations=2000 --num_threads=4 --use_mcreate=0 --silent -echo "rename.pl, 1 mount, 4 threads, 2000 ops, debug off" -$TIME perl $RENAME --mountpt=${MNT} --num_mounts=-1 --iterations=2000 --num_threads=4 --silent - -display_elapsed_time - -debug_client_on -echo "create.pl, 1 mount, 8 threads, 500 ops, debug on" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=-1 --iterations=500 --num_threads=8 --silent -echo "create.pl --mcreate=0, 1 mount, 8 threads, 500 ops, debug on" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=-1 --iterations=500 --num_threads=8 --use_mcreate=0 --silent -echo "rename.pl, 1 mount, 8 threads, 2000 ops, debug on" -$TIME perl $RENAME --mountpt=${MNT} --num_mounts=-1 --iterations=2000 --num_threads=8 --silent - -display_elapsed_time - -debug_client_off -echo "create.pl, 1 mount, 8 threads, 2000 ops, debug off" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=-1 --iterations=2000 --num_threads=8 --silent -echo "create.pl --mcreate=0, 1 mount, 8 threads, 2000 ops, debug off" -$TIME perl $CREATE --mountpt=${MNT} --num_mounts=-1 --iterations=2000 --num_threads=8 --use_mcreate=0 --silent -echo "rename.pl, 1 mount, 8 threads, 2000 ops, debug off" -$TIME perl $RENAME --mountpt=${MNT} --num_mounts=-1 --iterations=2000 --num_threads=8 --silent - -display_elapsed_time - -$TIME sh rundbench 1 - -display_elapsed_time - -$TIME sh rundbench 2 - -display_elapsed_time - -$TIME sh rundbench 4 - -display_elapsed_time - -$TIME sh rundbench 8 - -display_elapsed_time - -$TIME sh rundbench 16 - -display_elapsed_time - -$TIME sh rundbench 32 - -display_elapsed_time diff --git a/lustre/tests/busy.sh b/lustre/tests/busy.sh deleted file mode 100644 index 2f90986..0000000 --- a/lustre/tests/busy.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - - mkdir /mnt/lustre/d22 - mkdir /mnt/lustre/d22/etc - ./mcreate /mnt/lustre/d22/etc/foo - ls -ld /mnt/lustre/etc - ls -ld /mnt/lustre/d22/etc diff --git a/lustre/tests/cfg/insanity-adev.sh b/lustre/tests/cfg/insanity-adev.sh deleted file mode 100644 index 756043a..0000000 --- a/lustre/tests/cfg/insanity-adev.sh +++ /dev/null @@ -1,37 +0,0 @@ -mds_HOST=${mds_HOST:-adev2} -mdsfailover_HOST=${mdsfailover_HOST:-adev2} -ost1_HOST=${ost1_HOST:-adev3} -ost2_HOST=${ost2_HOST:-adev4} -EXTRA_OSTS=${EXTRA_OSTS:-adev7} -client_HOST=client -LIVE_CLIENT=${LIVE_CLIENT:-adev8} -# This should always be a list, not a regexp -#FAIL_CLIENTS=${FAIL_CLIENTS:-mdev7} -FAIL_CLIENTS=${FAIL_CLIENTS:-"adev9 adev10 adev11 adev12"} -EXTRA_CLIENTS=${EXTRA_CLIENTS:-"adev[13-15]"} - -NETTYPE=${NETTYPE:-tcp} - -TIMEOUT=${TIMEOUT:-30} -PTLDEBUG=${PTLDEBUG:-0} -SUBSYSTEM=${SUBSYSTEM:-0} -MOUNT=${MOUNT:-"/mnt/lustre"} -#UPCALL=${CLIENT_UPCALL:-`pwd`/replay-single-upcall.sh} - -MDSDEV=${MDSDEV:-/dev/sdc} -MDSSIZE=${MDSSIZE:-50000} -MDSJOURNALSIZE=${MDSJOURNALSIZE:-0} - -OSTDEV=${OSTDEV:-$TMP/ost%d-`hostname`} -OSTSIZE=${OSTSIZE:=50000} -OSTJOURNALSIZE=${OSTJOURNALSIZE:-0} - -FSTYPE=${FSTYPE:-ext3} -STRIPE_BYTES=${STRIPE_BYTES:-1048576} -STRIPES_PER_OBJ=${STRIPES_PER_OBJ:-0} - -FAILURE_MODE=${FAILURE_MODE:-HARD} # or HARD -POWER_DOWN=${POWER_DOWN:-"powerman --off"} -POWER_UP=${POWER_UP:-"powerman --on"} - -PDSH="pdsh -S -w " diff --git a/lustre/tests/cfg/insanity-mdev.sh b/lustre/tests/cfg/insanity-mdev.sh deleted file mode 100644 index 59ceeb3..0000000 --- a/lustre/tests/cfg/insanity-mdev.sh +++ /dev/null @@ -1,37 +0,0 @@ -mds_HOST=${mds_HOST:-mdev4} -mdsfailover_HOST=${mdsfailover_HOST:-mdev5} -ost1_HOST=${ost1_HOST:-mdev2} -ost2_HOST=${ost2_HOST:-mdev3} -EXTRA_OSTS=${EXTRA_OSTS:-mdev7} -client_HOST=client -LIVE_CLIENT=${LIVE_CLIENT:-mdev6} -# This should always be a list, not a regexp -FAIL_CLIENTS=${FAIL_CLIENTS:-mdev8} -#FAIL_CLIENTS=${FAIL_CLIENTS:-""} -SINGLEMDS=${SINGLEMDS:-"mds"} - -NETTYPE=${NETTYPE:-tcp} - -TIMEOUT=${TIMEOUT:-30} -PTLDEBUG=${PTLDEBUG:-0x3f0400} -SUBSYSTEM=${SUBSYSTEM:- 0xffb7e3ff} -MOUNT=${MOUNT:-"/mnt/lustre"} -#UPCALL=${CLIENT_UPCALL:-`pwd`/replay-single-upcall.sh} - -MDSDEV=${MDSDEV:-/dev/sda1} -MDSSIZE=${MDSSIZE:-50000} -MDSJOURNALSIZE=${MDSJOURNALSIZE:-0} - -OSTDEV=${OSTDEV:-$TMP/ost%d-`hostname`} -OSTSIZE=${OSTSIZE:=500000} -OSTJOURNALSIZE=${OSTJOURNALSIZE:-0} - -FSTYPE=${FSTYPE:-ext3} -STRIPE_BYTES=${STRIPE_BYTES:-1048576} -STRIPES_PER_OBJ=${STRIPES_PER_OBJ:-0} - -FAILURE_MODE=${FAILURE_MODE:-HARD} # or HARD -POWER_DOWN=${POWER_DOWN:-"powerman --off"} -POWER_UP=${POWER_UP:-"powerman --on"} - -PDSH="pdsh -S -w " diff --git a/lustre/tests/cfg/mdev.sh b/lustre/tests/cfg/mdev.sh deleted file mode 100644 index 251e4ff..0000000 --- a/lustre/tests/cfg/mdev.sh +++ /dev/null @@ -1,32 +0,0 @@ - -mds_HOST=${mds_HOST:-mdev4} -mdsfailover_HOST=${mdsfailover_HOST:-mdev5} -ost_HOST=${ost_HOST:-mdev2} -ost2_HOST=${ost2_HOST:-mdev3} -client_HOST=${client_HOST:-client} -NETTYPE=${NETTYPE:-tcp} -SINGLEMDS=${SINGLEMDS:-"mds"} - -MOUNT=${MOUNT:-"/mnt/lustre"} -MOUNT1=${MOUNT1:-$MOUNT} -MOUNT2=${MOUNT2:-"/mnt/lustre2"} -DIR=${DIR:-$MOUNT} -DIR2=${DIR2:-$MOUNT1} -PTLDEBUG=${PTLDEBUG:-0x3f0400} -SUBSYSTEM=${SUBSYSTEM:- 0xffb7e3ff} -PDSH=${PDSH:-pdsh -S -w} - -MDSDEV=${MDSDEV:-/dev/sda1} -MDSSIZE=${MDSSIZE:-100000} -OSTDEV=${OSTDEV:-/tmp/ost1-`hostname`} -OSTSIZE=${OSTSIZE:-200000} -FSTYPE=${FSTYPE:-ext3} -TIMEOUT=${TIMEOUT:-10} -#UPCALL=${UPCALL:-$PWD/replay-single-upcall.sh} - -STRIPE_BYTES=${STRIPE_BYTES:-1048576} -STRIPES_PER_OBJ=${STRIPES_PER_OBJ:-0} - -FAILURE_MODE=${FAILURE_MODE:-SOFT} # or HARD -POWER_DOWN=${POWER_DOWN:-"powerman --off"} -POWER_UP=${POWER_UP:-"powerman --on"} diff --git a/lustre/tests/cmknod.c b/lustre/tests/cmknod.c deleted file mode 100644 index 49e7ecc..0000000 --- a/lustre/tests/cmknod.c +++ /dev/null @@ -1,167 +0,0 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * - * GPL HEADER START - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 only, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License version 2 for more details (a copy is included - * in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU General Public License - * version 2 along with this program; If not, see - * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - * GPL HEADER END - */ -/* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved - * Use is subject to license terms. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - * - * lustre/tests/cmknod.c - * - * Simple test to check that device nodes are correctly created and visible - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#define TEST_MINOR 120 -#define TEST_MAJOR 25 - -void usage(char *prog) -{ - fprintf(stderr, "usage: %s \n", prog); - exit(1); -} - -/* UMKA: This stuff inlined here instead of using appropriate header - to avoid linking to symbols which is not present in newer libc. - - Currently this is the case, as UML image contains RedHat 9 and - developers use something newer (Fedora, etc.). */ -inline unsigned int -__gnu_dev_major (unsigned long long int __dev) -{ - return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff); -} - -inline unsigned int -__gnu_dev_minor (unsigned long long int __dev) -{ - return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff); -} - -inline unsigned long long int -__gnu_dev_makedev (unsigned int __major, unsigned int __minor) -{ - return ((__minor & 0xff) | ((__major & 0xfff) << 8) - | (((unsigned long long int) (__minor & ~0xff)) << 12) - | (((unsigned long long int) (__major & ~0xfff)) << 32)); -} - -#define __minor(dev) __gnu_dev_minor(dev) -#define __major(dev) __gnu_dev_major(dev) -#define __makedev(maj, min) __gnu_dev_makedev(maj, min) - -int main( int argc, char **argv) -{ - char *prog = argv[0]; - char *filename = argv[1]; - int rc; - struct stat st; - dev_t device = __makedev(TEST_MAJOR, TEST_MINOR); - - if (argc != 2) - usage(prog); - - unlink(filename); - - /* First try block devices */ - rc = mknod(filename, 0700 | S_IFBLK, device); - if ( rc < 0 ) { - fprintf(stderr, "%s: mknod(%s) failed: rc %d: %s\n", - prog, filename, errno, strerror(errno)); - return 2; - } - - rc = stat(filename, &st); - if ( rc < 0 ) { - fprintf(stderr, "%s: stat(%s) failed: rc %d: %s\n", - prog, filename, errno, strerror(errno)); - return 3; - } - - if ( st.st_rdev != device) { - fprintf(stderr, "%s: created device other than requested: (%u,%u) instead of (%u,%u)\n", - prog, __major(st.st_rdev),__minor(st.st_rdev),__major(device),__minor(device)); - return 4; - } - if (!S_ISBLK(st.st_mode)) { - fprintf(stderr, "%s: created device of different type. Requested block device, got mode %o\n", prog, st.st_mode); - return 5; - } - - rc = unlink(filename); - if ( rc < 0 ) { - fprintf(stderr, "%s: Cannot unlink created device %s, rc %d: %s\n", - prog, filename, errno, strerror(errno)); - return 6; - } - - /* Second try char devices */ - rc = mknod(filename, 0700 | S_IFCHR, device); - if ( rc < 0 ) { - fprintf(stderr, "%s: mknod(%s) failed: rc %d: %s\n", - prog, filename, errno, strerror(errno)); - return 7; - } - - rc = stat(filename, &st); - if ( rc < 0 ) { - fprintf(stderr, "%s: stat(%s) failed: rc %d: %s\n", - prog, filename, errno, strerror(errno)); - return 8; - } - if ( st.st_rdev != device) { - fprintf(stderr, "%s: created device other than requested: (%u,%u) instead of (%u,%u)\n", - prog, __major(st.st_rdev),__minor(st.st_rdev),__major(device),__minor(device)); - return 9; - } - if (!S_ISCHR(st.st_mode)) { - fprintf(stderr, "%s: created device of different type. Requested char device, got mode %o\n", prog, st.st_mode); - return 10; - } - - rc = unlink(filename); - if ( rc < 0 ) { - fprintf(stderr, "%s: Cannot unlink created device %s, rc %d: %s\n", - prog, filename, errno, strerror(errno)); - return 11; - } - - printf("%s: device nodes created correctly\n", prog); - - return 0; -} diff --git a/lustre/tests/cobd.sh b/lustre/tests/cobd.sh deleted file mode 100755 index 3b7e8ac..0000000 --- a/lustre/tests/cobd.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - - -config=${1:-$(basename $0 .sh)}.xml - -LMC=${LMC:-../utils/lmc -m $config} -TMP=${TMP:-/tmp} - -HOSTNAME=`hostname` - -MDSDEV=${MDSDEV:-$TMP/mds1-`hostname`} -MDSSIZE=50000 -FSTYPE=${FSTYPE:-ext3} - -OSTDEV=${OSTDEV:-$TMP/ost1-`hostname`} -OSTSIZE=200000 - -rm -f $config -# create nodes -${LMC} --add node --node $HOSTNAME || exit 10 -${LMC} --add net --node $HOSTNAME --nid $HOSTNAME --nettype tcp || exit 11 - -# configure mds server -${LMC} --add mds --node $HOSTNAME --mds mds1 --fstype $FSTYPE --dev $MDSDEV --size $MDSSIZE || exit 20 - -# configure ost -${LMC} --add ost --node $HOSTNAME --obd obd1 --fstype $FSTYPE --obdtype obdecho || exit 30 -# configure ost -${LMC} --add ost --node $HOSTNAME --obd obd2 --fstype $FSTYPE --obdtype obdecho || exit 30 - -${LMC} --add cobd --node $HOSTNAME --real_obd obd1 --cache_obd obd2 - -# create client config -# ${LMC} -m $config --add mtpt --node $HOSTNAME --path /mnt/lustre --mds mds1 --obd obd1 || exit 40 diff --git a/lustre/tests/crash-mod.sh b/lustre/tests/crash-mod.sh deleted file mode 100644 index d5ce473..0000000 --- a/lustre/tests/crash-mod.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -TMP=${TMP:-/tmp} -BASEDIR=${1:-`dirname $0`/..} -LCMD=$TMP/crash-mod-`hostname` -echo "Storing crash module info in $LCMD" -cat /tmp/ogdb-`hostname` | while read JUNK M JUNK; do - MOD="$BASEDIR/$M" - MODNAME=`basename $MOD .o` - - echo mod -s $MODNAME $MOD | tee -a $LCMD -done diff --git a/lustre/tests/createdestroy.c b/lustre/tests/createdestroy.c deleted file mode 100644 index bc145e4..0000000 --- a/lustre/tests/createdestroy.c +++ /dev/null @@ -1,258 +0,0 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * - * GPL HEADER START - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 only, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License version 2 for more details (a copy is included - * in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU General Public License - * version 2 along with this program; If not, see - * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - * GPL HEADER END - */ -/* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved - * Use is subject to license terms. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -int thread; - -#define BAD_VERBOSE (-999999999) - -#define difftime(a, b) \ - ((double)(a)->tv_sec - (b)->tv_sec + \ - ((double)((a)->tv_usec - (b)->tv_usec) / 1000000)) - -static char *cmdname(char *func) -{ - static char buf[512]; - - if (thread) { - sprintf(buf, "%s-%d", func, thread); - return buf; - } - - return func; -} - -static int be_verbose(int verbose, struct timeval *next_time, - unsigned long num, unsigned long *next_num, int num_total) -{ - struct timeval now; - - if (!verbose) - return 0; - - if (next_time != NULL) - gettimeofday(&now, NULL); - - /* A positive verbosity means to print every X iterations */ - if (verbose > 0 && (num >= *next_num || num >= num_total)) { - *next_num += verbose; - if (next_time) { - next_time->tv_sec = now.tv_sec - verbose; - next_time->tv_usec = now.tv_usec; - } - return 1; - } - - /* A negative verbosity means to print at most each X seconds */ - if (verbose < 0 && next_time != NULL && difftime(&now, next_time) >= 0){ - next_time->tv_sec = now.tv_sec - verbose; - next_time->tv_usec = now.tv_usec; - *next_num = num; - return 1; - } - - return 0; -} - -static int get_verbose(char *func, const char *arg) -{ - int verbose; - char *end; - - if (!arg || arg[0] == 'v') - verbose = 1; - else if (arg[0] == 's' || arg[0] == 'q') - verbose = 0; - else { - verbose = (int)strtoul(arg, &end, 0); - if (*end) { - fprintf(stderr, "%s: error: bad verbose option '%s'\n", - func, arg); - return BAD_VERBOSE; - } - } - - if (verbose < 0) - printf("Print status every %d seconds\n", -verbose); - else if (verbose == 1) - printf("Print status every operation\n"); - else if (verbose > 1) - printf("Print status every %d operations\n", verbose); - - return verbose; -} - -int main(int argc, char *argv[]) -{ - char filename[1024]; - int verbose = 0; - unsigned long count, i; - int threads = 0; - char *end; - int rc = 0; - - if (argc < 3 || argc > 5) { - fprintf(stderr, - "usage: %s [verbose [threads]]\n", - argv[0]); - exit(1); - } - - count = strtoul(argv[2], &end, 0); - if (*end) { - fprintf(stderr, "%s: error: bad iteration count '%s'\n", - argv[0], argv[1]); - exit(2); - } - if (argc == 4) { - verbose = get_verbose(argv[0], argv[3]); - if (verbose == BAD_VERBOSE) - exit(2); - } - if (argc == 5) { - threads = strtoul(argv[4], &end, 0); - if (*end) { - fprintf(stderr, "%s: error: bad thread count '%s'\n", - argv[0], argv[1]); - exit(2); - } - } - - for (i = 1; i <= threads; i++) { - rc = fork(); - if (rc < 0) { - fprintf(stderr, "%s: error: #%ld - %s\n", - cmdname(argv[0]), i, strerror(rc = errno)); - break; - } else if (rc == 0) { - thread = i; - break; - } else - printf("%s: thread #%ld (PID %d) started\n", - cmdname(argv[0]), i, rc); - rc = 0; - } - - if (threads && thread == 0) { /* parent process */ - int live_threads = threads; - - while (live_threads > 0) { - int status; - pid_t ret; - - ret = waitpid(0, &status, 0); - if (ret == 0) { - continue; - } - - if (ret < 0) { - fprintf(stderr, "%s: error: wait - %s\n", - argv[0], strerror(errno)); - if (!rc) - rc = errno; - } else { - /* - * This is a hack. We _should_ be able to use - * WIFEXITED(status) to see if there was an - * error, but it appears to be broken and it - * always returns 1 (OK). See wait(2). - */ - int err = WEXITSTATUS(status); - if (err || WIFSIGNALED(status)) - fprintf(stderr, - "%s: error: PID %d had rc=%d\n", - argv[0], ret, err); - if (!rc) - rc = err; - - live_threads--; - } - } - } else { - struct timeval start, end, next_time; - unsigned long next_count; - double diff; - - gettimeofday(&start, NULL); - next_time.tv_sec = start.tv_sec - verbose; - next_time.tv_usec = start.tv_usec; - - for (i = 0, next_count = verbose; i < count; i++) { - if (threads) - sprintf(filename, "%s-%d-%ld", - argv[1], thread, i); - else - sprintf(filename, "%s-%ld", argv[1], i); - - rc = mknod(filename, S_IFREG, 0); - if (rc < 0) { - fprintf(stderr, "%s: error: mknod(%s): %s\n", - cmdname(argv[0]), filename, - strerror(errno)); - rc = errno; - break; - } - if (unlink(filename) < 0) { - fprintf(stderr, "%s: error: unlink(%s): %s\n", - cmdname(argv[0]), filename, - strerror(errno)); - rc = errno; - break; - } - if (be_verbose(verbose, &next_time,i,&next_count,count)) - printf("%s: number %ld\n", cmdname(argv[0]), i); - } - - gettimeofday(&end, NULL); - diff = difftime(&end, &start); - - printf("%s: %ldx2 files in %.4gs (%.4g ops/s): rc = %d: %s", - cmdname(argv[0]), i, diff, (double)i * 2 / diff, - rc, ctime(&end.tv_sec)); - } - return rc; -} diff --git a/lustre/tests/createtest.c b/lustre/tests/createtest.c index 1e0c112..4406fea 100644 --- a/lustre/tests/createtest.c +++ b/lustre/tests/createtest.c @@ -93,18 +93,26 @@ int main(int argc, char *argv[]) argv[0], name, st.st_mode, mode); exit(12); } + if (i == S_IFCHR || i == S_IFBLK) { + if (st.st_rdev != 0x1234) { + fprintf(stderr, "%s: ERROR rdev %s: " + "%lu != 0x1234", + argv[0], name, st.st_rdev); + exit(13); + } + } rc = unlink(name); if (rc < 0) { fprintf(stderr, "%s: ERROR unlink %s: %s", argv[0], name, strerror(errno)); - exit(13); + exit(14); } break; default: if (rc == 0) { fprintf(stderr, "%s: ERROR: %s created\n", argv[0], name); - exit(14); + exit(15); } } } diff --git a/lustre/tests/fchdir_test.c b/lustre/tests/fchdir_test.c deleted file mode 100644 index b300396..0000000 --- a/lustre/tests/fchdir_test.c +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * - * GPL HEADER START - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 only, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License version 2 for more details (a copy is included - * in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU General Public License - * version 2 along with this program; If not, see - * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - * GPL HEADER END - */ -/* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved - * Use is subject to license terms. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - - -int main(int argc, char **argv) -{ - int fd; - int rc; - - fd = open(".", O_RDONLY); - if (fd < 0) { - perror("opening '.' :"); - exit(2); - } - - rc = chdir("/mnt/lustre/subdir/subdir"); - if (rc) { - perror("cannot chdir subdir:"); - exit(3); - } - - rc = fchdir(fd); - if (rc) { - perror("cannot fchdir back\n"); - exit(4); - } - - rc = close(fd); - if (rc) { - perror("cannot close '.'\n"); - exit(5); - } - - return(0); -} diff --git a/lustre/tests/gensymmap.c b/lustre/tests/gensymmap.c deleted file mode 100644 index 436cf41..0000000 --- a/lustre/tests/gensymmap.c +++ /dev/null @@ -1,132 +0,0 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * - * GPL HEADER START - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 only, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License version 2 for more details (a copy is included - * in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU General Public License - * version 2 along with this program; If not, see - * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - * GPL HEADER END - */ -/* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved - * Use is subject to license terms. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - */ - -#include -#include -#include -#include - -struct file_addr { - char path[256]; - char modname[32]; - unsigned long base; -}; - -int print_symbol_address(struct file_addr * fa) -{ - char buffer[4096]; - char cmd[256]; - char func_name[256]; - unsigned long addr; - char mode[256]; - FILE *file; - - sprintf(cmd, "modprobe -l %s", fa->modname); - file = popen(cmd, "r"); - if (!file) { - printf("failed to execute %s:%s\n." - "Have you installed modules?\n", - cmd, strerror(errno)); - pclose(file); - return -1; - } - if (fgets(buffer, 4095, file) == NULL) { - printf("failed to get modprobe ouput for %s:%s\n", - fa->modname, strerror(errno)); - pclose(file); - return -1; - } - pclose(file); - - sprintf(cmd, "nm -n %s", buffer); - file = popen(cmd, "r"); - if (!file) { - printf("failed to execute %s:%s\n." - "Have you installed modules?\n", - cmd, strerror(errno)); - return -1; - } - - while (fgets(buffer, 4095, file)) { - if (fscanf(file, "%x %s %s\n", &addr, mode, func_name) != 3) - continue; - - /* only list symbol in text section. */ - if (strcasecmp(mode, "t") == 0) { - /* skip __init functoin. How to filter others? */ - if (strcmp(func_name, "init_module") != 0) - printf("%x %s %s\n", fa->base + addr, - mode, func_name); - } - } - pclose(file); - return 0; -} - - -int generate_symbol_file() -{ - static char* cmd = "lctl modules"; - char other[4096]; - FILE *file; - struct file_addr gfa; - - memset(&gfa, 0, sizeof(gfa)); - file = popen(cmd, "r"); - if (!file) { - printf("failed to execute %s: %s\n", cmd, strerror(errno)); - return -1; - } - - while ( fscanf(file, "%s %s %lx\n", other, gfa.path, &gfa.base) == 3) { - strncpy(gfa.modname, strrchr(gfa.path, '/') + 1, - strrchr(gfa.path, '.') - strrchr(gfa.path, '/') - 1); - - //fprintf(stderr, "%s %s %#x\n", gfa.path, gfa.modname, gfa.base); - - /* continue going without checking result */ - print_symbol_address(&gfa); - memset(&gfa, 0, sizeof(gfa)); - } - pclose(file); - return 0; -} - - -int main() -{ - return generate_symbol_file(); -} diff --git a/lustre/tests/getdents.c b/lustre/tests/getdents.c deleted file mode 100644 index 7237160..0000000 --- a/lustre/tests/getdents.c +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * - * GPL HEADER START - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 only, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License version 2 for more details (a copy is included - * in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU General Public License - * version 2 along with this program; If not, see - * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - * GPL HEADER END - */ -/* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved - * Use is subject to license terms. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - */ - -#include -#include -#include -#include - -int main(int argc, char **argv) -{ - DIR *dir; - struct dirent64 *entry; - - if (argc < 2) { - fprintf(stderr, "Usage: %s dirname\n", argv[0]); - return 1; - } - - dir = opendir(argv[1]); - if (!dir) { - int rc = errno; - perror("opendir"); - return rc; - } - - while ((entry = readdir64(dir))) { - puts(entry->d_name); - } - - closedir(dir); - - return 0; -} - diff --git a/lustre/tests/ldaptest.c b/lustre/tests/ldaptest.c deleted file mode 100644 index 899377a..0000000 --- a/lustre/tests/ldaptest.c +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * - * GPL HEADER START - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 only, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License version 2 for more details (a copy is included - * in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU General Public License - * version 2 along with this program; If not, see - * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - * GPL HEADER END - */ -/* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved - * Use is subject to license terms. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - */ - -#include -#include -#include -#include - -int main(int argc, char **argv) -{ - LDAP *ld; - int err; - - ld = ldap_init("localhost", 389); - if (!ld) { - fprintf(stderr, "ldap_init: %s\n", strerror(errno)); - exit(1); - } - - err = ldap_bind_s(ld, "cn=Manager,dc=lustre,dc=cfs", "secret", - LDAP_AUTH_SIMPLE); - if (err) { - fprintf(stderr, "ldap_bind: %s\n", ldap_err2string(err)); - exit(1); - } - - - - -} diff --git a/lustre/tests/liblustre_sanity_uml.sh b/lustre/tests/liblustre_sanity_uml.sh deleted file mode 100644 index ee035d0..0000000 --- a/lustre/tests/liblustre_sanity_uml.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash - -# liblustre sanity test. specially written for UML for now - -LCONF=${LCONF:-../utils/lconf} - -LLIP=127.0.0.1 - -LTREE_KERNEL=${LTREE_KERNEL:-../../lustre} -LTREE_USER=${LTREE_USER:-../../lustre-lib} -HOSTNAME=`hostname` - -# checking -if [ ! -e $LTREE_KERNEL ]; then - echo "$LTREE_KERNEL dosen't exits" - exit 1 -fi - -if [ ! -e $LTREE_USER ]; then - echo "$LTREE_USER dosen't exits" - exit 1 -fi - -if [ ! -e $LTREE_USER/liblustre/lltest ]; then - echo "$LTREE_USER/liblustre/lltest dosen't exits" - exit 1 -fi - -workdir=`pwd` - -cleanup() -{ - curdir=`pwd` - cd $LTREE_KERNEL/tests - $LCONF --node $HOSTNAME --cleanup --force $LTREE_USER/tests/$configfile 2>&1 > /dev/null - cd $curdir -} - -configfile=liblustre_sanity_uml.xml - -# generate config file -rm -f $configfile -MDSNODE=$HOSTNAME OSTNODES=$HOSTNAME CLIENTS=$LLIP sh uml.sh $configfile -if [ ! -e $configfile ]; then - echo "fail to generate config file $configfile" - exit 1 -fi - -# generate dump file -rm -f /tmp/DUMP_FILE -$LCONF --lctl_dump /tmp/DUMP_FILE --node $LLIP $configfile -if [ ! -e /tmp/DUMP_FILE ]; then - echo "error creating dumpfile" - exit 1 -fi - -#setup lustre server -cd $LTREE_KERNEL/tests -$LCONF --node $HOSTNAME --reformat $LTREE_USER/tests/$configfile -rc=$? -if [ $rc -ne 0 ]; then - echo "setup lustre server: error $rc" - cleanup - exit 1 -fi -cd $workdir - -#do liblustre testing -$LTREE_USER/liblustre/lltest -rc=$? -if [ $rc -ne 0 ]; then - echo "liblustre test error $rc" - cleanup - exit 1 -fi - -echo "===== liblustre sanity test complete sucessfully =====" - -echo -n "===== cleanup... "; cleanup; echo "done =====" - -cd $workdir - -exit 0 diff --git a/lustre/tests/llecho.sh b/lustre/tests/llecho.sh deleted file mode 100644 index a345f4f..0000000 --- a/lustre/tests/llecho.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -PATH=`dirname $0`/../utils:$PATH - -LCONF=${LCONF:-lconf} -NAME=${NAME:-echo} - -config=$NAME.xml -mkconfig=$NAME.sh - -if [ "$LUSTRE" ]; then - lustre_opt="--lustre=$LUSTRE" -fi - -[ -f $config ] || sh -x $mkconfig $config || exit 1 - -$LCONF $lustre_opt --reformat $@ $OPTS $config || exit 4 - -cat < -#include -#include -#include -#include -#include -#include -#include - -int main(int argc, char **argv) -{ - int fd, rc; - - if (argc != 2) { - printf("Usage: %s \n", argv[0]); - exit(1); - } - - fd = open(argv[1], O_RDONLY | O_CREAT, 0600); - if (fd == -1) { - printf("Error opening %s for create: %s\n", argv[1], - strerror(errno)); - exit(1); - } - rc = close(fd); - if (rc < 0) { - printf("Error closing %s: %s\n", argv[1], strerror(errno)); - exit(1); - } - - fd = open(argv[1], O_DIRECTORY); - if (fd >= 0) { - printf("opening %s as directory should have returned an " - "error!\n", argv[1]); - exit(1); - } - if (errno != ENOTDIR) { - printf("opening %s as directory, expected -ENOTDIR and got " - "%s\n", argv[1], strerror(errno)); - exit(1); - } - - return 0; -} diff --git a/lustre/tests/openclose.c b/lustre/tests/openclose.c deleted file mode 100644 index aa54406..0000000 --- a/lustre/tests/openclose.c +++ /dev/null @@ -1,178 +0,0 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * - * GPL HEADER START - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 only, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License version 2 for more details (a copy is included - * in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU General Public License - * version 2 along with this program; If not, see - * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - * GPL HEADER END - */ -/* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved - * Use is subject to license terms. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - */ - -/* for O_DIRECT */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#ifndef O_DIRECT -#define O_DIRECT 0 -#endif - -int main(int argc, char *argv[]) -{ - char filename[1024]; - unsigned long count, i; - int thread = 0; - int threads = 0; - int rc = 0; - int fd, ioctl_flags = 0; - - if (argc < 3 || argc > 4) { - fprintf(stderr, "usage: %s [threads]\n", - argv[0]); - exit(1); - } - - count = strtoul(argv[2], NULL, 0); - if (argc == 4) - threads = strtoul(argv[3], NULL, 0); - - for (i = 1; i <= threads; i++) { - rc = fork(); - if (rc < 0) { - fprintf(stderr, "error: %s: #%ld - %s\n", argv[0], i, - strerror(rc = errno)); - break; - } else if (rc == 0) { - thread = i; - argv[2] = "--device"; - break; - } else - printf("%s: thread #%ld (PID %d) started\n", - argv[0], i, rc); - rc = 0; - } - - if (threads && thread == 0) { /* parent process */ - int live_threads = threads; - - while (live_threads > 0) { - int status; - pid_t ret; - - ret = waitpid(0, &status, 0); - if (ret == 0) - continue; - - if (ret < 0) { - if (!rc) - rc = errno; - fprintf(stderr, "error: %s: wait - %s\n", - argv[0], strerror(rc)); - } else { - /* - * This is a hack. We _should_ be able to use - * WIFEXITED(status) to see if there was an - * error, but it appears to be broken and it - * always returns 1 (OK). See wait(2). - */ - int err = WEXITSTATUS(status); - if (err || WIFSIGNALED(status)) - fprintf(stderr, - "%s: PID %d had rc=%d\n", - argv[0], ret, err); - if (!rc) - rc = err; - } - live_threads--; - } - } else { - if (threads) - sprintf(filename, "%s-%d", argv[1], thread); - else - strcpy(filename, argv[1]); - - fd = open(filename, O_RDWR|O_CREAT, 0644); - if (fd < 0) { - rc = errno; - fprintf(stderr, "open(%s, O_CREAT): %s\n", filename, - strerror(rc)); - exit(rc); - } - if (close(fd) < 0) { - rc = errno; - fprintf(stderr, "close(): %s\n", strerror(rc)); - goto unlink; - } - - for (i = 0; i < count; i++) { - fd = open(filename, O_RDWR|O_LARGEFILE|O_DIRECT); - if (fd < 0) { - rc = errno; - fprintf(stderr, "open(%s, O_RDWR): %s\n", - filename, strerror(rc)); - break; - } - if (ioctl(fd, LL_IOC_SETFLAGS, &ioctl_flags) < 0 && - errno != ENOTTY) { - rc = errno; - fprintf(stderr, "ioctl(): %s\n", strerror(rc)); - break; - } - if (close(fd) < 0) { - rc = errno; - fprintf(stderr, "close(): %s\n", strerror(rc)); - break; - } - } - unlink: - if (unlink(filename) < 0) { - rc = errno; - fprintf(stderr, "unlink(%s): %s\n", filename, - strerror(rc)); - } - if (threads) - printf("Thread %d done: rc = %d\n", thread, rc); - else - printf("Done: rc = %d\n", rc); - } - return rc; -} diff --git a/lustre/tests/openme.c b/lustre/tests/openme.c deleted file mode 100644 index d3f7b24..0000000 --- a/lustre/tests/openme.c +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * - * GPL HEADER START - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 only, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License version 2 for more details (a copy is included - * in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU General Public License - * version 2 along with this program; If not, see - * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - * GPL HEADER END - */ -/* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved - * Use is subject to license terms. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - */ - -#include -#include -#include -#include - -int main(int argc, char **argv) -{ - int fd; - - if (argc != 2) { - printf("Usage openme \n"); - exit(1); - } - - fd = open(argv[1], O_RDONLY | O_CREAT, 0600); - if (fd == -1) { - printf("Error opening %s\n", argv[1]); - exit(1); - } - - sleep(10000000); - return 0; -} diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index 1042a93..f7906bc 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -157,12 +157,13 @@ test_2b() { run_test 2b "touch" test_3a() { + local file=$DIR/$tfile replay_barrier $SINGLEMDS - mcreate $DIR/$tfile - o_directory $DIR/$tfile + mcreate $file + openfile -f O_DIRECTORY $file fail $SINGLEMDS - $CHECKSTAT -t file $DIR/$tfile || return 2 - rm $DIR/$tfile + $CHECKSTAT -t file $file || return 2 + rm $file } run_test 3a "replay failed open(O_DIRECTORY)" diff --git a/lustre/tests/sanity-lmv.sh b/lustre/tests/sanity-lmv.sh deleted file mode 100644 index faa4b92..0000000 --- a/lustre/tests/sanity-lmv.sh +++ /dev/null @@ -1,451 +0,0 @@ -#!/bin/bash -# -# Run select tests by setting ONLY, or as arguments to the script. -# Skip specific tests by setting EXCEPT. -# -# e.g. ONLY="22 23" or ONLY="`seq 32 39`" or EXCEPT="31" -set -e - -ONLY=${ONLY:-"$*"} -# bug number for skipped test: 2108 -ALWAYS_EXCEPT=${ALWAYS_EXCEPT:-""} -# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT! -#case `uname -r` in -#2.6.*) ALWAYS_EXCEPT="$ALWAYS_EXCEPT 54c 55" # bug 3117 -#esac - -[ "$ALWAYS_EXCEPT$EXCEPT" ] && echo "Skipping tests: $ALWAYS_EXCEPT $EXCEPT" - -SRCDIR=`dirname $0` -export PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH -export SECURITY=${SECURITY:-"null"} - -TMP=${TMP:-/tmp} -FSTYPE=${FSTYPE:-ldiskfs} - -CHECKSTAT=${CHECKSTAT:-"checkstat -v"} -CREATETEST=${CREATETEST:-createtest} -LFS=${LFS:-lfs} -LSTRIPE=${LSTRIPE:-"$LFS setstripe"} -LFIND=${LFIND:-"$LFS find"} -LVERIFY=${LVERIFY:-ll_dirstripe_verify} -LCTL=${LCTL:-lctl} -MCREATE=${MCREATE:-mcreate} -OPENFILE=${OPENFILE:-openfile} -OPENUNLINK=${OPENUNLINK:-openunlink} -TOEXCL=${TOEXCL:-toexcl} -TRUNCATE=${TRUNCATE:-truncate} -MUNLINK=${MUNLINK:-munlink} -SOCKETSERVER=${SOCKETSERVER:-socketserver} -SOCKETCLIENT=${SOCKETCLIENT:-socketclient} -IOPENTEST1=${IOPENTEST1:-iopentest1} -IOPENTEST2=${IOPENTEST2:-iopentest2} -PTLDEBUG=${PTLDEBUG:-0} - -export NAME=${NAME:-lmv} - -SAVE_PWD=$PWD - -LUSTRE=${LUSTRE:-`dirname $0`/..} -. $LUSTRE/tests/test-framework.sh -init_test_env $@ -. ${CONFIG:=$LUSTRE/tests/cfg/lmv.sh} - -cleanup() { - echo -n "cln.." - cleanupall ${FORCE} $* || { echo "FAILed to clean up"; exit 20; } -} -CLEANUP=${CLEANUP:-:} - -setup() { - echo -n "mnt.." - load_modules - setupall || exit 10 - echo "done" -} - -SETUP=${SETUP:-:} - -log() { - echo "$*" - $LCTL mark "$*" 2> /dev/null || true -} - -trace() { - log "STARTING: $*" - strace -o $TMP/$1.strace -ttt $* - RC=$? - log "FINISHED: $*: rc $RC" - return 1 -} -TRACE=${TRACE:-""} - -check_kernel_version() { - VERSION_FILE=version - WANT_VER=$1 - [ ! -f $VERSION_FILE ] && echo "can't find kernel version" && return 1 - GOT_VER=$(lctl get_param $VERSION_FILE | awk '/kernel:/ {print $2}') - [ $GOT_VER -ge $WANT_VER ] && return 0 - log "test needs at least kernel version $WANT_VER, running $GOT_VER" - return 1 -} - -_basetest() { - echo $* -} - -basetest() { - IFS=abcdefghijklmnopqrstuvwxyz _basetest $1 -} - -run_one() { - if ! grep -q $DIR /proc/mounts; then - $SETUP - fi - testnum=$1 - message=$2 - BEFORE=`date +%s` - log "== test $testnum: $message= `date +%H:%M:%S` ($BEFORE)" - export TESTNAME=test_$testnum - export tfile=f${testnum} - export tdir=d${base} - test_${testnum} || error "exit with rc=$?" - unset TESTNAME - pass "($((`date +%s` - $BEFORE))s)" - cd $SAVE_PWD - $CLEANUP -} - -build_test_filter() { - [ "$ALWAYS_EXCEPT$EXCEPT$SANITY_EXCEPT" ] && \ - echo "Skipping tests: `echo $ALWAYS_EXCEPT $EXCEPT $SANITY_EXCEPT`" - - for O in $ONLY; do - eval ONLY_${O}=true - done - for E in $EXCEPT $ALWAYS_EXCEPT $SANITY_EXCEPT; do - eval EXCEPT_${E}=true - done -} - -_basetest() { - echo $* -} - -basetest() { - IFS=abcdefghijklmnopqrstuvwxyz _basetest $1 -} - -run_test() { - export base=`basetest $1` - if [ "$ONLY" ]; then - testname=ONLY_$1 - if [ ${!testname}x != x ]; then - run_one $1 "$2" - return $? - fi - testname=ONLY_$base - if [ ${!testname}x != x ]; then - run_one $1 "$2" - return $? - fi - echo -n "." - return 0 - fi - testname=EXCEPT_$1 - if [ ${!testname}x != x ]; then - echo "skipping excluded test $1" - return 0 - fi - testname=EXCEPT_$base - if [ ${!testname}x != x ]; then - echo "skipping excluded test $1 (base $base)" - return 0 - fi - run_one $1 "$2" - return $? -} - -[ "$SANITYLOG" ] && rm -f $SANITYLOG || true - -error() { - lctl set_param fail_loc=0 - log "FAIL: $TESTNAME $@" - $LCTL dk $TMP/lustre-log-$TESTNAME.log - if [ "$SANITYLOG" ]; then - echo "FAIL: $TESTNAME $@" >> $SANITYLOG - else - exit 1 - fi -} - -pass() { - echo PASS $@ -} - -mounted_lustre_filesystems() { - awk '($3 ~ "lustre" && $1 ~ ":") { print $2 }' /proc/mounts -} - -MOUNTED="`mounted_lustre_filesystems`" -if [ -z "$MOUNTED" ]; then - formatall - setupall - MOUNTED="`mounted_lustre_filesystems`" - [ -z "$MOUNTED" ] && error "NAME=$NAME not mounted" - I_MOUNTED=yes -fi - -[ `echo $MOUNT | wc -w` -gt 1 ] && error "NAME=$NAME mounted more than once" - -DIR=${DIR:-$MOUNT} -[ -z "`echo $DIR | grep $MOUNT`" ] && echo "$DIR not in $MOUNT" && exit 99 - -LOVNAME=`lctl get_param -n llite.*.lov.common_name | tail -n 1` -OSTCOUNT=`lctl get_param -n lov.$LOVNAME.numobd` -STRIPECOUNT=`lctl get_param -n lov.$LOVNAME.stripecount` -STRIPESIZE=`lctl get_param -n lov.$LOVNAME.stripesize` -ORIGFREE=`lctl get_param -n lov.$LOVNAME.kbytesavail` -MAXFREE=${MAXFREE:-$((200000 * $OSTCOUNT))} -MDS=$(lctl get_param -N mdt.* | grep -v num_refs | tail -n 1 | cut -d"." -f2) - -[ -f $DIR/d52a/foo ] && chattr -a $DIR/d52a/foo -[ -f $DIR/d52b/foo ] && chattr -i $DIR/d52b/foo -rm -rf $DIR/[Rdfs][1-9]* - -build_test_filter - -if [ "${ONLY}" = "MOUNT" ] ; then - echo "Lustre is up, please go on" - exit -fi - -echo "preparing for tests involving mounts" -EXT2_DEV=${EXT2_DEV:-$TMP/SANITY.LOOP} -touch $EXT2_DEV -mke2fs -j -F $EXT2_DEV 8000 > /dev/null -echo # add a newline after mke2fs. - -umask 077 - -test_0a() { - mkdir $DIR/0a0 || error - for ((i=0;i<5000;i++)); do - mkdir $DIR/0a0/`uuidgen -t` || error - done - rm -rf $DIR/0a0 || error -} -#run_test 0a " create random names =============================" - -test_1a() { - mkdir $DIR/1a0 || error - createmany -o $DIR/1a0/f 5000 || error - rmdir $DIR/1a0 && error - rm -rf $DIR/1a0 || error -} -run_test 1a " remove splitted dir =============================" - -test_1b() { - mkdir $DIR/1b0 || error - createmany -o $DIR/1b0/f 5000 || error - unlinkmany $DIR/1b0/f 5000 || error - NUM=`ls $DIR/1b0 | wc -l` - if [ $NUM -ne 0 ] ; then - echo "dir must be empty" - error - fi - - touch $DIR/1b0/file0 || error - touch $DIR/1b0/file1 || error - touch $DIR/1b0/file2 || error - - echo "3 files left" - rmdir $DIR/1b0 && error - rm -f $DIR/1b0/file0 - - echo "2 files left" - rmdir $DIR/1b0 && error - rm -f $DIR/1b0/file1 - - echo "1 files left" - rmdir $DIR/1b0 && error - rm -f $DIR/1b0/file2 - - echo "0 files left" - rmdir $DIR/1b0 || error -} -run_test 1b " remove splitted dir =============================" - -test_1c() { - mkdir $DIR/1b1 || error - createmany -o $DIR/1b1/f 5000 || error - unlinkmany $DIR/1b1/f 5000 || error - NUM=`ls $DIR/1b1 | wc -l` - if [ $NUM -ne 0 ] ; then - echo "dir must be empty" - error - fi - touch $DIR/1b1/file0 || error - touch $DIR/1b1/file1 || error - touch $DIR/1b1/file2 || error - - ls $DIR/1b1/ - log "3 files left" - rmdir $DIR/1b1 && error - rm -f $DIR/1b1/file0 - - ls $DIR/1b1/ - log "2 files left" - rmdir $DIR/1b1 && error - rm -f $DIR/1b1/file1 - - ls $DIR/1b1/ - log "1 files left" - rmdir $DIR/1b1 && error - rm -f $DIR/1b1/file2 - - ls $DIR/1b1/ - log "0 files left" - rmdir $DIR/1b1 || error -} -run_test 1c " remove splitted cross-node dir =============================" - -test_2a() { - mkdir $DIR/2a0 || error - createmany -o $DIR/2a0/f 5000 || error - NUM=`ls $DIR/2a0 | wc -l` - echo "found $NUM files" - if [ $NUM -ne 5000 ]; then - echo "wrong number of files: $NUM" - error - fi - rm -rf $DIR/2a0 || error -} -run_test 2a " list splitted dir =============================" - -test_2b() { - mkdir $DIR/2b1 || error - createmany -o $DIR/2b1/f 5000 || error - $CLEAN - $START - statmany -l $DIR/2b1/f 5000 5000 || error - statmany -s $DIR/2b1/f 5000 5000 || error - rm -rf $DIR/2b1 || error -} -run_test 2b " list splitted dir after remount =============================" - -test_3a() { - mkdir $DIR/3a0 || error - for i in `seq 100`; do - mkdir $DIR/3a0/d${i} || error - done - createmany -o $DIR/3a0/f 5000 || error - rm -rf $DIR/3a0 || error -} -run_test 3a " dir splitting with cross-ref =============================" - -test_3b() { - mkdir $DIR/3b1 || error - createmany -m $DIR/3b1/f 5000 || error - rm -rf $DIR/3b1 || error -} -run_test 3b " dir splitting via createmany -m =============================" - -test_3c() { - mkdir $DIR/3c1 || error - echo "MDS nodes: $MDSCOUNT" - for j in `seq 3`; do - for i in `seq 10`; do - $LFS dirstripe $DIR/3c1/d-${j}-${i} $j || error - createmany -m $DIR/3c1/d-${j}-${i}/m 200 || error - createmany -o $DIR/3c1/d-${j}-${i}/o 200 || error - done - done - rm -rf $DIR/3c1 || error -} - -#run_test 3c " dir splitting via lfs stripe =============================" - -test_4a() { - let rr=0 - while let "rr < 33000"; do - if let "rr % 2000 == 0"; then - echo "$rr" - fi - mkdir $DIR/4a1 || error - rm -rf $DIR/4a1 - let "rr = rr + 1" - done -} - -## this test is very time-consuming, don't run it by default -#run_test 4a " FIDS/ nlink overflow test =============================" - -test_5a() { - mount_client $MOUNT2 - # create a cross-ref file - mkdir -p $MOUNT/$tdir/d1 - mkdir -p $MOUNT2/$tdir/d2 - dd if=/dev/zero of=$MOUNT/$tdir/d1/f1 count=1 - mv $MOUNT2/$tdir/d1/f1 $MOUNT2/$tdir/d2/ - # XXX: a check the file is a cross-ref one is needed. - cancel_lru_locks mdc - cancel_lru_locks osc - dd if=$MOUNT2/$tdir/d2/f1 of=/dev/null - stat $MOUNT2/$tdir/d2 $MOUNT2/$tdir/d2/f1 > /dev/null - can1=`lctl get_param -n ldlm.services.ldlm_canceld.stats | - awk '/ldlm_cancel/ {print $2}'` - blk1=`lctl get_param -n ldlm.services.ldlm_cbd.stats | - awk '/ldlm_bl_callback/ {print $2}'` - unlink $MOUNT2/$tdir/d2/f1 - can2=`lctl get_param -n ldlm.services.ldlm_canceld.stats | - awk '/ldlm_cancel/ {print $2}'` - blk2=`lctl get_param -n ldlm.services.ldlm_cbd.stats | - awk '/ldlm_bl_callback/ {print $2}'` - umount $MOUNT2 - [ $can1 -eq $can2 ] && error "It does not look like a cross-ref file." - [ $[$can1+1] -eq $can2 ] || error $[$[$can2-$can1]] "cancel RPC occured." - [ $blk1 -eq $blk2 ] || error $[$[$blk2-$blk1]] "blocking RPC occured." -} -run_test 5a "Early Lock Cancel: cross-ref unlink" - -test_5b() { - mount_client $MOUNT2 - # create a cross-ref file - mkdir -p $MOUNT/$tdir/d1 - mkdir -p $MOUNT2/$tdir/d2 - dd if=/dev/zero of=$MOUNT/$tdir/d1/f1 count=1 - cancel_lru_locks mdc - cancel_lru_locks osc - dd if=$MOUNT2/$tdir/d1/f1 of=/dev/null - stat $MOUNT2/$tdir/d1/f1 $MOUNT2/$tdir/d2 > /dev/null - can1=`lctl get_param -n ldlm.services.ldlm_canceld.stats | - awk '/ldlm_cancel/ {print $2}'` - blk1=`lctl get_param -n ldlm.services.ldlm_cbd.stats | - awk '/ldlm_bl_callback/ {print $2}'` - ln $MOUNT2/$tdir/d1/f1 $MOUNT2/$tdir/d2/f2 - can2=`lctl get_param -n ldlm.services.ldlm_canceld.stats | - awk '/ldlm_cancel/ {print $2}'` - blk2=`lctl get_param -n ldlm.services.ldlm_cbd.stats | - awk '/ldlm_bl_callback/ {print $2}'` - umount $MOUNT2 - [ $can1 -eq $can2 ] && error "It does not look like a cross-ref file." - [ $[$can1+1] -eq $can2 ] || error $[$[$can2-$can1]] "cancel RPC occured." - [ $blk1 -eq $blk2 ] || error $[$[$blk2-$blk1]] "blocking RPC occured." -} -run_test 5b "Early Lock Cancel: cross-ref link" - -TMPDIR=$OLDTMPDIR -TMP=$OLDTMP -HOME=$OLDHOME - -log "cleanup: ======================================================" -if [ "`mount | grep ^$NAME`" ]; then - rm -rf $DIR/[Rdfs][1-9]* -fi -if [ "$I_MOUNTED" = "yes" ]; then - cleanupall -f || error "cleanup failed" -fi - -echo '=========================== finished ===============================' -[ -f "$SANITYLOG" ] && cat $SANITYLOG && exit 1 || true diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index d661aca..ec00947 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -46,7 +46,6 @@ MCREATE=${MCREATE:-mcreate} OPENFILE=${OPENFILE:-openfile} OPENUNLINK=${OPENUNLINK:-openunlink} READS=${READS:-"reads"} -TOEXCL=${TOEXCL:-toexcl} TRUNCATE=${TRUNCATE:-truncate} MUNLINK=${MUNLINK:-munlink} SOCKETSERVER=${SOCKETSERVER:-socketserver} @@ -541,9 +540,12 @@ test_22() { run_test 22 "unpack tar archive as non-root user ===============" test_23() { - mkdir $DIR/d23 - $TOEXCL $DIR/d23/f23 - $TOEXCL -e $DIR/d23/f23 || error + mkdir -p $DIR/$tdir + local file=$DIR/$tdir/$tfile + + openfile -f O_CREAT:O_EXCL $file || error "$file create failed" + openfile -f O_CREAT:O_EXCL $file && + error "$file recreate succeeded" || true } run_test 23 "O_CREAT|O_EXCL in subdir ==========================" @@ -1140,7 +1142,9 @@ test_27w() { # bug 10997 } run_test 27w "check lfs setstripe -c -s -i options =============" -test_28() { +# createtest also checks that device nodes are created and +# then visible correctly (#2091) +test_28() { # bug 2091 mkdir $DIR/d28 $CREATETEST $DIR/d28/ct || error } @@ -1739,9 +1743,15 @@ test_37() { run_test 37 "ls a mounted file system to check old content =====" test_38() { - o_directory $DIR/$tfile + local file=$DIR/$tfile + touch $file + openfile -f O_DIRECTORY $file + local RC=$? + local ENOTDIR=20 + [ $RC -eq 0 ] && error "opened file $file with O_DIRECTORY" || true + [ $RC -eq $ENOTDIR ] || error "error $RC should be ENOTDIR ($ENOTDIR)" } -run_test 38 "open a regular file with O_DIRECTORY ==============" +run_test 38 "open a regular file with O_DIRECTORY should return -ENOTDIR ===" test_39() { touch $DIR/$tfile @@ -2068,11 +2078,7 @@ test_46() { } run_test 46 "dirtying a previously written page ================" -# Check that device nodes are created and then visible correctly (#2091) -test_47() { - cmknod $DIR/test_47_node || error -} -run_test 47 "Device nodes check ================================" +# test_47 is removed "Device nodes check" is moved to test_28 test_48a() { # bug 2399 check_kernel_version 34 || return 0 diff --git a/lustre/tests/sanityN.sh b/lustre/tests/sanityN.sh index 9008dce9..1dda830 100644 --- a/lustre/tests/sanityN.sh +++ b/lustre/tests/sanityN.sh @@ -22,13 +22,11 @@ PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH SIZE=${SIZE:-40960} CHECKSTAT=${CHECKSTAT:-"checkstat -v"} -CREATETEST=${CREATETEST:-createtest} GETSTRIPE=${GETSTRIPE:-lfs getstripe} SETSTRIPE=${SETSTRIPE:-lstripe} MCREATE=${MCREATE:-mcreate} OPENFILE=${OPENFILE:-openfile} OPENUNLINK=${OPENUNLINK:-openunlink} -TOEXCL=${TOEXCL:-toexcl} TRUNCATE=${TRUNCATE:-truncate} export TMP=${TMP:-/tmp} MOUNT_2=${MOUNT_2:-"yes"} diff --git a/lustre/tests/set_dates.sh b/lustre/tests/set_dates.sh deleted file mode 100644 index b2a9979..0000000 --- a/lustre/tests/set_dates.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -[ `hostname` = "uml1" ] && date --set="Mar 14 20:21:41 MDT 1973" #101010101 -[ `hostname` = "uml2" ] && date --set="May 26 22:43:22 MDT 1976" #202020202 -[ `hostname` = "uml3" ] && date --set="Aug 9 01:05:03 MDT 1979" #303030303 diff --git a/lustre/tests/sleeptest.c b/lustre/tests/sleeptest.c deleted file mode 100644 index 7e40b24..0000000 --- a/lustre/tests/sleeptest.c +++ /dev/null @@ -1,151 +0,0 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * - * GPL HEADER START - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 only, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License version 2 for more details (a copy is included - * in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU General Public License - * version 2 along with this program; If not, see - * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - * GPL HEADER END - */ -/* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved - * Use is subject to license terms. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#define BUFSIZE (4096) - -#define min(a,b) ((a) < (b) ? (a) : (b)) - -int main(int argc, char *argv[]) -{ - - FILE *w_str; - int read_fd; - int rc, iter; - int line, delta, next; - int sleeptime = 0; - char *now_time; - const char ok_chars[] = "MonTueWedThuFriSatSun" - "JanFebMarAprMayJunJulAugSepOctNovDec" - "Line 0123456789 of file, written at:\n"; - - char buf_r[BUFSIZE]; - - char pathname[256] = "/mnt/lustre/linetest_"; - char *host; - - if (argc > 1) { - strncpy(pathname, argv[1], 255); - pathname[255] = '\0'; - } - - host = getenv("HOSTNAME"); - if (host) - strcat(pathname, host); - - if (argc > 2) - sleeptime = strtoul(argv[2], NULL, 0); - - if (sleeptime == 0) - sleeptime = 30; - - printf("Test file used is: %s at %ds intervals\n", pathname, sleeptime); - - w_str = fopen(pathname, "wb"); - if (w_str == NULL) { - perror("fopen"); - exit(1); - } - read_fd = open(pathname, O_RDONLY); - if (read_fd < 0) { - perror("open"); - exit(1); - } - - next = 1; - delta = 17; - iter = 1; - while (1) { - time_t now; - struct tm *t; - long offset; - - now = time((time_t *)NULL); - t = localtime(&now); - now_time = asctime(t); - - printf("iter: %d\n", iter); - - for (line=next; line<(next+delta); line++) { - rc = fprintf(w_str, "Line %8d of file, written at: %s", - line, now_time); - /* \n comes from ctime() result */ - if (rc <= 0) { - perror("fprintf"); - exit(4); - } - rc = fflush(w_str); - if (rc != 0) { - perror("fflush"); - exit(5); - } - } - next += delta; - - /* Check for corruption */ - offset = ftell(w_str); - rc = lseek(read_fd, offset & ~4095, SEEK_SET); - if (rc != (offset & ~4095)) { - perror("lseek"); - exit(7); - } - - rc = read(read_fd, buf_r, min(100, offset & 4095)); - if (rc != min(100, offset & 4095)) { - printf("rc: %d, off %lu buf: '%s'\n", rc,offset,buf_r); - exit(8); - } - buf_r[rc] = 0; - /* Chars from "C" days/months, and above Line */ - if (strspn(buf_r, ok_chars) != rc) { - printf("Corruption detected at %lu on %s", - offset & ~4095, now_time); - exit(9); - } - - sleep(sleeptime); - iter++; - } - -} diff --git a/lustre/tests/test2.c b/lustre/tests/test2.c deleted file mode 100755 index 9224e48..0000000 --- a/lustre/tests/test2.c +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * - * GPL HEADER START - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 only, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License version 2 for more details (a copy is included - * in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU General Public License - * version 2 along with this program; If not, see - * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - * GPL HEADER END - */ -/* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved - * Use is subject to license terms. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - */ - -#include -#include -#include -#include -#include -#include -#include - -/* Beware when setting FSROOT that I've not made any attempts to avoid buffer - * overruns below--this is a test program, it's a static buffer. */ -#define FSROOT "/mnt" -#define OBD_ITERATIONS 10000 - -int main (int argc, char * argv[]) -{ - int fd, rc, err = -1; - struct stat stat_buf; - - if (argc < 2) { - printf("syntax: %s command\n", argv[0]); - printf("Where command is one of \"setup\" or \"create\".\n"); - exit(1); - } - - if (!strcmp(argv[1], "setup")) { - printf("This is silly.\n"); - } else if (!strcmp(argv[1], "create")) { - int i, iter; - - if (argc < 3) { - printf("create requires a nonzero argument.\n"); - exit(1); - } - - iter = atoi(argv[2]); - - if (iter < 1) { - printf("create requires a nonzero argument.\n"); - exit(1); - } - printf("creating %d files...\n", iter); - - for (i = 0; i < iter; i++) { - fd = creat(FSROOT "/foo123", S_IRWXU); - close(fd); - unlink(FSROOT "/foo123"); - } - } else { - printf("Invalid command, run with no arguments for help.\n"); - } - - return 0; -} diff --git a/lustre/tests/toexcl.c b/lustre/tests/toexcl.c deleted file mode 100644 index 43ca4c9..0000000 --- a/lustre/tests/toexcl.c +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * - * GPL HEADER START - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 only, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License version 2 for more details (a copy is included - * in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU General Public License - * version 2 along with this program; If not, see - * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - * GPL HEADER END - */ -/* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved - * Use is subject to license terms. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -void -usage (char *argv0, int help) -{ - char *progname = strrchr(argv0, '/'); - - if (progname == NULL) - progname = argv0; - - fprintf (help ? stdout : stderr, - "Usage: %s [-e] file\n", progname); - - if (!help) - { - fprintf (stderr, " or try '-h' for help\n"); - exit (1); - } - - printf ("Create the given file with O_EXCL...\n"); - printf (" -e expect EEXIST\n"); - printf (" -h print help"); - printf (" Exit status is 0 on success, 1 on failure\n"); -} - -int main(int argc, char **argv) -{ - int rc; - int want_eexist = 0; - - while ((rc = getopt (argc, argv, "eh")) != -1) - switch (rc) - { - case 'e': - want_eexist = 1; - break; - case 'h': - usage (argv[1], 1); - return (0); - default: - usage (argv[0], 0); - } - - if (optind != argc - 1) { - usage (argv[0], 0); - return 1; - } - - rc = open(argv[optind], O_CREAT|O_EXCL, 0644); - if (rc == -1) - { - if (want_eexist && errno == EEXIST) - { - printf("open failed: %s (expected)\n", strerror(errno)); - return (0); - } - printf("open failed: %s\n", strerror(errno)); - return (1); - } else { - if (want_eexist) - { - printf("open success (expecting EEXIST).\n"); - return (1); - } - printf("open success.\n"); - return (0); - } - - return ((rc == 0) ? 0 : 1); -} -- 1.8.3.1