From fe2663f18e50023ad5cfe5e07b695378dd27a68e Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Thu, 14 Jan 2021 18:21:11 -0700 Subject: [PATCH] LU-12125 tests: allow racer to specify extra tasks Add the RACER_EXTRA environment variable to allow racer.sh to run extra tasks. Test-Parameters: trivial testlist=racer env=DURATION=3600,RACER_EXTRA=file_rename:10,dir_create:10,dir_remote:10,dir_migrate:3 Signed-off-by: Andreas Dilger Change-Id: Ic810a248a2dd665a163e0efea8c9af0e4461e09b Reviewed-on: https://review.whamcloud.com/41231 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Arshad Hussain Reviewed-by: Elena Gryaznova Reviewed-by: James Nunez Reviewed-by: Oleg Drokin --- lustre/tests/racer.sh | 1 + lustre/tests/racer/dir_migrate.sh | 5 +++-- lustre/tests/racer/racer.sh | 10 +++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lustre/tests/racer.sh b/lustre/tests/racer.sh index 42eff29..82f4a76 100644 --- a/lustre/tests/racer.sh +++ b/lustre/tests/racer.sh @@ -125,6 +125,7 @@ test_1() { RACER_ENABLE_FLR=$RACER_ENABLE_FLR \ RACER_MAX_CLEANUP_WAIT=$RACER_MAX_CLEANUP_WAIT \ RACER_ENABLE_SEL=$RACER_ENABLE_SEL \ + RACER_EXTRA=$RACER_EXTRA \ LFS=$LFS \ LCTL=$LCTL \ $racer $rdir $NUM_RACER_THREADS" & diff --git a/lustre/tests/racer/dir_migrate.sh b/lustre/tests/racer/dir_migrate.sh index ae7d4c6..facf4e8 100755 --- a/lustre/tests/racer/dir_migrate.sh +++ b/lustre/tests/racer/dir_migrate.sh @@ -9,8 +9,9 @@ while /bin/true ; do migrate_dir=$((RANDOM % MAX)) file=$((RANDOM % MAX)) mdt_idx=$((RANDOM % MDTCOUNT)) + mkdir -p $DIR/$migrate_dir 2> /dev/null - $LFS mv -M$mdt_idx $DIR/$migrate_dir 2> /dev/null - touch $DIR/$migrate_dir/$file 2> /dev/null + eval touch $DIR/$migrate_dir/{$file..$MAX} 2> /dev/null + $LFS mv -m$mdt_idx $DIR/$migrate_dir 2> /dev/null $LFS getdirstripe $DIR/$migrate_dir > /dev/null 2>&1 done diff --git a/lustre/tests/racer/racer.sh b/lustre/tests/racer/racer.sh index 23b6ba3..c60a7c5 100755 --- a/lustre/tests/racer/racer.sh +++ b/lustre/tests/racer/racer.sh @@ -4,7 +4,6 @@ DIR="$1" MAX_FILES=${MAX_FILES:-20} DURATION=${DURATION:-$((60*5))} -MDSCOUNT=${MDSCOUNT:-1} NUM_THREADS=${NUM_THREADS:-$2} NUM_THREADS=${NUM_THREADS:-3} @@ -17,6 +16,15 @@ RACER_PROGS="file_create dir_create file_rm file_rename file_link file_symlink \ file_list file_concat file_exec file_chown file_chmod file_mknod file_truncate \ file_delxattr file_getxattr file_setxattr" +# allow e.g. RACER_EXTRA=dir_create:5,file_link:10 to launch extra tasks +for PROG in ${RACER_EXTRA//,/ }; do + prog=(${PROG/:/ }) + count=${prog[1]:-1} + for ((i = 0; i < count; i++)); do + RACER_PROGS+=" ${prog[0]}" + done +done + if $RACER_ENABLE_REMOTE_DIRS || $RACER_ENABLE_STRIPED_DIRS; then RACER_PROGS+=' dir_remote' fi -- 1.8.3.1