]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
test: add 142-ptpport test
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 18 Aug 2021 10:57:40 +0000 (12:57 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 19 Aug 2021 12:51:42 +0000 (14:51 +0200)
test/simulation/142-ptpport [new file with mode: 0755]

diff --git a/test/simulation/142-ptpport b/test/simulation/142-ptpport
new file mode 100755 (executable)
index 0000000..060932c
--- /dev/null
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+
+. ./test.common
+
+test_start "PTP port"
+
+# Block communication between 3 and 1
+base_delay="(+ 1e-4 (* -1 (equal 0.1 from 3) (equal 0.1 to 1)))"
+
+cat > tmp/peer.keys <<-EOF
+1 MD5 1234567890
+EOF
+
+clients=2
+peers=2
+max_sync_time=420
+
+server_conf="
+ptpport 319"
+client_conf="
+ptpport 319
+authselectmode ignore
+keyfile tmp/peer.keys"
+client_server_options="minpoll 6 maxpoll 6 port 319"
+client_peer_options="minpoll 6 maxpoll 6 port 319 key 1"
+
+run_test || test_fail
+check_chronyd_exit || test_fail
+check_source_selection || test_fail
+check_sync || test_fail
+
+check_file_messages "  2       1       .*      319     319     1       96      " 150 160 \
+       log.packets || test_fail
+check_file_messages "  1       2       .*      319     319     1       96      " 150 160 \
+       log.packets || test_fail
+check_file_messages "  2       3       .*      319     319     1       116     " 150 160 \
+       log.packets || test_fail
+check_file_messages "  3       2       .*      319     319     1       116     " 150 160 \
+       log.packets || test_fail
+
+test_pass