test: add function for checking config.h in tests
This commit is contained in:
parent
31b1f2e8a1
commit
3e876d4218
5 changed files with 10 additions and 4 deletions
|
@ -16,7 +16,7 @@ check_packet_interval || test_fail
|
||||||
check_sync || test_fail
|
check_sync || test_fail
|
||||||
|
|
||||||
# The following tests need 64-bit time_t
|
# The following tests need 64-bit time_t
|
||||||
grep -q 'HAVE_LONG_TIME_T 1' ../../config.h || test_skip
|
check_config_h 'HAVE_LONG_TIME_T 1' || test_skip
|
||||||
|
|
||||||
for year in 1990 2090; do
|
for year in 1990 2090; do
|
||||||
export CLKNETSIM_START_DATE=$(date -d "Jan 1 00:00:00 UTC $year" +'%s')
|
export CLKNETSIM_START_DATE=$(date -d "Jan 1 00:00:00 UTC $year" +'%s')
|
||||||
|
|
|
@ -23,7 +23,7 @@ EOF
|
||||||
|
|
||||||
keys=4
|
keys=4
|
||||||
|
|
||||||
if grep -q 'FEAT_SECHASH 1' ../../config.h; then
|
if check_config_h 'FEAT_SECHASH 1'; then
|
||||||
hashes="MD5 SHA1 SHA256 SHA384 SHA512"
|
hashes="MD5 SHA1 SHA256 SHA384 SHA512"
|
||||||
else
|
else
|
||||||
hashes="MD5"
|
hashes="MD5"
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
test_start "cmdmon timestamps"
|
test_start "cmdmon timestamps"
|
||||||
|
|
||||||
# The following tests need 64-bit time_t
|
# The following tests need 64-bit time_t
|
||||||
grep -q 'HAVE_LONG_TIME_T 1' ../../config.h || test_skip
|
check_config_h 'HAVE_LONG_TIME_T 1' || test_skip
|
||||||
|
|
||||||
limit=2
|
limit=2
|
||||||
client_server_options="noselect"
|
client_server_options="noselect"
|
||||||
|
|
|
@ -20,7 +20,7 @@ check_chronyd_exit || test_fail
|
||||||
check_source_selection || test_fail
|
check_source_selection || test_fail
|
||||||
check_sync || test_fail
|
check_sync || test_fail
|
||||||
|
|
||||||
if grep -q 'FEAT_DEBUG 1' ../../config.h; then
|
if check_config_h 'FEAT_DEBUG 1'; then
|
||||||
check_log_messages "HW clock samples" 190 200 || test_fail
|
check_log_messages "HW clock samples" 190 200 || test_fail
|
||||||
check_log_messages "HW clock reset" 0 0 || test_fail
|
check_log_messages "HW clock reset" 0 0 || test_fail
|
||||||
check_log_messages "Received.*tss=1" 1 1 || test_fail
|
check_log_messages "Received.*tss=1" 1 1 || test_fail
|
||||||
|
|
|
@ -211,6 +211,12 @@ get_chronyd_conf() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check if chrony was built with specified option in config.h
|
||||||
|
check_config_h() {
|
||||||
|
local pattern=$1
|
||||||
|
grep -q "^#define $pattern" ../../config.h
|
||||||
|
}
|
||||||
|
|
||||||
# Check if the clock was well synchronized
|
# Check if the clock was well synchronized
|
||||||
check_sync() {
|
check_sync() {
|
||||||
local i sync_time max_time_error max_freq_error ret=0
|
local i sync_time max_time_error max_freq_error ret=0
|
||||||
|
|
Loading…
Reference in a new issue