summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/eventscripts/scripts
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2013-08-02 15:18:47 +1000
committerAmitay Isaacs <amitay@gmail.com>2013-08-14 15:57:03 +1000
commit0ca046577f87b2d12403a7e40ea36994fa553340 (patch)
treee33143e564330e1e16bac1b31e160a3c1fb1ea20 /ctdb/tests/eventscripts/scripts
parentbdbe37b24fef22c795531e1aba81e5baee6e5916 (diff)
downloadsamba-0ca046577f87b2d12403a7e40ea36994fa553340.tar.gz
samba-0ca046577f87b2d12403a7e40ea36994fa553340.tar.xz
samba-0ca046577f87b2d12403a7e40ea36994fa553340.zip
eventscripts: Add modulo (%) operator to ctdb_check_counter()
Also add it to the corresponding eventscript unit test infrastructure. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit f4ef83a256f59eeb00b9a5bc10c28347e1ad1031)
Diffstat (limited to 'ctdb/tests/eventscripts/scripts')
-rw-r--r--ctdb/tests/eventscripts/scripts/local.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/ctdb/tests/eventscripts/scripts/local.sh b/ctdb/tests/eventscripts/scripts/local.sh
index fafc8f3b2e..00da7732dd 100644
--- a/ctdb/tests/eventscripts/scripts/local.sh
+++ b/ctdb/tests/eventscripts/scripts/local.sh
@@ -675,7 +675,17 @@ rpc_set_service_failure_response ()
\#*) continue ;;
esac
- if [ "$_numfails" "$_op" "$_li" ] ; then
+ _hit=false
+ if [ "$_op" != "%" ] ; then
+ if [ $_numfails $_op $_li ] ; then
+ _hit=true
+ fi
+ else
+ if [ $(($_numfails $_op $_li)) -eq 0 ] ; then
+ _hit=true
+ fi
+ fi
+ if $_hit ; then
_out=""
_rc=0
for _action in $_actions ; do