diff options
author | David Teigland <teigland@redhat.com> | 2011-07-13 17:20:59 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2011-07-13 17:20:59 -0500 |
commit | 64eb91fd627f966c5825cee41af95add0f75dfdc (patch) | |
tree | 1e092e4018cb42b4b7ced1ef29f81cb96127d97f /fs | |
parent | 9b1d3e4ec0870b8ae4f7671ff135b29534179099 (diff) | |
download | dct-stuff-64eb91fd627f966c5825cee41af95add0f75dfdc.tar.gz dct-stuff-64eb91fd627f966c5825cee41af95add0f75dfdc.tar.xz dct-stuff-64eb91fd627f966c5825cee41af95add0f75dfdc.zip |
manyfilep/manyfiles: add new tests
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs')
-rwxr-xr-x | fs/manyfilep | 31 | ||||
-rwxr-xr-x | fs/manyfiles | 37 |
2 files changed, 68 insertions, 0 deletions
diff --git a/fs/manyfilep b/fs/manyfilep new file mode 100755 index 0000000..938c68f --- /dev/null +++ b/fs/manyfilep @@ -0,0 +1,31 @@ +#!/bin/bash + +if [ $# -lt 3 ]; then + echo "" + echo "manyfilep P CMD F" + echo "" + echo "P: number of processes (run in parallel)" + echo "F: number of files" + echo "CMD: touch, unlink, clean (per file sequentially)" + echo "" + echo "./manyfiles dir1 CMD F &" + echo "./manyfiles dir2 CMD F &" + echo "./manyfiles dir3 CMD F &" + echo "..." + echo "./manyfiles dirP CMD F &" + echo "" + exit 0 +fi + +P=$1 +CMD=$2 +F=$3 + +for i in `seq 1 $P`; do + /usr/bin/time -f "%e sec (k %S u %U)" ./manyfiles dir$i $CMD $F & +done + +wait + +echo $P done + diff --git a/fs/manyfiles b/fs/manyfiles new file mode 100755 index 0000000..3b50011 --- /dev/null +++ b/fs/manyfiles @@ -0,0 +1,37 @@ +#!/bin/bash + +if [ $# -lt 3 ]; then + echo "" + echo "manyfiles D CMD F" + echo "" + echo "D: dir name" + echo "F: number of files" + echo "CMD: touch, unlink (per file sequentially)" + echo "" + echo "mkdir dirD" + echo "cd dirD" + echo "for I in seq 1 F; do CMD fileI" + echo "" + exit 0 +fi + +D=$1 +CMD=$2 +F=$3 + +mkdir -p $D +cd $D + +if [ "$CMD" == "clean" ]; then + CMD=unlink + clean=1 +fi + +for i in `seq 1 $F`; do + $CMD file$i +done + +if [ $clean ]; then + cd .. + rmdir $D +fi |