From: Miroslav Lichvar Date: Wed, 18 Aug 2021 10:57:40 +0000 (+0200) Subject: test: add 142-ptpport test X-Git-Tag: 4.2-pre1~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5ca98eaaa224c46a7079a2c71a1ce5b0e9c97b9;p=thirdparty%2Fchrony.git test: add 142-ptpport test --- diff --git a/test/simulation/142-ptpport b/test/simulation/142-ptpport new file mode 100755 index 00000000..060932cb --- /dev/null +++ b/test/simulation/142-ptpport @@ -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