Whamcloud - gitweb
LU-9186 tests: fix sanityn test_76 and related code 47/25847/6
authorAndreas Dilger <andreas.dilger@intel.com>
Tue, 7 Mar 2017 03:05:42 +0000 (20:05 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 19 Apr 2017 04:47:11 +0000 (04:47 +0000)
commit3b3d8a35b7eb6de8c637e154f9509bb78695fece
treedb7a0bf9f874e7b4345a042bb4a6614ef0ecb739
parente9389613eb29297f7b5a6b6cd896bafc7a5551f8
LU-9186 tests: fix sanityn test_76 and related code

Fix sanityn.sh test_76 to skip already open files when checking
whether mdt.*.exports.*.open_files accurately lists open files.
Otherwise, if some previous test leaves a file descriptor open
it will cause this test to fail spuriously.

Limit the number of open files to 256*MDSCOUNT rather than 2048,
so the test runs faster (80s vs. 215s in my VM with 2 MDTs).

Properly close the open shell FDs using "FD<&-" rather than
redirecting them to /dev/null, otherwise they stay open forever.

Print a '.' only once per 32 files opened/closed.

List open files in *.open_files in the order they were opened,
rather than reverse order, since this makes it easier to see which
files have been open longer.

Print out the pathname of the open files being skipped.

Don't explicitly mount $MOUNT2 in sanityn.sh.  This is already
handled inside check_and_setup_lustre() at the start of sanityn.sh.

Improve free_fd() to accept a "last_fd" argument to avoid searching
all open FDs on each call if it is known the fds are not closing.

Test-Parameters: trivial
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I274b6db96f49a52c086f836c005558ef4b3ebbe5
Reviewed-on: https://review.whamcloud.com/25847
Tested-by: Jenkins
Reviewed-by: Jian Yu <jian.yu@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Ashish Purkar <ashish.purkar@seagate.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mdt/mdt_open.c
lustre/tests/sanityn.sh
lustre/tests/test-framework.sh