PYCOVERAGE_RUN = @PYCOVERAGE_RUN@
PYTESTS = dhcp6_test.py
-SHLIBS =
SHTESTS =
# The test of dynamic reconfiguration based on signals will work only
# if we are using file based configuration approach.
if CONFIG_BACKEND_JSON
-SHLIBS += dhcp6_test_func.sh
SHTESTS += dhcp6_reconfigure_test.sh
SHTESTS += dhcp6_sigterm_test.sh
SHTESTS += dhcp6_sigint_test.sh
endif
-EXTRA_DIST = $(PYTESTS) $(SHTESTS) $(SHLIBS)
+EXTRA_DIST = $(PYTESTS) $(SHTESTS)
# Explicitly specify paths to dynamic libraries required by loadable python
# modules. That is required on Mac OS systems. Otherwise we will get exception
for shtest in $(SHTESTS) ; do \
echo Running test: $$shtest ; \
- B10_LOCKFILE_DIR_FROM_BUILD=$(abs_top_builddir) \
+ export B10_LOCKFILE_DIR_FROM_BUILD=$(abs_top_builddir); \
$(abs_srcdir)/$$shtest || exit ; \
done
}
}"
+# Set the location of the executable.
+BIN="b10-dhcp6"
+BIN_PATH=".."
+
# Import common test library.
-. $(dirname $0)/dhcp6_test_func.sh
+. $(dirname $0)/../../../lib/testutils/dhcp_test_lib.sh
# Log the start of the test and print test name.
test_start
}
}"
+# Set the location of the executable.
+BIN="b10-dhcp6"
+BIN_PATH=".."
+
# Import common test library.
-. $(dirname $0)/dhcp6_test_func.sh
+. $(dirname $0)/../../../lib/testutils/dhcp_test_lib.sh
# Log the start of the test and print test name.
test_start
libkea_testutils_la_LIBADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
endif
-EXTRA_DIST = portconfig.h socket_request.h
+# Include common libraries being used by shell-based tests.
+SHLIBS = dhcp_test_lib.sh
+
+EXTRA_DIST = portconfig.h socket_request.h $(SHLIBS)
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# Name of the Kea executable.
-BIN="../b10-dhcp6"
+# The following two parameters must to be specified in a script
+# including this library.
+# - BIN - Name of the Kea executable (excluding a path), e.g. b10-dhcp6
+# - BIN_PATH - Path to the Kea executable (excluding an executable name),
+# e.g. ../
# Begins a test by prining its name.
# It requires the ${TEST_NAME} variable to hold the test name.
export B10_LOGGER_DESTINATION=${LOG_FILE}
}
-# Returns the number of running b10-dhcp6 process pids and
-# the list of pids.
+# Returns the number of running process pids and the list of pids.
_GET_PIDS= # Return value: holds space separated list of DHCPv6 pids.
_GET_PIDS_NUM= # Return value: holds the number of DHCPv6 server pids.
get_pids() {
- _GET_PIDS=`ps axo pid,command | grep b10-dhcp6 | grep -v grep | awk '{print $1}'`
+ _GET_PIDS=`ps axo pid,command | grep ${BIN} | grep -v grep | awk '{print $1}'`
_GET_PIDS_NUM=`printf "%s" "${_GET_PIDS}" | wc -w | awk '{print $1}'`
}
# Starts Kea process in background using a configuration file specified
# in the global variable ${CFG_FILE}
start_kea() {
- printf "Running command %s.\n" "\"$BIN -c ${CFG_FILE}\""
- $BIN -c ${CFG_FILE} &
+ printf "Running command %s.\n" "\"${BIN_PATH}/${BIN} -c ${CFG_FILE}\""
+ ${BIN_PATH}/$BIN -c ${CFG_FILE} &
}
# Waits for Kea to startup with timeout.