From dd48eb801321ab87c89dfbe3dd89fa487cf874b8 Mon Sep 17 00:00:00 2001 From: Lokesh Nagappa Jaliminche Date: Wed, 17 Feb 2016 13:06:30 +0530 Subject: [PATCH] LU-7786 tests: improve racer cleanup On cleanup racer terminates child scripts: file_create.sh, dir_create.sh, etc. Children of those srcipts do not get terminated that way. Long running commands, like dd, causes annoying warnings: /mnt/lustre2 is still busy, wait one second on attempt to umount $DIR2. Add trap to all child scripts to have then to cleanup on exiting. Seagate-bug-id: MRP-2106 Change-Id: Ie9453449ceea3657881ebc0ce1edeb9e259c848e Signed-off-by: Lokesh Nagappa Jaliminche Reviewed-on: http://review.whamcloud.com/18475 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- lustre/tests/racer/dir_create.sh | 1 + lustre/tests/racer/dir_migrate.sh | 1 + lustre/tests/racer/dir_remote.sh | 1 + lustre/tests/racer/file_chmod.sh | 1 + lustre/tests/racer/file_chown.sh | 1 + lustre/tests/racer/file_concat.sh | 1 + lustre/tests/racer/file_create.sh | 1 + lustre/tests/racer/file_delxattr.sh | 1 + lustre/tests/racer/file_exec.sh | 1 + lustre/tests/racer/file_getxattr.sh | 1 + lustre/tests/racer/file_link.sh | 1 + lustre/tests/racer/file_list.sh | 1 + lustre/tests/racer/file_mknod.sh | 1 + lustre/tests/racer/file_rename.sh | 1 + lustre/tests/racer/file_rm.sh | 1 + lustre/tests/racer/file_setxattr.sh | 1 + lustre/tests/racer/file_swap.sh | 1 + lustre/tests/racer/file_symlink.sh | 1 + lustre/tests/racer/file_truncate.sh | 1 + 19 files changed, 19 insertions(+) diff --git a/lustre/tests/racer/dir_create.sh b/lustre/tests/racer/dir_create.sh index 9bd72f9..97fee9b 100755 --- a/lustre/tests/racer/dir_create.sh +++ b/lustre/tests/racer/dir_create.sh @@ -1,4 +1,5 @@ #!/bin/bash +trap 'kill $(jobs -p)' EXIT DIR=$1 MAX=$2 diff --git a/lustre/tests/racer/dir_migrate.sh b/lustre/tests/racer/dir_migrate.sh index e95e346..ae7d4c6 100755 --- a/lustre/tests/racer/dir_migrate.sh +++ b/lustre/tests/racer/dir_migrate.sh @@ -1,4 +1,5 @@ #!/bin/bash +trap 'kill $(jobs -p)' EXIT DIR=$1 MAX=$2 diff --git a/lustre/tests/racer/dir_remote.sh b/lustre/tests/racer/dir_remote.sh index 6c3132c..0950625 100755 --- a/lustre/tests/racer/dir_remote.sh +++ b/lustre/tests/racer/dir_remote.sh @@ -1,4 +1,5 @@ #!/bin/bash +trap 'kill $(jobs -p)' EXIT DIR=$1 MAX=$2 diff --git a/lustre/tests/racer/file_chmod.sh b/lustre/tests/racer/file_chmod.sh index 585c155..fffa4c8 100755 --- a/lustre/tests/racer/file_chmod.sh +++ b/lustre/tests/racer/file_chmod.sh @@ -1,4 +1,5 @@ #!/bin/bash +trap 'kill $(jobs -p)' EXIT DIR=$1 MAX=$2 diff --git a/lustre/tests/racer/file_chown.sh b/lustre/tests/racer/file_chown.sh index d5de24b..2793c10 100755 --- a/lustre/tests/racer/file_chown.sh +++ b/lustre/tests/racer/file_chown.sh @@ -1,4 +1,5 @@ #!/bin/bash +trap 'kill $(jobs -p)' EXIT DIR=$1 MAX=$2 diff --git a/lustre/tests/racer/file_concat.sh b/lustre/tests/racer/file_concat.sh index de194b8..79f0d92 100755 --- a/lustre/tests/racer/file_concat.sh +++ b/lustre/tests/racer/file_concat.sh @@ -1,4 +1,5 @@ #!/bin/bash +trap 'kill $(jobs -p)' EXIT DIR=$1 MAX=$2 diff --git a/lustre/tests/racer/file_create.sh b/lustre/tests/racer/file_create.sh index 875c056..b1704d3 100755 --- a/lustre/tests/racer/file_create.sh +++ b/lustre/tests/racer/file_create.sh @@ -1,4 +1,5 @@ #!/bin/bash +trap 'kill $(jobs -p)' EXIT DIR=$1 MAX=$2 diff --git a/lustre/tests/racer/file_delxattr.sh b/lustre/tests/racer/file_delxattr.sh index b38e515..44e87ec 100755 --- a/lustre/tests/racer/file_delxattr.sh +++ b/lustre/tests/racer/file_delxattr.sh @@ -1,4 +1,5 @@ #!/bin/bash +trap 'kill $(jobs -p)' EXIT DIR=$1 MAX=$2 diff --git a/lustre/tests/racer/file_exec.sh b/lustre/tests/racer/file_exec.sh index 7f44491..9ec7b11 100755 --- a/lustre/tests/racer/file_exec.sh +++ b/lustre/tests/racer/file_exec.sh @@ -1,4 +1,5 @@ #!/bin/bash +trap 'kill $(jobs -p)' EXIT DIR=$1 MAX=$2 diff --git a/lustre/tests/racer/file_getxattr.sh b/lustre/tests/racer/file_getxattr.sh index 0171ae4..3c2f607 100755 --- a/lustre/tests/racer/file_getxattr.sh +++ b/lustre/tests/racer/file_getxattr.sh @@ -1,4 +1,5 @@ #!/bin/bash +trap 'kill $(jobs -p)' EXIT DIR=$1 MAX=$2 diff --git a/lustre/tests/racer/file_link.sh b/lustre/tests/racer/file_link.sh index 9a49395..264ef0f 100755 --- a/lustre/tests/racer/file_link.sh +++ b/lustre/tests/racer/file_link.sh @@ -1,4 +1,5 @@ #!/bin/bash +trap 'kill $(jobs -p)' EXIT DIR=$1 MAX=$2 diff --git a/lustre/tests/racer/file_list.sh b/lustre/tests/racer/file_list.sh index 1d6b80c..2e1c877 100755 --- a/lustre/tests/racer/file_list.sh +++ b/lustre/tests/racer/file_list.sh @@ -1,4 +1,5 @@ #!/bin/bash +trap 'kill $(jobs -p)' EXIT DIR=$1 MAX=$2 diff --git a/lustre/tests/racer/file_mknod.sh b/lustre/tests/racer/file_mknod.sh index 0695743..ab2cc11 100755 --- a/lustre/tests/racer/file_mknod.sh +++ b/lustre/tests/racer/file_mknod.sh @@ -1,4 +1,5 @@ #!/bin/bash +trap 'kill $(jobs -p)' EXIT DIR=$1 MAX=$2 diff --git a/lustre/tests/racer/file_rename.sh b/lustre/tests/racer/file_rename.sh index 1f0919f..b5ea2d1 100755 --- a/lustre/tests/racer/file_rename.sh +++ b/lustre/tests/racer/file_rename.sh @@ -1,4 +1,5 @@ #!/bin/bash +trap 'kill $(jobs -p)' EXIT DIR=$1 MAX=$2 diff --git a/lustre/tests/racer/file_rm.sh b/lustre/tests/racer/file_rm.sh index 2453c08..dd10cc9 100755 --- a/lustre/tests/racer/file_rm.sh +++ b/lustre/tests/racer/file_rm.sh @@ -1,4 +1,5 @@ #!/bin/bash +trap 'kill $(jobs -p)' EXIT DIR=$1 MAX=$2 diff --git a/lustre/tests/racer/file_setxattr.sh b/lustre/tests/racer/file_setxattr.sh index eb17ead..69b6fc6 100755 --- a/lustre/tests/racer/file_setxattr.sh +++ b/lustre/tests/racer/file_setxattr.sh @@ -1,4 +1,5 @@ #!/bin/bash +trap 'kill $(jobs -p)' EXIT DIR=$1 MAX=$2 diff --git a/lustre/tests/racer/file_swap.sh b/lustre/tests/racer/file_swap.sh index ac3c673..2b4faa77 100755 --- a/lustre/tests/racer/file_swap.sh +++ b/lustre/tests/racer/file_swap.sh @@ -1,4 +1,5 @@ #!/bin/bash +trap 'kill $(jobs -p)' EXIT DIR=$1 MAX=$2 diff --git a/lustre/tests/racer/file_symlink.sh b/lustre/tests/racer/file_symlink.sh index ac5cde0..e47107c 100755 --- a/lustre/tests/racer/file_symlink.sh +++ b/lustre/tests/racer/file_symlink.sh @@ -1,4 +1,5 @@ #!/bin/bash +trap 'kill $(jobs -p)' EXIT DIR=$1 MAX=$2 diff --git a/lustre/tests/racer/file_truncate.sh b/lustre/tests/racer/file_truncate.sh index 8c19285..98f201c 100755 --- a/lustre/tests/racer/file_truncate.sh +++ b/lustre/tests/racer/file_truncate.sh @@ -1,4 +1,5 @@ #!/bin/bash +trap 'kill $(jobs -p)' EXIT DIR=$1 MAX=$2 -- 1.8.3.1