diff --git a/test/simulation/106-refclock b/test/simulation/106-refclock index 5c5794c..c4cec20 100755 --- a/test/simulation/106-refclock +++ b/test/simulation/106-refclock @@ -3,6 +3,10 @@ . ./test.common test_start "SHM refclock" +check_config_h 'FEAT_REFCLOCK 1' || test_skip +check_config_h 'FEAT_PHC 1' || test_skip +check_config_h 'FEAT_CMDMON 1' || test_skip + servers=0 limit=1000 refclock_jitter=$jitter diff --git a/test/simulation/107-allowdeny b/test/simulation/107-allowdeny index b11db32..3ab83ff 100755 --- a/test/simulation/107-allowdeny +++ b/test/simulation/107-allowdeny @@ -4,6 +4,8 @@ test_start "allow/deny directives" +check_config_h 'FEAT_CMDMON 1' || test_skip + limit=500 # Note that start_client in clknetsim.bash always adds allow to the config diff --git a/test/simulation/110-chronyc b/test/simulation/110-chronyc index 7fe5dcf..5736ae4 100755 --- a/test/simulation/110-chronyc +++ b/test/simulation/110-chronyc @@ -4,6 +4,9 @@ test_start "chronyc" +check_config_h 'FEAT_REFCLOCK 1' || test_skip +check_config_h 'FEAT_CMDMON 1' || test_skip + refclock_jitter=$jitter client_conf=" refclock SHM 0 noselect diff --git a/test/simulation/112-port b/test/simulation/112-port index e983757..a8efabd 100755 --- a/test/simulation/112-port +++ b/test/simulation/112-port @@ -4,6 +4,8 @@ test_start "port and acquisitionport directives" +check_config_h 'FEAT_CMDMON 1' || test_skip + run_test || test_fail check_chronyd_exit || test_fail check_source_selection || test_fail diff --git a/test/simulation/113-leapsecond b/test/simulation/113-leapsecond index 5b9758f..2fb81b8 100755 --- a/test/simulation/113-leapsecond +++ b/test/simulation/113-leapsecond @@ -1,8 +1,11 @@ #!/bin/bash . ./test.common + test_start "leap second" +check_config_h 'FEAT_REFCLOCK 1' || test_skip + export CLKNETSIM_START_DATE=$(TZ=UTC date -d 'Dec 30 2008 0:00:00' +'%s') leap=$[2 * 24 * 3600] diff --git a/test/simulation/115-cmdmontime b/test/simulation/115-cmdmontime index ada08da..732decd 100755 --- a/test/simulation/115-cmdmontime +++ b/test/simulation/115-cmdmontime @@ -6,6 +6,7 @@ test_start "cmdmon timestamps" # The following tests need 64-bit time_t check_config_h 'HAVE_LONG_TIME_T 1' || test_skip +check_config_h 'FEAT_CMDMON 1' || test_skip limit=2 client_server_options="noselect" diff --git a/test/simulation/119-smoothtime b/test/simulation/119-smoothtime index 6b4ae39..3f90715 100755 --- a/test/simulation/119-smoothtime +++ b/test/simulation/119-smoothtime @@ -1,8 +1,11 @@ #!/bin/bash . ./test.common + test_start "smoothtime option" +check_config_h 'FEAT_REFCLOCK 1' || test_skip + server_strata=2 server_conf="smoothtime 400 0.001" server_server_options="minpoll 8" diff --git a/test/simulation/121-orphan b/test/simulation/121-orphan index 1b47f76..bbebc9d 100755 --- a/test/simulation/121-orphan +++ b/test/simulation/121-orphan @@ -4,6 +4,8 @@ test_start "orphan option" +check_config_h 'FEAT_CMDMON 1' || test_skip + server_strata=3 server_conf="local stratum 5 orphan server 192.168.123.1 diff --git a/test/simulation/124-tai b/test/simulation/124-tai index b5be030..d41d29d 100755 --- a/test/simulation/124-tai +++ b/test/simulation/124-tai @@ -1,8 +1,11 @@ #!/bin/bash . ./test.common + test_start "tai option" +check_config_h 'FEAT_REFCLOCK 1' || test_skip + export CLKNETSIM_START_DATE=$(TZ=UTC date -d 'Dec 31 2008 23:50:00' +'%s') leap=$[10 * 60] diff --git a/test/simulation/128-nocontrol b/test/simulation/128-nocontrol index 0a98cd7..cca82f4 100755 --- a/test/simulation/128-nocontrol +++ b/test/simulation/128-nocontrol @@ -4,6 +4,8 @@ test_start "-x option" +check_config_h 'FEAT_CMDMON 1' || test_skip + wander=0.0 time_offset=0.0 freq_offset=0.0 diff --git a/test/simulation/133-hwtimestamp b/test/simulation/133-hwtimestamp index 4939f7d..113ea69 100755 --- a/test/simulation/133-hwtimestamp +++ b/test/simulation/133-hwtimestamp @@ -4,6 +4,8 @@ test_start "hwtimestamp directive" +check_config_h 'HAVE_LINUX_TIMESTAMPING 1' || test_skip + export CLKNETSIM_TIMESTAMPING=2 refclock_jitter=1e-8 diff --git a/test/simulation/134-log b/test/simulation/134-log index f5293c4..0a6ef76 100755 --- a/test/simulation/134-log +++ b/test/simulation/134-log @@ -1,8 +1,11 @@ #!/bin/bash . ./test.common + test_start "log directive" +check_config_h 'FEAT_PHC 1' || test_skip + refclock_jitter=$jitter client_server_options="maxpoll 6" client_conf="refclock PHC /dev/ptp0 dpoll 4 poll 6 noselect diff --git a/test/simulation/test.common b/test/simulation/test.common index 81e9ed6..951a794 100644 --- a/test/simulation/test.common +++ b/test/simulation/test.common @@ -84,6 +84,8 @@ done test_start() { rm -f tmp/* echo "Testing $@:" + + check_config_h 'FEAT_NTP 1' || test_skip } test_pass() { diff --git a/test/unit/ntp_core.c b/test/unit/ntp_core.c index 5e519e5..c977a78 100644 --- a/test/unit/ntp_core.c +++ b/test/unit/ntp_core.c @@ -28,6 +28,8 @@ #include #include "test.h" +#ifdef FEAT_NTP + static struct timespec current_time; static NTP_Receive_Buffer req_buffer, res_buffer; static int req_length, res_length; @@ -475,3 +477,11 @@ test_unit(void) CNF_Finalise(); HSH_Finalise(); } + +#else +void +test_unit(void) +{ + TEST_REQUIRE(0); +} +#endif diff --git a/test/unit/ntp_sources.c b/test/unit/ntp_sources.c index ea8f19c..f13852e 100644 --- a/test/unit/ntp_sources.c +++ b/test/unit/ntp_sources.c @@ -18,10 +18,14 @@ ********************************************************************** */ +#include +#include "test.h" + +#ifdef FEAT_NTP + #include #include #include -#include "test.h" void test_unit(void) @@ -98,3 +102,11 @@ test_unit(void) CNF_Finalise(); HSH_Finalise(); } + +#else +void +test_unit(void) +{ + TEST_REQUIRE(0); +} +#endif