From: Tomek Mrugalski Date: Mon, 11 Aug 2014 15:33:15 +0000 (+0200) Subject: [3508] Added missing version_test check. X-Git-Tag: trac3482_base~46^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=26b7bfed72d77950782f3e34daa09f045907feb9;p=thirdparty%2Fkea.git [3508] Added missing version_test check. --- diff --git a/src/lib/testutils/dhcp_test_lib.sh.in b/src/lib/testutils/dhcp_test_lib.sh.in index f8f3bb9844..39ef7ff774 100644 --- a/src/lib/testutils/dhcp_test_lib.sh.in +++ b/src/lib/testutils/dhcp_test_lib.sh.in @@ -401,3 +401,23 @@ must be a number" # Actually send a signal. kill -${sig} ${_GET_PIDS} } + +# This test verifies that DHCPv4 server is reporting its version properly. +version_test() { + test_name=${1} # Test name + + # Log the start of the test and print test name. + test_start ${test_name} + + # Remove dangling Kea instances and remove log files. + cleanup + + REPORTED_VERSION="`${bin_path}/${bin} -v`" + + if test "${REPORTED_VERSION}" == "${EXPECTED_VERSION}"; then + test_finish 0 + else + printf "ERROR: Expected version ${EXPECTED_VERSION}, got ${REPORTED_VERSION}\n" + test_finish 1 + fi +}