diff --git a/usr.sbin/syslogd/tests/syslogd_test.sh b/usr.sbin/syslogd/tests/syslogd_test.sh --- a/usr.sbin/syslogd/tests/syslogd_test.sh +++ b/usr.sbin/syslogd/tests/syslogd_test.sh @@ -108,7 +108,9 @@ } basic_body() { - logfile="${PWD}/basic.log" + local inet inet6 + local logfile="${PWD}/basic.log" + printf "user.debug\t${logfile}\n" > "${SYSLOGD_CONFIG}" syslogd_start @@ -117,18 +119,18 @@ atf_check -s exit:0 -o match:"basic: hello, world \(unix\)" \ tail -n 1 "${logfile}" - # Grab kernel configuration file. - sysctl kern.conftxt > conf.txt - - # We have INET transport; make sure we can use it. - if grep -qw "INET" conf.txt; then + inet=$(sysctl kern.features.inet) + if [ ${inet} -eq 1 ]; then + # We have INET transport; make sure we can use it. syslogd_log -4 -p user.debug -t basic -h 127.0.0.1 -P "${SYSLOGD_UDP_PORT}" \ "hello, world (v4)" atf_check -s exit:0 -o match:"basic: hello, world \(v4\)" \ tail -n 1 "${logfile}" fi - # We have INET6 transport; make sure we can use it. - if grep -qw "INET6" conf.txt; then + + inet6=$(sysctl kern.features.inet6) + if [ ${inet6} -eq 1 ]; then + # We have INET6 transport; make sure we can use it. syslogd_log -6 -p user.debug -t basic -h ::1 -P "${SYSLOGD_UDP_PORT}" \ "hello, world (v6)" atf_check -s exit:0 -o match:"basic: hello, world \(v6\)" \