From: Marcin Godzina Date: Thu, 9 Jul 2026 07:31:20 +0000 (+0200) Subject: [#4630] disable netconf in test if not present X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=471a54725f43ae9bacc8488f63059e610e95fdea;p=thirdparty%2Fkea.git [#4630] disable netconf in test if not present --- diff --git a/src/bin/keactrl/tests/keactrl_tests.sh.in b/src/bin/keactrl/tests/keactrl_tests.sh.in index ca0d24242f..dac42232e6 100755 --- a/src/bin/keactrl/tests/keactrl_tests.sh.in +++ b/src/bin/keactrl/tests/keactrl_tests.sh.in @@ -1446,8 +1446,13 @@ server_options_tests() { # Create configuration file for keactrl. This configuration enables # kea-dhcp4, kea-dhcp6, kea-dhcp-ddns and kea-netconf. - keactrl_config="${CFG_FILES}\ndhcp4=yes\ndhcp6=yes\n\ -dhcp_ddns=yes\nnetconf=yes\n\ + keactrl_config="${CFG_FILES}\ndhcp4=yes\ndhcp6=yes\ndhcp_ddns=yes\n" + if ${have_netconf}; then + keactrl_config="${keactrl_config}netconf=yes\n" + else + keactrl_config="${keactrl_config}netconf=no\n" + fi + keactrl_config="${keactrl_config}\ kea_verbose=no\n\ dhcp4_cli_options=\"-F\"\n\ dhcp6_cli_options=\"-F\"\n\ @@ -1465,10 +1470,10 @@ netconf_cli_options=\"-F\"\n${keactrl_fixed_config}" set_logger # Start servers using keactrl script. - printf 'INFO/test_lib: Starting Kea: %s start -c %s -s dhcp4,dhcp6,dhcp_ddns,netconf\n' \ + printf 'INFO/test_lib: Starting Kea: %s start -c %s\n' \ "${keactrl}" "${KEACTRL_CFG_FILE}" set +e - "${keactrl}" start -c "${KEACTRL_CFG_FILE}" -s dhcp4,dhcp6,dhcp_ddns,netconf + "${keactrl}" start -c "${KEACTRL_CFG_FILE}" assert_eq 0 "${?}" "Expected keactrl to return %d, returned value was %d" set -e @@ -1522,15 +1527,17 @@ Expected wait_for_message return %d, returned %d." fi # kea-netconf server - get_pid "${netconf_name}" "${NC_CFG_FILE_NAME}" - assert_eq 1 "${_GET_PIDS_NUM}" \ - "ERROR: Expected %d ${netconf_name} process running, found %d processes running" - - NETCONF_CMDLINE="$(ps -p "${_GET_PID}" -o args=)" - if ! echo "${NETCONF_CMDLINE}" | grep -q -- ' -F'; then - printf "ERROR: kea-netconf did not start with expected -F argument.\n" - shutdown_servers - test_finish 1 + if ${have_netconf}; then + get_pid "${netconf_name}" "${NC_CFG_FILE_NAME}" + assert_eq 1 "${_GET_PIDS_NUM}" \ + "ERROR: Expected %d ${netconf_name} process running, found %d processes running" + + NETCONF_CMDLINE="$(ps -p "${_GET_PID}" -o args=)" + if ! echo "${NETCONF_CMDLINE}" | grep -q -- ' -F'; then + printf "ERROR: kea-netconf did not start with expected -F argument.\n" + shutdown_servers + test_finish 1 + fi fi shutdown_servers @@ -1541,8 +1548,13 @@ Expected wait_for_message return %d, returned %d." # Create configuration file for keactrl. This configuration enables # kea-dhcp4, kea-dhcp6, kea-dhcp-ddns and kea-netconf. - keactrl_config="${CFG_FILES}\ndhcp4=yes\ndhcp6=yes\n\ -dhcp_ddns=yes\nnetconf=yes\n\ + keactrl_config="${CFG_FILES}\ndhcp4=yes\ndhcp6=yes\ndhcp_ddns=yes\n" + if ${have_netconf}; then + keactrl_config="${keactrl_config}netconf=yes\n" + else + keactrl_config="${keactrl_config}netconf=no\n" + fi + keactrl_config="${keactrl_config}\ kea_verbose=no\n\ dhcp4_cli_options=\"-F\"\n\ dhcp6_cli_options=\"-F\"\n\ @@ -1560,10 +1572,10 @@ netconf_cli_options=\"-F\"\n${keactrl_fixed_config}" set_logger # Start servers using keactrl script. - printf 'INFO/test_lib: Starting Kea: %s start -c %s -s dhcp4,dhcp6,dhcp_ddns,netconf -- -X\n' \ + printf 'INFO/test_lib: Starting Kea: %s start -c %s -- -X\n' \ "${keactrl}" "${KEACTRL_CFG_FILE}" set +e - "${keactrl}" start -c "${KEACTRL_CFG_FILE}" -s dhcp4,dhcp6,dhcp_ddns,netconf -- -X + "${keactrl}" start -c "${KEACTRL_CFG_FILE}" -- -X assert_eq 0 "${?}" "Expected keactrl to return %d, returned value was %d" set -e @@ -1617,15 +1629,17 @@ Expected wait_for_message return %d, returned %d." fi # kea-netconf server - get_pid "${netconf_name}" "${NC_CFG_FILE_NAME}" - assert_eq 1 "${_GET_PIDS_NUM}" \ - "ERROR: Expected %d ${netconf_name} process running, found %d processes running" - - NETCONF_CMDLINE="$(ps -p "${_GET_PID}" -o args=)" - if ! echo "${NETCONF_CMDLINE}" | grep -q -- ' -X -F'; then - printf "ERROR: kea-netconf did not start with expected -X -F argument.\n" - shutdown_servers - test_finish 1 + if ${have_netconf}; then + get_pid "${netconf_name}" "${NC_CFG_FILE_NAME}" + assert_eq 1 "${_GET_PIDS_NUM}" \ + "ERROR: Expected %d ${netconf_name} process running, found %d processes running" + + NETCONF_CMDLINE="$(ps -p "${_GET_PID}" -o args=)" + if ! echo "${NETCONF_CMDLINE}" | grep -q -- ' -X -F'; then + printf "ERROR: kea-netconf did not start with expected -X -F argument.\n" + shutdown_servers + test_finish 1 + fi fi shutdown_servers