Skip to content

Commit

Permalink
test: verify forwarding to and reception from multicast 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 2, 2025
1 parent 9fac3ca commit 34391e7
Show file tree
Hide file tree
Showing 2 changed files with 45 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 multicast.sh
property.sh raw.sh regression.sh multicast.sh mcast-fwd.sh
CLEANFILES = *~ *.trs *.log
TEST_EXTENSIONS = .sh
TESTS_ENVIRONMENT= unshare -mrun
Expand Down Expand Up @@ -34,5 +34,6 @@ TESTS += property.sh
TESTS += raw.sh
TESTS += regression.sh
TESTS += multicast.sh
TESTS += mcast-fwd.sh

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

MSG="Copying foobar to xyzzy"
GROUP=225.1.2.3

setup_sender()
{
cat <<-EOF >"${CONF}"
*.* @$GROUP ;RFC5424
EOF
setup -m0

ip route add default via 127.0.0.1
}

setup_receiver()
{
cat <<-EOF > "${CONF2}"
uucp.info $LOG2
listen $GROUP
EOF
setup2 -m0 -nH
}

verify_mcast_fwd()
{
cap_start
logger -p uucp.info "$MSG"
cap_stop

cap_find "$MSG"
}

verify_mcast_rcv()
{
grep -H "$MSG" "$LOG2"
}

run_step "Set up sender syslogd" setup_sender
run_step "Set up receiver syslogd" setup_receiver
run_step "Verify multicast forward" verify_mcast_fwd
run_step "Verify multicast received" verify_mcast_rcv

0 comments on commit 34391e7

Please sign in to comment.