diff --git a/chrony-test-fix-util-unit-test-for-NTP-era-split.patch b/chrony-test-fix-util-unit-test-for-NTP-era-split.patch new file mode 100644 index 0000000..c1841ed --- /dev/null +++ b/chrony-test-fix-util-unit-test-for-NTP-era-split.patch @@ -0,0 +1,41 @@ +From 2d9eb5b6fa5225a7300c8eed95712969249900fb Mon Sep 17 00:00:00 2001 +From: Miroslav Lichvar +Date: Fri, 3 Jan 2020 11:25:55 +0100 +Subject: [PATCH] test: fix util unit test for NTP era split + +The current default NTP era split passed the Unix epoch (~50 years ago), +which means the epoch converted to an NTP timestamp and back ends up in +the next NTP era (year 2106). + +Fix the test to take into account the era split. +--- + test/unit/util.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/test/unit/util.c b/test/unit/util.c +index f4d9f33..af9e90c 100644 +--- a/test/unit/util.c ++++ b/test/unit/util.c +@@ -100,11 +100,19 @@ void test_unit(void) { + ntp_ts.hi = htonl(JAN_1970); + ntp_ts.lo = 0xffffffff; + UTI_Ntp64ToTimespec(&ntp_ts, &ts); ++#if defined(HAVE_LONG_TIME_T) && NTP_ERA_SPLIT > 0 ++ TEST_CHECK(ts.tv_sec == 0x100000000LL * (1 + (NTP_ERA_SPLIT - 1) / 0x100000000LL)); ++#else + TEST_CHECK(ts.tv_sec == 0); ++#endif + TEST_CHECK(ts.tv_nsec == 999999999); + + UTI_AddDoubleToTimespec(&ts, 1e-9, &ts); ++#if defined(HAVE_LONG_TIME_T) && NTP_ERA_SPLIT > 0 ++ TEST_CHECK(ts.tv_sec == 1 + 0x100000000LL * (1 + (NTP_ERA_SPLIT - 1) / 0x100000000LL)); ++#else + TEST_CHECK(ts.tv_sec == 1); ++#endif + TEST_CHECK(ts.tv_nsec == 0); + + ntp_fuzz.hi = 0; +-- +2.25.0 + diff --git a/chrony-test-update-processing-of-packet-log.patch b/chrony-test-update-processing-of-packet-log.patch new file mode 100644 index 0000000..d0d0a15 --- /dev/null +++ b/chrony-test-update-processing-of-packet-log.patch @@ -0,0 +1,30 @@ +From 62d6aed6a64b887c9e3b7f03d9e0db1deaa2696a Mon Sep 17 00:00:00 2001 +From: Miroslav Lichvar +Date: Tue, 18 Jun 2019 15:41:50 +0200 +Subject: [PATCH] test: update processing of packet log + +Two new fields have been added to the packet log, which broke some +of the simulation tests. +--- + test/simulation/test.common | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/test/simulation/test.common b/test/simulation/test.common +index 951a794..8ed6ad9 100644 +--- a/test/simulation/test.common ++++ b/test/simulation/test.common +@@ -391,9 +391,9 @@ check_packet_port() { + for i in $(seq 1 $(get_chronyd_nodes)); do + test_message 3 0 "node $i:" + +- grep -E -q " $port [0-9]+\$" tmp/log.packets && \ ++ grep -E -q "^([0-9e.+-]+ ){5}$port " tmp/log.packets && \ + ! grep -E "^[0-9e.+-]+ $i " tmp/log.packets | \ +- grep -E -q -v " $port [0-9]+\$" && \ ++ grep -E -q -v "^([0-9e.+-]+ ){5}$port " && \ + test_ok || test_bad + [ $? -eq 0 ] || ret=1 + done +-- +2.25.0 + diff --git a/chrony.changes b/chrony.changes index c3d292f..79891e6 100644 --- a/chrony.changes +++ b/chrony.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Thu Feb 13 12:45:44 UTC 2020 - Martin Liška + +- Add chrony-test-update-processing-of-packet-log.patch in order + to fix test-suite failure. + +------------------------------------------------------------------- +Wed Feb 12 09:24:24 UTC 2020 - Martin Liška + +- Update clknetsim to version 79ffe44 (fixes boo#1162964). +- Backport chrony-test-fix-util-unit-test-for-NTP-era-split.patch. + ------------------------------------------------------------------- Sat Oct 26 10:39:29 UTC 2019 - Arjen de Korte diff --git a/chrony.spec b/chrony.spec index 7570bfb..249af3a 100644 --- a/chrony.spec +++ b/chrony.spec @@ -1,7 +1,7 @@ # # spec file for package chrony # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ %define vendorzone opensuse. -%global clknetsim_ver 58c5e8b +%global clknetsim_ver 79ffe44 #Compat macro for new _fillupdir macro introduced in Nov 2017 %if ! %{defined _fillupdir} %define _fillupdir %{_localstatedir}/adm/fillup-templates @@ -46,6 +46,8 @@ Patch0: chrony-config.patch Patch1: chrony-service-helper.patch Patch2: chrony-logrotate.patch Patch3: chrony-service-ordering.patch +Patch4: chrony-test-fix-util-unit-test-for-NTP-era-split.patch +Patch5: chrony-test-update-processing-of-packet-log.patch BuildRequires: NetworkManager-devel BuildRequires: bison BuildRequires: gcc-c++ @@ -98,6 +100,8 @@ or a different computer. %patch1 -p1 %patch2 -p1 %patch3 +%patch4 -p1 +%patch5 -p1 # If this is an openSUSE build, use our vendor zone # (2.*pool.ntp.org names include IPv6 addresses). If not diff --git a/clknetsim-58c5e8b.tar.gz b/clknetsim-58c5e8b.tar.gz deleted file mode 100644 index d101e00..0000000 --- a/clknetsim-58c5e8b.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:63566698c2c4bf70abd999666a02d52d00a85e68990bbed0361ffc50c9edf945 -size 42424 diff --git a/clknetsim-79ffe44.tar.gz b/clknetsim-79ffe44.tar.gz new file mode 100644 index 0000000..b917249 --- /dev/null +++ b/clknetsim-79ffe44.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d60fb5d6a12dd12fafa07b86a0ed8eba2bf552987e960c6d468c4869199dd6a +size 45700