]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
test: extend 139-nts test
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 9 Apr 2020 14:51:10 +0000 (16:51 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 9 Apr 2020 15:08:52 +0000 (17:08 +0200)
test/simulation/139-nts

index e538fb8656aeecc0bbba11afda3680abfed01b2b..3813b522886ba86d95dee2e1ae421d406a2a7968 100755 (executable)
@@ -30,6 +30,7 @@ ntsserverkey tmp/server.key
 ntsservercert tmp/server.crt
 ntsprocesses 0
 ntsrotate 64
+ntsdumpdir tmp
 "
 client_server_options="minpoll 6 maxpoll 6 nts"
 client_conf="
@@ -43,12 +44,15 @@ check_chronyd_exit || test_fail
 check_source_selection || test_fail
 check_sync || test_fail
 
-check_file_messages "20.*123\.1.* 111 111 1111" 90 93 measurements.log || test_fail
+check_file_messages "20.*123\.1.* 111 111 1111" 89 93 measurements.log || test_fail
 check_file_messages "20.*123\.1.* 111 001 0000" 30 32 measurements.log || test_fail
+check_file_messages "  2       1       .*      11443   " 200 240 log.packets || test_fail
+check_file_messages "." 6 6 ntskeys || test_fail
 rm -f tmp/measurements.log
 
 client_conf+="
-ntsrefresh 120"
+ntsrefresh 120
+ntsdumpdir tmp"
 
 run_test || test_fail
 check_chronyd_exit || test_fail
@@ -57,6 +61,29 @@ check_sync || test_fail
 
 check_file_messages "20.*123\.1.* 111 111 1111" 99 103 measurements.log || test_fail
 check_file_messages "20.*123\.1.* 111 001 0000" 0 0 measurements.log || test_fail
+check_file_messages "  2       1       .*      11443   " 350 390 log.packets || test_fail
+check_file_messages "." 6 6 ntskeys || test_fail
+check_file_messages "." 11 12 192.168.123.1.nts || test_fail
+rm -f tmp/measurements.log
+
+export CLKNETSIM_START_DATE=$(date -d 'Jan  1 00:00:00 UTC 2010 + 40000 sec' +'%s')
+
+server_conf+="
+ntsrotate 100000"
+client_conf+="
+ntsrefresh 39500"
+
+run_test || test_fail
+check_chronyd_exit || test_fail
+check_source_selection || test_fail
+check_sync || test_fail
+
+check_file_messages "20.*123\.1.* 111 111 1111" 150 160 measurements.log || test_fail
+check_file_messages "20.*123\.1.* 111 001 0000" 0 0 measurements.log || test_fail
+check_file_messages "  2       1       .*      11443   " 6 10 log.packets || test_fail
+check_file_messages "^9\.......e+03    2       1       .*      11443   " 6 10 log.packets || test_fail
+check_file_messages "." 6 6 ntskeys || test_fail
+check_file_messages "." 11 12 192.168.123.1.nts || test_fail
 rm -f tmp/measurements.log
 
 client_conf="
@@ -67,4 +94,7 @@ check_chronyd_exit || test_fail
 check_source_selection && test_fail
 check_sync && test_fail
 
+check_file_messages "  2       1       .*      123     " 0 0 log.packets || test_fail
+check_file_messages "  2       1       .*      11443   " 10 20 log.packets || test_fail
+
 test_pass