Whamcloud - gitweb
LU-7786 tests: improve racer cleanup 75/18475/2
authorLokesh Nagappa Jaliminche <lokesh.jaliminche@seagate.com>
Wed, 17 Feb 2016 07:36:30 +0000 (13:06 +0530)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 14 Mar 2016 02:39:33 +0000 (02:39 +0000)
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 <lokesh.jaliminche@seagate.com>
Reviewed-on: http://review.whamcloud.com/18475
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
19 files changed:
lustre/tests/racer/dir_create.sh
lustre/tests/racer/dir_migrate.sh
lustre/tests/racer/dir_remote.sh
lustre/tests/racer/file_chmod.sh
lustre/tests/racer/file_chown.sh
lustre/tests/racer/file_concat.sh
lustre/tests/racer/file_create.sh
lustre/tests/racer/file_delxattr.sh
lustre/tests/racer/file_exec.sh
lustre/tests/racer/file_getxattr.sh
lustre/tests/racer/file_link.sh
lustre/tests/racer/file_list.sh
lustre/tests/racer/file_mknod.sh
lustre/tests/racer/file_rename.sh
lustre/tests/racer/file_rm.sh
lustre/tests/racer/file_setxattr.sh
lustre/tests/racer/file_swap.sh
lustre/tests/racer/file_symlink.sh
lustre/tests/racer/file_truncate.sh

index 9bd72f9..97fee9b 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+trap 'kill $(jobs -p)' EXIT
 
 DIR=$1
 MAX=$2
index e95e346..ae7d4c6 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+trap 'kill $(jobs -p)' EXIT
 
 DIR=$1
 MAX=$2
index 6c3132c..0950625 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+trap 'kill $(jobs -p)' EXIT
 
 DIR=$1
 MAX=$2
index 585c155..fffa4c8 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+trap 'kill $(jobs -p)' EXIT
 
 DIR=$1
 MAX=$2
index d5de24b..2793c10 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+trap 'kill $(jobs -p)' EXIT
 
 DIR=$1
 MAX=$2
index de194b8..79f0d92 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+trap 'kill $(jobs -p)' EXIT
 
 DIR=$1
 MAX=$2
index 875c056..b1704d3 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+trap 'kill $(jobs -p)' EXIT
 
 DIR=$1
 MAX=$2
index b38e515..44e87ec 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+trap 'kill $(jobs -p)' EXIT
 
 DIR=$1
 MAX=$2
index 7f44491..9ec7b11 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+trap 'kill $(jobs -p)' EXIT
 
 DIR=$1
 MAX=$2
index 0171ae4..3c2f607 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+trap 'kill $(jobs -p)' EXIT
 
 DIR=$1
 MAX=$2
index 9a49395..264ef0f 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+trap 'kill $(jobs -p)' EXIT
 
 DIR=$1
 MAX=$2
index 1d6b80c..2e1c877 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+trap 'kill $(jobs -p)' EXIT
 
 DIR=$1
 MAX=$2
index 0695743..ab2cc11 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+trap 'kill $(jobs -p)' EXIT
 
 DIR=$1
 MAX=$2
index 1f0919f..b5ea2d1 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+trap 'kill $(jobs -p)' EXIT
 
 DIR=$1
 MAX=$2
index 2453c08..dd10cc9 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+trap 'kill $(jobs -p)' EXIT
 
 DIR=$1
 MAX=$2
index eb17ead..69b6fc6 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+trap 'kill $(jobs -p)' EXIT
 
 DIR=$1
 MAX=$2
index ac3c673..2b4faa7 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+trap 'kill $(jobs -p)' EXIT
 
 DIR=$1
 MAX=$2
index ac5cde0..e47107c 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+trap 'kill $(jobs -p)' EXIT
 
 DIR=$1
 MAX=$2
index 8c19285..98f201c 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+trap 'kill $(jobs -p)' EXIT
 
 DIR=$1
 MAX=$2