# 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\
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
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
# 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\
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
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