Whamcloud - gitweb
LU-13688 hsm: handle in-tree executed copytools correctly 62/38962/6
authorNikitas Angelinas <nikitas.angelinas@hpe.com>
Wed, 17 Jun 2020 11:17:07 +0000 (04:17 -0700)
committerOleg Drokin <green@whamcloud.com>
Thu, 13 Aug 2020 06:02:40 +0000 (06:02 +0000)
commit29bb063654c9a74d495e5d4cea17694a2b70f6a0
tree93842165b73b945ccbb6a20c086d9390373cee25
parent4c9f24201d5c782357f2ad3e050fa32f0c5b4455
LU-13688 hsm: handle in-tree executed copytools correctly

The Lustre test suite and HSM copytools can be invoked from either
within /usr/lib{,64}/ if they have been installed from source or from
packages, or from within the Lustre source tree, usually for
development purposes; in the latter case, the copytool process name is
prepended with an "lt-", due to being invoked via a libtool wrapper
script. The Lustre test framework relies on "libtool execute" to
distinguish between these two cases, parse the command parameters and
pass the correct process name as a parameter to utilities such as
pgrep(1), pkill(1), ps(1) and killall(1). Unfortunately, this doesn't
seem to work unless the libtool script for the copytool and the test
framework test file are in the same directory; e.g. this doesn't work
for lhsmtool_posix as its libtool script is in lustre/utils/, but the
Lustre test suite is in lustre/tests/, which doesn't allow the
"libtool execute" parsing and parameter replacing to succeed.

Fix this by determining the process name of the executed copytool
based on whether it was invoked from within the source tree or not and
using it in commands that either search for copytool processes or send
them signals by process name.

Signed-off-by: Nikitas Angelinas <nikitas.angelinas@hpe.com>
Cray-bug-id: LUS-8931
Change-Id: Ief7b224b793401b1a24bf9780d1df6e029f5c0d7
Reviewed-on: https://review.whamcloud.com/38962
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Ben Evans <beevans@whamcloud.com>
Reviewed-by: nathan r <nrutman@gmail.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-hsm.sh
lustre/tests/test-framework.sh