Whamcloud - gitweb
LU-11742 test: have libtool execute the test binaries 47/33947/6
authorJames Simmons <uja.ornl@yahoo.com>
Fri, 15 Mar 2019 00:38:31 +0000 (20:38 -0400)
committerOleg Drokin <green@whamcloud.com>
Mon, 1 Apr 2019 07:22:02 +0000 (07:22 +0000)
With the move to libtools the ability to run all the lustre
utilities form the source tree was lost. To work around this
the libtool -no-install flag was used to prevent the creation
of the libtool wrappers. While this worked to restore the
source tree sand box development new package breakage is showing.
This is due to the rpath being hard coded into the utilies when
-no-install is used and some platforms disable fixed rpaths.

A very similar problem exist for people who want to use gdb to
debug their projects application. gdb does not work on libtool
wrappers as well so the recommended approach to this type of
problem is to use the libtool execute command. This command
allows the execution of an external non project binary, like
gdb, with the projects real binary application. Apply this
approach to the lustre test suite so commands like kill can
be used to shutdown lustre utilies that are not installed into
the testing environment.

Change-Id: I74112f7250f1c43313d868c0edc7c8815d373002
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/33947
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Chris Horn <hornc@cray.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
debian/control
debian/control.main
lustre.spec.in
lustre/tests/Makefile.am
lustre/tests/sanity-hsm.sh
lustre/utils/Makefile.am
lustre/utils/gss/Makefile.am

index 177eebe..e4d7a85 100644 (file)
@@ -84,7 +84,7 @@ Package: lustre-tests
 Section: utils
 Architecture: i386 armhf powerpc ppc64el amd64 ia64 arm64
 Priority: optional
 Section: utils
 Architecture: i386 armhf powerpc ppc64el amd64 ia64 arm64
 Priority: optional
-Depends: lustre-iokit (= ${binary:Version}), attr, rsync, perl, lsof, mpi-default-bin
+Depends: lustre-iokit (= ${binary:Version}), attr, rsync, perl, lsof, libtool, mpi-default-bin
 Description: Test suite for the Lustre filesystem
  Lustre is a scalable, secure, robust, highly-available cluster file system.
  This release is maintained by Whamcloud and available from
 Description: Test suite for the Lustre filesystem
  Lustre is a scalable, secure, robust, highly-available cluster file system.
  This release is maintained by Whamcloud and available from
index 177eebe..e4d7a85 100644 (file)
@@ -84,7 +84,7 @@ Package: lustre-tests
 Section: utils
 Architecture: i386 armhf powerpc ppc64el amd64 ia64 arm64
 Priority: optional
 Section: utils
 Architecture: i386 armhf powerpc ppc64el amd64 ia64 arm64
 Priority: optional
-Depends: lustre-iokit (= ${binary:Version}), attr, rsync, perl, lsof, mpi-default-bin
+Depends: lustre-iokit (= ${binary:Version}), attr, rsync, perl, lsof, libtool, mpi-default-bin
 Description: Test suite for the Lustre filesystem
  Lustre is a scalable, secure, robust, highly-available cluster file system.
  This release is maintained by Whamcloud and available from
 Description: Test suite for the Lustre filesystem
  Lustre is a scalable, secure, robust, highly-available cluster file system.
  This release is maintained by Whamcloud and available from
index 75a705c..ee49531 100644 (file)
@@ -252,7 +252,7 @@ Requires: %{name} = %{version}
 %endif
 Requires: %{requires_kmod_name} = %{requires_kmod_version}
 Requires: %{requires_kmod_tests_name} = %{requires_kmod_version}
 %endif
 Requires: %{requires_kmod_name} = %{requires_kmod_version}
 Requires: %{requires_kmod_tests_name} = %{requires_kmod_version}
-Requires: attr, rsync, perl, lsof, /usr/bin/getconf
+Requires: attr, rsync, perl, lsof, libtool, /usr/bin/getconf
 
 %description tests
 This package contains a set of test binaries and scripts that are intended
 
 %description tests
 This package contains a set of test binaries and scripts that are intended
index 1e9f6ec..c77958c 100644 (file)
@@ -1,7 +1,6 @@
 # Lustre test Makefile
 AM_CFLAGS := -fPIC -D_GNU_SOURCE \
             -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64
 # Lustre test Makefile
 AM_CFLAGS := -fPIC -D_GNU_SOURCE \
             -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64
-AM_LDFLAGS := -no-install
 
 DIST_SUBDIRS = mpi
 
 
 DIST_SUBDIRS = mpi
 
