From 1e0baf8ccbb1fe587a5864ef53e7513851a4113a Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Mon, 20 Jan 2020 12:19:21 +0100 Subject: [PATCH] fix testing with new glibc (#1792854) --- .gitignore | 2 +- chrony-packettest.patch | 25 +++++++++++++++++++++++++ chrony.spec | 5 ++++- sources | 2 +- 4 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 chrony-packettest.patch diff --git a/.gitignore b/.gitignore index dc37315..db535c0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ /chrony-3.5.tar.gz /chrony-3.5-tar-gz-asc.txt -/clknetsim-3f5ef9.tar.gz +/clknetsim-79ffe4.tar.gz diff --git a/chrony-packettest.patch b/chrony-packettest.patch new file mode 100644 index 0000000..ff1e207 --- /dev/null +++ b/chrony-packettest.patch @@ -0,0 +1,25 @@ +commit 62d6aed6a64b887c9e3b7f03d9e0db1deaa2696a +Author: Miroslav Lichvar +Date: Tue Jun 18 15:41:50 2019 +0200 + + test: update processing of packet log + + Two new fields have been added to the packet log, which broke some + of the simulation tests. + +diff --git a/test/simulation/test.common b/test/simulation/test.common +index 951a794b..8ed6ad9e 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 diff --git a/chrony.spec b/chrony.spec index 2154987..3ef0a2f 100644 --- a/chrony.spec +++ b/chrony.spec @@ -1,5 +1,5 @@ %global _hardened_build 1 -%global clknetsim_ver 3f5ef9 +%global clknetsim_ver 79ffe4 %bcond_without debug Name: chrony @@ -22,6 +22,8 @@ Source10: https://github.com/mlichvar/clknetsim/archive/%{clknetsim_ver}/c # add NTP servers from DHCP when starting service Patch2: chrony-service-helper.patch +# fix test suite to work with newer clknetsim +Patch3: chrony-packettest.patch BuildRequires: libcap-devel libedit-devel nettle-devel pps-tools-devel %ifarch %{ix86} x86_64 %{arm} aarch64 mipsel mips64el ppc64 ppc64le s390 s390x @@ -54,6 +56,7 @@ service to other computers in the network. %setup -q -n %{name}-%{version}%{?prerelease} -a 10 %{?gitpatch:%patch0 -p1} %patch2 -p1 -b .service-helper +%patch3 -p1 -b .packettest %{?gitpatch: echo %{version}-%{gitpatch} > version.txt} diff --git a/sources b/sources index 8257254..4cc2cf2 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ SHA512 (chrony-3.5.tar.gz) = c4f6376a44d71b6ac2b6d86e3d6fb4348642faeef7f3f3a4d6431627b5645efcc868b005cc398c8292bc3b63a1161fbd1a042c6ac2a0595843f908fe32eed90c SHA512 (chrony-3.5-tar-gz-asc.txt) = b66ccc22fb7ae2f0597b5e20705a71f0d7fabad396d6efc427f49247361a09e3b13e2af31460123451268268d663a181361769795758c4ee96ade2b24e31ba48 -SHA512 (clknetsim-3f5ef9.tar.gz) = 01eea027ec8289d1053236fcc9ee09a8411e5f68cb3279077e50d330169a1ba1284798a50786dbd94382444aeaa652e276b94668c7adf5be66e910f937a9e55d +SHA512 (clknetsim-79ffe4.tar.gz) = ae118c0e5fbb26d57489eba941b57593454bd41b714e305ed76f78b2eb469b59b6c14cd1781e8eda42895199294bb577ca3b6895a7d120d6b8dd6db4e08c1396