]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3508] Added missing version_test check.
authorTomek Mrugalski <tomasz@isc.org>
Mon, 11 Aug 2014 15:33:15 +0000 (17:33 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Mon, 11 Aug 2014 15:33:15 +0000 (17:33 +0200)
src/lib/testutils/dhcp_test_lib.sh.in

index f8f3bb98441cc2f2765f81e05f1e239381bc2ea5..39ef7ff77402d7352072c57512ccb26c82c5f699 100644 (file)
@@ -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
+}