diff options
author | Martin Schwenke <martin@meltin.net> | 2017-03-02 21:55:54 +1100 |
---|---|---|
committer | Martin Schwenke <martins@samba.org> | 2018-03-01 19:39:15 +0100 |
commit | 4bb8a6222a7b24c8877aa8a799d6b10187f8259f (patch) | |
tree | bdd263d60a184a71cb0a11f6cc3affd9e4b4b830 /ctdb | |
parent | 95888c8e1a491ef58333714fe545d5651d05cc1a (diff) | |
download | samba-4bb8a6222a7b24c8877aa8a799d6b10187f8259f.tar.gz |
ctdb-tests: Generalise SM_NOTIFY output format in statd-callout tests
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rw-r--r-- | ctdb/tests/eventscripts/scripts/local.sh | 8 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/stubs/smnotify | 40 |
2 files changed, 42 insertions, 6 deletions
diff --git a/ctdb/tests/eventscripts/scripts/local.sh b/ctdb/tests/eventscripts/scripts/local.sh index b5eeb92f56f..4af1522e542 100644 --- a/ctdb/tests/eventscripts/scripts/local.sh +++ b/ctdb/tests/eventscripts/scripts/local.sh @@ -706,10 +706,10 @@ check_statd_callout_smnotify () while read _x _sip _x ; do for _cip ; do cat <<EOF ---client=${_cip} --ip=${_sip} --server=${_sip} --stateval=${_state_even} ---client=${_cip} --ip=${_sip} --server=${NFS_HOSTNAME} --stateval=${_state_even} ---client=${_cip} --ip=${_sip} --server=${_sip} --stateval=${_state_odd} ---client=${_cip} --ip=${_sip} --server=${NFS_HOSTNAME} --stateval=${_state_odd} +SM_NOTIFY: ${_sip} -> ${_cip}, MON_NAME=${_sip}, STATE=${_state_even} +SM_NOTIFY: ${_sip} -> ${_cip}, MON_NAME=${NFS_HOSTNAME}, STATE=${_state_even} +SM_NOTIFY: ${_sip} -> ${_cip}, MON_NAME=${_sip}, STATE=${_state_odd} +SM_NOTIFY: ${_sip} -> ${_cip}, MON_NAME=${NFS_HOSTNAME}, STATE=${_state_odd} EOF done done | { diff --git a/ctdb/tests/eventscripts/stubs/smnotify b/ctdb/tests/eventscripts/stubs/smnotify index 414fa99a897..2bace779df0 100755 --- a/ctdb/tests/eventscripts/stubs/smnotify +++ b/ctdb/tests/eventscripts/stubs/smnotify @@ -1,3 +1,39 @@ #!/bin/sh -# echo args -echo "$*" + +usage() +{ + _prog="${0##*/}" # basename + cat <<EOF +Usage: ${_prog} --client=CLIENT --ip=IP --server=SERVER --stateval=STATEVAL +EOF + exit 1 +} + +temp=$(getopt -n "smnotify" -o "h" -l client:,ip:,server:,stateval: -- "$@") +if [ $? != 0 ] ; then + usage +fi + +eval set -- "$temp" + +cip="" +sip="" +mon_name="" +state="" + +while : ; do + case "$1" in + --client) cip="$2" ; shift 2 ;; + --ip) sip="$2" ; shift 2 ;; + --server) mon_name="$2" ; shift 2 ;; + --stateval) state="$2" ; shift 2 ;; + --) shift ; break ;; + *) usage ;; + esac +done + +if [ -z "$cip" -o -z "$sip" -o -z "$mon_name" -o -z "$state" ] ; then + usage +fi + +echo "SM_NOTIFY: ${sip} -> ${cip}, MON_NAME=${mon_name}, STATE=${state}" |