Browse Source

[3508] Unit-tests added for version reporting.

Tomek Mrugalski 10 years ago
parent
commit
1bf7b6c48e

+ 3 - 0
src/bin/d2/tests/d2_process_tests.sh.in

@@ -16,6 +16,8 @@
 CFG_FILE=@abs_top_builddir@/src/bin/d2/tests/test_config.json
 # Path to the D2 log file.
 LOG_FILE=@abs_top_builddir@/src/bin/d2/tests/test.log
+# Expected version
+EXPECTED_VERSION="@PACKAGE_VERSION@"
 # D2 configuration to be stored in the configuration file.
 CONFIG="{
     \"DhcpDdns\":
@@ -236,3 +238,4 @@ shutdown_test() {
 dynamic_reconfiguration_test
 shutdown_test "dhcp-ddns.sigterm_test" 15
 shutdown_test "dhcp-ddns.sigint_test" 2
+version_test "dhcp-ddns.version"

+ 3 - 2
src/bin/dhcp4/dhcp4_messages.mes

@@ -351,9 +351,10 @@ core component within the DHCPv4 server (the Dhcpv4 server object)
 has failed.  As a result, the server will exit.  The reason for the
 failure is given within the message.
 
-% DHCP4_STARTING server starting
+% DHCP4_STARTING Kea DHCPv4 server version %1 starting
 This informational message indicates that the DHCPv4 server has
-processed any command-line switches and is starting.
+processed any command-line switches and is starting. The version
+is also printed.
 
 % DHCP4_START_INFO pid: %1, port: %2, verbose: %3
 This is a debug message issued during the DHCPv4 server startup.

+ 3 - 0
src/bin/dhcp4/tests/dhcp4_process_tests.sh.in

@@ -16,6 +16,8 @@
 CFG_FILE=@abs_top_builddir@/src/bin/dhcp4/tests/test_config.json
 # Path to the Kea log file.
 LOG_FILE=@abs_top_builddir@/src/bin/dhcp4/tests/test.log
+# Expected version
+EXPECTED_VERSION="@PACKAGE_VERSION@"
 # Kea configuration to be stored in the configuration file.
 CONFIG="{
     \"Dhcp4\":
@@ -256,3 +258,4 @@ shutdown_test() {
 dynamic_reconfiguration_test
 shutdown_test "dhcpv4.sigterm_test" 15
 shutdown_test "dhcpv4.sigint_test" 2
+version_test "dhcpv4.version"

+ 5 - 2
src/bin/dhcp6/tests/dhcp6_process_tests.sh.in

@@ -16,6 +16,8 @@
 CFG_FILE=@abs_top_builddir@/src/bin/dhcp6/tests/test_config.json
 # Path to the Kea log file.
 LOG_FILE=@abs_top_builddir@/src/bin/dhcp6/tests/test.log
+# Expected version
+EXPECTED_VERSION="@PACKAGE_VERSION@"
 # Kea configuration to be stored in the configuration file.
 CONFIG="{
     \"Dhcp6\":
@@ -257,5 +259,6 @@ shutdown_test() {
 }
 
 dynamic_reconfiguration_test
-shutdown_test "dhcpv4.sigterm_test" 15
-shutdown_test "dhcpv4.sigint_test" 2
+shutdown_test "dhcpv6.sigterm_test" 15
+shutdown_test "dhcpv6.sigint_test" 2
+version_test "dhcpv6.version"

+ 1 - 1
src/bin/keactrl/keactrl.in

@@ -284,7 +284,7 @@ case ${command} in
         args="-c ${kea_config_file}"
 
         if [ "${kea_verbose}" = "yes" ]; then
-            args="${args} -v"
+            args="${args} -d"
         fi
 
         # Run servers if they are on the list of servers from the command line