# This script is used to run Kea from installation directory,
# as well as for running tests.
+VERSION=@PACKAGE_VERSION@
+
### Logging functions ###
# Logs message at the error level.
usage
exit 1
fi
+
+# Check if this is a simple question about version.
+if test "${command}" = "-v" || test "${command}" = "--version" ; then
+ echo "${VERSION}"
+ exit 0
+fi
+
is_in_list "${command}" "start stop reload status"
if [ ${_inlist} -eq 0 ]; then
log_error "invalid command: ${command}"
test_finish 0
}
+# This test checks version reported by kea-admin. It has nothing to do
+# with memfile, but that is the only test file that is always ran,
+# so decided to put the generic test here.
+version_test() {
+ test_start "version"
+
+ # This is what we expect to get.
+ EXPECTED_VERSION=@PACKAGE_VERSION@
+
+ # Let's use short version: -v
+ reported_version=$(${keactrl} -v)
+
+ assert_str_eq ${EXPECTED_VERSION} ${reported_version} \
+ "Expected keactrl -v to report %s, but it reported %s"
+
+ # Let's try the long version: --version
+ reported_version=$(${keactrl} --version)
+
+ assert_str_eq ${EXPECTED_VERSION} ${reported_version} \
+ "Expected keactrl -v to report %s, but it reported %s"
+
+ test_finish 0
+}
+
+
+version_test
start_all_servers_no_verbose_test
start_all_servers_verbose_test
start_v4_server_test