2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-29 13:07:50 +00:00

[5682] get-config unit-test rebuilds partially automated.

This commit is contained in:
Tomek Mrugalski 2018-07-25 23:25:43 +02:00
parent 7beba1dbbb
commit 9e14140b26
4 changed files with 38 additions and 0 deletions

View File

@ -392,6 +392,7 @@ configureDhcp4Server(Dhcpv4Srv& server, isc::data::ConstElementPtr config_set,
if (config_pair.first == "sanity-checks") {
SanityChecksParser parser;
parser.parse(*srv_cfg, config_pair.second);
continue;
}
if (config_pair.first == "expired-leases-processing") {

View File

@ -145,3 +145,21 @@ endif
noinst_EXTRA_DIST = configs-list.txt
noinst_PROGRAMS = $(TESTS)
# Use this target if you want to rebuild the get-config unit-tests.
#
# TODO: We could also automate the replacement step with some variation
# of this: https://stackoverflow.com/questions/6790631
rebuild-tests:
rm -f x u get_config_unittest.cc
cp -f get_config_unittest.cc.skel get_config_unittest.cc
$(MAKE) CXXFLAGS=-DEXTRACT_CONFIG V=1
./dhcp4_unittests --gtest_filter="Dhcp4Parser*" > /dev/null 2> x
echo "Please copy content of x file into EXTRACTED_CONFIGS in get_config_unittest.cc"
read -p "Press ENTER when ready"
$(MAKE) CXXFLAGS=-DGENERATE_ACTION V=1
./dhcp4_unittests --gtest_filter="Dhcp4GetConfig*" > /dev/null 2> u
echo "Please copy content of u file into UNPARSED_CONFIGS in get_config_unittest.cc"
read -p "Press ENTER when ready"
touch get_config_unittest.cc
$(MAKE)

View File

@ -506,6 +506,7 @@ configureDhcp6Server(Dhcpv6Srv& server, isc::data::ConstElementPtr config_set,
if (config_pair.first == "sanity-checks") {
SanityChecksParser parser;
parser.parse(*srv_config, config_pair.second);
continue;
}
if (config_pair.first == "expired-leases-processing") {

View File

@ -144,3 +144,21 @@ dhcp6_unittests_LDADD += $(BOOST_LIBS) $(GTEST_LDADD)
endif
noinst_PROGRAMS = $(TESTS)
# Use this target if you want to rebuild the get-config unit-tests.
#
# TODO: We could also automate the replacement step with some variation
# of this: https://stackoverflow.com/questions/6790631
rebuild-tests:
rm -f x u get_config_unittest.cc
cp -f get_config_unittest.cc.skel get_config_unittest.cc
$(MAKE) CXXFLAGS=-DEXTRACT_CONFIG V=1
./dhcp6_unittests --gtest_filter="Dhcp6Parser*" > /dev/null 2> x
echo "Please copy content of x file into EXTRACTED_CONFIGS in get_config_unittest.cc"
read -p "Press ENTER when ready"
$(MAKE) CXXFLAGS=-DGENERATE_ACTION V=1
./dhcp6_unittests --gtest_filter="Dhcp6GetConfig*" > /dev/null 2> u
echo "Please copy content of u file into UNPARSED_CONFIGS in get_config_unittest.cc"
read -p "Press ENTER when ready"
touch get_config_unittest.cc
$(MAKE)