1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

ctdb-tests: 31.clamd event script setup modularisation

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2018-02-12 13:58:42 +11:00 committed by Amitay Isaacs
parent 0bc1b4b27e
commit 3172dc7244
5 changed files with 22 additions and 10 deletions

View File

@ -4,10 +4,10 @@
define_test "Not managed, clamd not listening"
export CTDB_MANAGES_CLAMD=no
export CTDB_CLAMD_SOCKET="/var/run/clamd.sock"
setup
setup_generic
CTDB_MANAGES_CLAMD=no
CTDB_CLAMD_SOCKET="/var/run/clamd.sock"
ok_null
simple_test

View File

@ -4,10 +4,10 @@
define_test "Managed, clamd not listening"
export CTDB_MANAGES_CLAMD=yes
export CTDB_CLAMD_SOCKET="/var/run/clamd.sock"
setup
setup_generic
CTDB_MANAGES_CLAMD=yes
CTDB_CLAMD_SOCKET="/var/run/clamd.sock"
required_result 1 <<EOF
ERROR: clamd not listening on $CTDB_CLAMD_SOCKET

View File

@ -4,10 +4,10 @@
define_test "Managed, clamd listening"
export CTDB_MANAGES_CLAMD=yes
export CTDB_CLAMD_SOCKET="/var/run/clamd.sock"
setup
setup_generic
CTDB_MANAGES_CLAMD=yes
CTDB_CLAMD_SOCKET="/var/run/clamd.sock"
unix_socket_listening "$CTDB_CLAMD_SOCKET"

View File

@ -0,0 +1,7 @@
setup ()
{
export CTDB_MANAGES_CLAMD="yes"
export CTDB_CLAMD_SOCKET="/var/run/clamd.sock"
setup_unix_listen
}

View File

@ -91,7 +91,7 @@ setup_generic ()
setup_dbdir
setup_date
export FAKE_TCP_LISTEN FAKE_NETSTAT_UNIX_LISTEN
export FAKE_TCP_LISTEN
}
tcp_port_down ()
@ -102,6 +102,11 @@ tcp_port_down ()
done
}
setup_unix_listen ()
{
export FAKE_NETSTAT_UNIX_LISTEN="$*"
}
unix_socket_listening ()
{
_s="$1"