"Fossies" - the Fresh Open Source Software Archive

Member "chrony-3.5/test/simulation/113-leapsecond" (10 May 2019, 1400 Bytes) of package /linux/misc/chrony-3.5.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "113-leapsecond": 3.4_vs_3.5.

    1 #!/bin/bash
    2 
    3 . ./test.common
    4 
    5 test_start "leap second"
    6 
    7 check_config_h 'FEAT_REFCLOCK 1' || test_skip
    8 
    9 export CLKNETSIM_START_DATE=$(TZ=UTC date -d 'Dec 30 2008 0:00:00' +'%s')
   10 
   11 leap=$[2 * 24 * 3600]
   12 limit=$[4 * 24 * 3600]
   13 client_start=$[2 * 3600]
   14 server_conf="refclock SHM 0 dpoll 10 poll 10
   15 leapsectz right/UTC"
   16 refclock_jitter=1e-9
   17 refclock_offset="(* -1.0 (equal 0.1 (max (sum 1.0) $leap) $leap))"
   18 
   19 for leapmode in system step slew; do
   20     client_conf="leapsecmode $leapmode"
   21     if [ $leapmode = slew ]; then
   22         max_sync_time=$[$leap + 12]
   23     else
   24         max_sync_time=$[$leap]
   25     fi
   26 
   27     run_test || test_fail
   28     check_chronyd_exit || test_fail
   29     check_source_selection || test_fail
   30     check_packet_interval || test_fail
   31     check_sync || test_fail
   32 done
   33 
   34 client_server_options="trust"
   35 client_conf="refclock SHM 0 dpoll 10 poll 10 delay 1e-3"
   36 
   37 run_test || test_fail
   38 check_chronyd_exit || test_fail
   39 check_source_selection || test_fail
   40 check_packet_interval || test_fail
   41 check_sync || test_fail
   42 
   43 client_server_options=""
   44 client_conf="leapsecmode system"
   45 min_sync_time=230000
   46 max_sync_time=240000
   47 
   48 for smoothmode in "" "leaponly"; do
   49     server_conf="refclock SHM 0 dpoll 10 poll 10
   50     leapsectz right/UTC
   51     leapsecmode slew
   52     smoothtime 400 0.001 $smoothmode"
   53 
   54     run_test || test_fail
   55     check_chronyd_exit || test_fail
   56     check_source_selection || test_fail
   57     check_packet_interval || test_fail
   58     check_sync || test_fail
   59 done
   60 
   61 test_pass