Whamcloud - gitweb
LU-11196 tests: clean up after conf-sanity test_101 95/33495/3
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 26 Oct 2018 17:39:15 +0000 (10:39 -0700)
committerOleg Drokin <green@whamcloud.com>
Sat, 19 Jan 2019 06:29:41 +0000 (06:29 +0000)
conf-sanity test_101() creates up to 50000 files in the top-level
test directory, which can sometimes cause the later test_103() setup
to fail, because "rm -rf" fails with "Argument list too long" when
trying to clean up the test directory.

Create the test_101 files in a subdirectory for cleanliness, and
remove them at the end of the test so that we don't run out of space.

This patch is back-ported from the following one:
Lustre-commit: ed44caee9af0eeb32bce7e7de5f5146fa6dc1d00
Lustre-change: https://review.whamcloud.com/33268

Test-Parameters: trivial testlist=conf-sanity
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I1167339d03340e1cc545d2855c4b32eef18cab07
(cherry picked from commit ed44caee9af0eeb32bce7e7de5f5146fa6dc1d00)
Reviewed-on: https://review.whamcloud.com/33495
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
lustre/tests/conf-sanity.sh

index 074c637..c057b68 100644 (file)
@@ -4,8 +4,8 @@ set -e
 
 ONLY=${ONLY:-"$*"}
 
-# bug number for skipped test:  LU-8972
-ALWAYS_EXCEPT="$CONF_SANITY_EXCEPT 101"
+# bug number for skipped test:
+ALWAYS_EXCEPT="$CONF_SANITY_EXCEPT "
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
 is_sles11()                                            # LU-2181
@@ -7210,12 +7210,13 @@ test_100() {
 run_test 100 "check lshowmount lists MGS, MDT, OST and 0@lo"
 
 test_101() {
-       local createmany_oid
+       local createmany_pid
        local dev=$FSNAME-OST0000-osc-MDT0000
        setup
 
-       createmany -o $DIR1/$tfile-%d 50000 &
-       createmany_oid=$!
+       mkdir $DIR1/$tdir
+       createmany -o $DIR1/$tdir/$tfile-%d 50000 &
+       createmany_pid=$!
        # MDT->OST reconnection causes MDT<->OST last_id synchornisation
        # via osp_precreate_cleanup_orphans.
        for ((i = 0; i < 100; i++)); do
@@ -7225,12 +7226,14 @@ test_101() {
                done
 
                ls -asl $MOUNT | grep '???' &&
-                       (kill -9 $createmany_oid &>/dev/null; \
-                        error "File hasn't object on OST")
+                       { kill -9 $createmany_pid &>/dev/null;
+                         error "File has no object on OST"; }
 
-               kill -s 0 $createmany_oid || break
+               kill -s 0 $createmany_pid || break
        done
-       wait $createmany_oid
+       wait $createmany_pid
+
+       unlinkmany $DIR1/$tdir/$tfile-%d 50000
        cleanup
 }
 run_test 101 "Race MDT->OST reconnection with create"