Skip to content

Commit

Permalink
test: verify logger send to and syslogd multicast receive from group
Browse files Browse the repository at this point in the history
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
  • Loading branch information
troglobit committed Jan 1, 2025
1 parent d679b34 commit 24e65fa
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ EXTRA_DIST = lib.sh opts.sh
EXTRA_DIST += api.sh local.sh unicode.sh remote.sh fwd.sh mark.sh \
memleak.sh facility.sh notify.sh rotate_all.sh secure.sh \
logger.sh listen.sh sighup.sh tag.sh hostname.sh \
property.sh raw.sh regression.sh
property.sh raw.sh regression.sh multicast.sh
CLEANFILES = *~ *.trs *.log
TEST_EXTENSIONS = .sh
TESTS_ENVIRONMENT= unshare -mrun
Expand Down Expand Up @@ -33,5 +33,6 @@ TESTS += hostname.sh
TESTS += property.sh
TESTS += raw.sh
TESTS += regression.sh
TESTS += multicast.sh

programs: $(check_PROGRAMS)
27 changes: 27 additions & 0 deletions test/multicast.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh
. "${srcdir:-.}/lib.sh"

GROUP=225.1.2.3

setup_listen()
{
ip link set lo up state up
ip route add default via 127.0.0.1

cat <<-EOF > "${CONF}"
*.* $LOG
listen $1:$PORT2
EOF
setup -m0
}

verify_listen()
{
MSG="kilroy was here"

logger -h "$GROUP" -P "$PORT2" "${MSG}"
grep -H "${MSG}" "$LOG"
}

run_step "Setup daemon that listen to $GROUP" setup_listen "$GROUP"
run_step "Verify sending to group $GROUP" verify_listen "$GROUP"

0 comments on commit 24e65fa

Please sign in to comment.