]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
test: add 120-selectoptions
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 7 Jan 2016 15:19:02 +0000 (16:19 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Fri, 8 Jan 2016 13:30:23 +0000 (14:30 +0100)
test/simulation/120-selectoptions [new file with mode: 0755]

diff --git a/test/simulation/120-selectoptions b/test/simulation/120-selectoptions
new file mode 100755 (executable)
index 0000000..694882e
--- /dev/null
@@ -0,0 +1,68 @@
+#!/bin/bash
+
+. test.common
+
+test_start "source selection options"
+
+servers=3
+falsetickers=2
+
+base_delay=0.6
+client_server_conf="
+server 192.168.123.1
+server 192.168.123.2
+server 192.168.123.3 trust"
+
+run_test || test_fail
+check_chronyd_exit || test_fail
+check_source_selection || test_fail
+check_packet_interval || test_fail
+check_sync || test_fail
+
+client_server_conf="
+server 192.168.123.1
+server 192.168.123.2
+server 192.168.123.3 prefer"
+
+run_test || test_fail
+check_chronyd_exit || test_fail
+check_source_selection || test_fail
+check_packet_interval || test_fail
+# This check is expected to fail
+check_sync && test_fail
+
+base_delay=1.1
+
+run_test || test_fail
+check_chronyd_exit || test_fail
+check_source_selection || test_fail
+check_packet_interval || test_fail
+check_sync || test_fail
+
+base_delay=$default_base_delay
+falsetickers=1
+
+client_server_conf="
+server 192.168.123.1
+server 192.168.123.2
+server 192.168.123.3 require"
+
+run_test || test_fail
+check_chronyd_exit || test_fail
+check_source_selection || test_fail
+check_packet_interval || test_fail
+check_sync || test_fail
+
+client_server_conf="
+server 192.168.123.1 require
+server 192.168.123.2
+server 192.168.123.3"
+
+run_test || test_fail
+check_chronyd_exit || test_fail
+check_packet_interval || test_fail
+# These checks are expected to fail
+check_source_selection && test_fail
+check_sync && test_fail
+
+test_pass