From 608755f4ee4ae2cb30a7eb8b7b3a4f5944acfbb7 Mon Sep 17 00:00:00 2001 From: Tomek Mrugalski Date: Fri, 19 Oct 2018 16:33:53 +0200 Subject: [PATCH] [148-lib-process-servers-without-arguments] Added system test # Conflicts: # src/bin/netconf/tests/netconf_tests.sh.in --- src/bin/netconf/tests/netconf_tests.sh.in | 32 +++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/bin/netconf/tests/netconf_tests.sh.in b/src/bin/netconf/tests/netconf_tests.sh.in index 50143d04a9..bbff70c558 100644 --- a/src/bin/netconf/tests/netconf_tests.sh.in +++ b/src/bin/netconf/tests/netconf_tests.sh.in @@ -112,6 +112,7 @@ syntax_check_test() { test_start $TESTNAME # Remove dangling Kea instances and remove log files. cleanup + # Create correct configuration file. create_config "${CONFIG}" # Check it @@ -184,13 +185,40 @@ shutdown_test() { test_finish 0 } +# This test verifies that no argument is not reported as a PID file error. +no_argument_test() { + local TESTNAME="${1}" + local EXP_CODE="${2}" + + # Log the start of the test and print test name. + test_start $TESTNAME + # Remove dangling Kea instances and remove log files. + cleanup + + # Check it + printf "Running command %s.\n" "\"${bin_path}/${bin}\"" + ${bin_path}/${bin} | grep PID 2>&1 + exit_code=$? + if [ ${exit_code} -ne $EXP_CODE ]; then + printf "ERROR: expected exit code ${EXP_CODE}, got ${exit_code}\n" + clean_exit 1 + fi + test_finish 0 +} + version_test "netconf.version" usage_test "netconf.invalid-param" "-f" 1 usage_test "netconf.dash-h" "-h" 1 usage_test "netconf.dash-v" "-v" 0 -shutdown_test "netconf.sigterm_test" 15 -shutdown_test "netconf.sigint_test" 2 + +# The following tests are currently disabled. Once we have a parser that is +# able to understand logger configuration, those tests (imported from DHCPv4) +# should work. +#shutdown_test "netconf.sigterm_test" 15 +#shutdown_test "netconf.sigint_test" 2 logger_vars_test "netconf.variables" syntax_check_test "netconf.syntax_check_success" "${CONFIG}" 0 syntax_check_test "netconf.syntax_check_bad_syntax" "${CONFIG_BAD_SYNTAX}" 1 syntax_check_test "netconf.syntax_check_bad_values" "${CONFIG_BAD_VALUE}" 1 + +no_argument_test "netconf.no-argument" 1 -- 2.47.2