mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-06 20:45:07 -05:00
Add simulation tests
Use clknetsim to run multiple chronyd instances with simulated clocks and network. It allows fast and reproducible testing, without real network. Included are several tests of performance in different clock/network conditions, chronyd options, NTP authentication, chronyc, and past bug fixes.
This commit is contained in:
33
test/simulation/108-peer
Executable file
33
test/simulation/108-peer
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
. test.common
|
||||
|
||||
test_start "NTP peers"
|
||||
|
||||
# Allow and drop packets to the server in 1000 second intervals, so only one
|
||||
# client has access to it and the other is forced to switch to the peer.
|
||||
base_delay=$(cat <<-EOF | tr -d '\n'
|
||||
(+ 1e-4
|
||||
(* -1
|
||||
(equal 0.1 from 2)
|
||||
(equal 0.1 to 1)
|
||||
(equal 0.1 (min (% time 2000) 1000) 1000))
|
||||
(* -1
|
||||
(equal 0.1 from 3)
|
||||
(equal 0.1 to 1)
|
||||
(equal 0.1 (max (% time 2000) 1000) 1000)))
|
||||
EOF
|
||||
)
|
||||
|
||||
clients=2
|
||||
peers=2
|
||||
max_sync_time=1000
|
||||
client_server_options="minpoll 6 maxpoll 6"
|
||||
client_peer_options="minpoll 6 maxpoll 6"
|
||||
|
||||
run_test || test_fail
|
||||
check_chronyd_exit || test_fail
|
||||
check_source_selection || test_fail
|
||||
check_sync || test_fail
|
||||
|
||||
test_pass
|
||||
Reference in New Issue
Block a user