Patch to allow for a minimal configuration to be
automatically setup in sanity-hsm.sh, and for example
to permit the single-node sessions runs like :
./lustre/tests/llmount.sh
./lustre/tests/sanity-hsm.sh
Also changed default mount-point to be monitored by agent
to become $MOUNT2 if $MOUNT_2==y.
Created get_agent_uuid() function to dynamically discover
agent's monitored mount-point.
Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Change-Id: I194d4a321ea3bcc169c3811e19b1069749b99e72
Reviewed-on: http://review.whamcloud.com/12982
Tested-by: Maloo <hpdd-maloo@intel.com>
Tested-by: Jenkins
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
+# if there is no CLIENT1 defined, some tests can be ran on localhost
+CLIENT1=${CLIENT1:-$HOSTNAME}
+# if CLIENT2 doesn't exist then use CLIENT1 instead
+# All tests should use CLIENT2 with MOUNT2 only therefore it will work if
+# $CLIENT2 == CLIENT1
+# Exception is the test which need two separate nodes
+CLIENT2=${CLIENT2:-$CLIENT1}
+
#
# In order to test multiple remote HSM agents, a new facet type named "AGT" and
# the following associated variables are added:
#
# In order to test multiple remote HSM agents, a new facet type named "AGT" and
# the following associated variables are added:
copytool_setup() {
local facet=${1:-$SINGLEAGT}
copytool_setup() {
local facet=${1:-$SINGLEAGT}
- local lustre_mntpnt=${2:-$MOUNT}
+ # Use MOUNT2 by default if defined
+ local lustre_mntpnt=${2:-${MOUNT2:-$MOUNT}}
local arc_id=$3
local hsm_root=${4:-$(copytool_device $facet)}
local agent=$(facet_active_host $facet)
local arc_id=$3
local hsm_root=${4:-$(copytool_device $facet)}
local agent=$(facet_active_host $facet)
-test_106() {
- local uuid=$(do_rpc_nodes $(facet_active_host $SINGLEAGT) \
- get_client_uuid $MOUNT | cut -d' ' -f2)
+get_agent_uuid() {
+ local agent=${1:-$(facet_active_host $SINGLEAGT)}
+
+ # Lustre mount-point is mandatory and last parameter on
+ # copytool cmd-line.
+ local mntpnt=$(do_rpc_nodes $agent pgrep -fl $HSMTOOL_BASE |
+ grep -v pgrep | awk '{print $NF}')
+ [ -n "$mntpnt" ] || error "Found no Agent or with no mount-point "\
+ "parameter"
+ do_rpc_nodes $agent get_client_uuid $mntpnt | cut -d' ' -f2
+}
+test_106() {
+ # test needs a running copytool
+
+ local uuid=$(get_agent_uuid $(facet_active_host $SINGLEAGT))
+
check_agent_registered $uuid
search_copytools || error "No copytool found"
check_agent_registered $uuid
search_copytools || error "No copytool found"
check_agent_unregistered $uuid
copytool_setup
check_agent_unregistered $uuid
copytool_setup
+ uuid=$(get_agent_uuid $(facet_active_host $SINGLEAGT))
check_agent_registered $uuid
copytool_cleanup
check_agent_registered $uuid
copytool_cleanup
copytool_cleanup
local agent=$(facet_active_host $SINGLEAGT)
copytool_cleanup
local agent=$(facet_active_host $SINGLEAGT)
- local uuid=$(do_rpc_nodes $agent get_client_uuid | cut -d' ' -f2)
# deactivate all mdc for MDT0001
mdc_change_state $SINGLEAGT "$FSNAME-MDT0001" "deactivate"
copytool_setup
# deactivate all mdc for MDT0001
mdc_change_state $SINGLEAGT "$FSNAME-MDT0001" "deactivate"
copytool_setup
+ local uuid=$(get_agent_uuid $agent)
# check the agent is registered on MDT0000, and not on MDT0001
check_agent_registered_by_mdt $uuid 0
check_agent_unregistered_by_mdt $uuid 1
# check the agent is registered on MDT0000, and not on MDT0001
check_agent_registered_by_mdt $uuid 0
check_agent_unregistered_by_mdt $uuid 1