From 9107867fa1307a7ec65f250efbc2440665078fb0 Mon Sep 17 00:00:00 2001 From: Simon Biewald Date: Thu, 9 Jul 2020 18:57:01 +0200 Subject: use correct regex and comparison to match peers --- include/tests_time | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/tests_time') diff --git a/include/tests_time b/include/tests_time index 79e7aa2e..eee5cbfc 100644 --- a/include/tests_time +++ b/include/tests_time @@ -576,8 +576,8 @@ Register --test-no TIME-3182 --preqs-met "${PREQS_MET}" --weight L --network NO --category security --description "Check OpenNTPD has working peers" if [ ${SKIPTEST} -eq 0 ]; then # Format is "xx/yy peers valid, ..." - FIND=$(${NTPCTLBINARY} -s status | ${EGREPBINARY} -o "[0-9]{1,4}/" | ${EGREPBINARY} -o "[0-9]{1,4}" ) - if [ -n "${FIND}" ] || [ "${FIND}" -eq 0 ]; then + FIND=$(${NTPCTLBINARY} -s status | ${EGREPBINARY} -o '[0-9]+/[0-9]+' | ${CUTBINARY} -d '/' -f 1) + if [ -z "${FIND}" ] || [ "${FIND}" -eq 0 ]; then ReportWarning "${TEST_NO}" "OpenNTPD has no peers" "${NTPCTLBINARY} -s status" fi fi -- cgit v1.2.3