index 60c19f1..69e3ac3 100755 (executable)
@@ -116,7 +116,6 @@ init_agt_vars() {
        export HSMTOOL_UPDATE_INTERVAL=${HSMTOOL_UPDATE_INTERVAL:=""}
        export HSMTOOL_EVENT_FIFO=${HSMTOOL_EVENT_FIFO:=""}
        export HSMTOOL_TESTDIR
        export HSMTOOL_UPDATE_INTERVAL=${HSMTOOL_UPDATE_INTERVAL:=""}
        export HSMTOOL_EVENT_FIFO=${HSMTOOL_EVENT_FIFO:=""}
        export HSMTOOL_TESTDIR
-       export HSMTOOL_BASE=$(basename "$HSMTOOL" | cut -f1 -d" ")
 
        HSM_ARCHIVE_NUMBER=2
 
 
        HSM_ARCHIVE_NUMBER=2
 
@@ -152,14 +151,14 @@ get_mdt_devices() {
 
 search_copytools() {
        local hosts=${1:-$(facet_active_host $SINGLEAGT)}
 
 search_copytools() {
        local hosts=${1:-$(facet_active_host $SINGLEAGT)}
-       do_nodesv $hosts "pgrep -x $HSMTOOL_BASE"
+       do_nodesv $hosts "libtool execute pgrep -x $HSMTOOL"
 }
 
 kill_copytools() {
        local hosts=${1:-$(facet_active_host $SINGLEAGT)}
 
        echo "Killing existing copytools on $hosts"
 }
 
 kill_copytools() {
        local hosts=${1:-$(facet_active_host $SINGLEAGT)}
 
        echo "Killing existing copytools on $hosts"
-       do_nodesv $hosts "killall -q $HSMTOOL_BASE" || true
+       do_nodesv $hosts "libtool execute killall -q $HSMTOOL" || true
        copytool_continue "$hosts"
 }
 
        copytool_continue "$hosts"
 }
 
@@ -290,7 +289,7 @@ __lhsmtool_setup()
        cmd+=" \"$mountpoint\""
 
        echo "Starting copytool $facet on $(facet_host $facet)"
        cmd+=" \"$mountpoint\""
 
        echo "Starting copytool $facet on $(facet_host $facet)"
-       stack_trap "do_facet $facet pkill -x '$HSMTOOL_BASE' || true" EXIT
+       stack_trap "do_facet $facet libtool execute pkill -x '$HSMTOOL' || true" EXIT
        do_facet $facet "$cmd < /dev/null > \"$(copytool_logfile $facet)\" 2>&1"
 }
 
        do_facet $facet "$cmd < /dev/null > \"$(copytool_logfile $facet)\" 2>&1"
 }
 
@@ -402,15 +401,15 @@ copytool_suspend() {
        local agents=${1:-$(facet_active_host $SINGLEAGT)}
 
        stack_trap \
        local agents=${1:-$(facet_active_host $SINGLEAGT)}
 
        stack_trap \
-               "do_nodesv $agents pkill -CONT -x '$HSMTOOL_BASE' || true" EXIT
-       do_nodesv $agents "pkill -STOP -x $HSMTOOL_BASE" || return 0
+               "do_nodesv $agents libtool execute pkill -CONT -x '$HSMTOOL' || true" EXIT
+       do_nodesv $agents "libtool execute pkill -STOP -x $HSMTOOL" || return 0
        echo "Copytool is suspended on $agents"
 }
 
 copytool_continue() {
        local agents=${1:-$(facet_active_host $SINGLEAGT)}
 
        echo "Copytool is suspended on $agents"
 }
 
 copytool_continue() {
        local agents=${1:-$(facet_active_host $SINGLEAGT)}
 
-       do_nodesv $agents "pkill -CONT -x $HSMTOOL_BASE" || return 0
+       do_nodesv $agents "libtool execute pkill -CONT -x $HSMTOOL" || return 0
        echo "Copytool is continued on $agents"
 }
 
        echo "Copytool is continued on $agents"
 }
 
@@ -855,7 +854,7 @@ get_agent_uuid() {
 
        # Lustre mount-point is mandatory and last parameter on
        # copytool cmd-line.
 
        # Lustre mount-point is mandatory and last parameter on
        # copytool cmd-line.
-       local mntpnt=$(do_rpc_nodes $agent ps -C $HSMTOOL_BASE -o args= |
+       local mntpnt=$(do_rpc_nodes $agent libtool execute ps -C $HSMTOOL -o args= |
                       awk '{print $NF}')
        [ -n "$mntpnt" ] || error "Found no Agent or with no mount-point "\
                                  "parameter"
                       awk '{print $NF}')
        [ -n "$mntpnt" ] || error "Found no Agent or with no mount-point "\
                                  "parameter"
index f7655b9..4d7b56b 100644 (file)
@@ -2,7 +2,6 @@
 
 AM_CFLAGS  := -fPIC -D_GNU_SOURCE \
              -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DLUSTRE_UTILS=1
 
 AM_CFLAGS  := -fPIC -D_GNU_SOURCE \
              -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DLUSTRE_UTILS=1
-AM_LDFLAGS := -no-install
 
 if TESTS
 EXTRA_PROGRAMS = wirecheck
 
 if TESTS
 EXTRA_PROGRAMS = wirecheck
index 437a2e5..dff542d 100644 (file)
@@ -3,7 +3,6 @@
 AM_CFLAGS := -fPIC \
             -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DLUSTRE_UTILS=1 \
             -D_GNU_SOURCE
 AM_CFLAGS := -fPIC \
             -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DLUSTRE_UTILS=1 \
             -D_GNU_SOURCE
-AM_LDFLAGS := -no-install
 
 sbin_PROGRAMS = lsvcgssd l_idmap
 
 
 sbin_PROGRAMS = lsvcgssd l_idmap