]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
test: add 144-exp1 test
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 15 Nov 2021 09:11:03 +0000 (10:11 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 16 Nov 2021 09:36:26 +0000 (10:36 +0100)
test/simulation/144-exp1 [new file with mode: 0755]
test/simulation/test.common

diff --git a/test/simulation/144-exp1 b/test/simulation/144-exp1
new file mode 100755 (executable)
index 0000000..4a2042d
--- /dev/null
@@ -0,0 +1,55 @@
+#!/usr/bin/env bash
+
+. ./test.common
+
+test_start "experimental extension field"
+
+check_config_h 'FEAT_CMDMON 1' || test_skip
+
+primary_time_offset=0.1
+server_strata=4
+min_sync_time=2000
+max_sync_time=2300
+chronyc_conf="doffset 0.1"
+chronyc_options="-h /clknetsim/unix/1:1"
+chronyc_start=2000
+
+for options in "extfield F323" "xleave extfield F323"; do
+       client_server_options="minpoll 6 maxpoll 6 $options"
+       server_server_options="$client_server_options"
+
+       run_test || test_fail
+       check_chronyd_exit || test_fail
+       check_source_selection || test_fail
+       check_sync || test_fail
+done
+
+server_server_options=""
+server_strata=1
+clients=4
+peers=4
+max_sync_time=2400
+# chain of peers and one enabled chronyc
+base_delay=$(cat <<-EOF | tr -d '\n'
+  (+ 1e-4 -1
+     (equal 0.1 from (+ to 1))
+     (equal 0.1 from (+ to -1))
+     (equal 0.1 from 6)
+     (equal 0.1 to 6))
+EOF
+)
+
+for lpoll in 5 6 7; do
+       for options in "minsamples 16 extfield F323" "minsamples 16 xleave extfield F323"; do
+               client_lpeer_options="minpoll $lpoll maxpoll $lpoll $options"
+               client_rpeer_options="minpoll 6 maxpoll 6 $options"
+               client_server_options="$client_rpeer_options"
+
+               run_test || test_fail
+               check_chronyd_exit || test_fail
+               check_source_selection || test_fail
+               check_sync || test_fail
+       done
+done
+
+test_pass
index cb68020d40238f009fb6010483c02818150d80b9..70bbde142eebc7552b645a2fe6c51747506dadc1 100644 (file)
@@ -27,6 +27,7 @@ fi
 # Default test testings
 
 default_limit=10000
+default_primary_time_offset=0.0
 default_time_offset=1e-1
 default_freq_offset=1e-4
 default_base_delay=1e-4
@@ -472,7 +473,8 @@ run_test() {
                                step=$server_step
                                start=$server_start
                                freq=""
-                               [ $i -le $falsetickers ] && offset=$i.0 || offset=0.0
+                               [ $i -le $falsetickers ] &&
+                                       offset=$i.0 || offset=$primary_time_offset
                                options=$server_chronyd_options
                        elif [ $stratum -le $server_strata ]; then
                                step=$server_step