From 6a974723f35f37c6238b95f0cef1fbd7bbddd9c4 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 8 Aug 2025 12:36:10 +0200 Subject: [PATCH] route/tests: relax check for nh timers Kernel stores the timer values internally in HZ size, so it looses precision when converting to HZ and back. And as the HZ value is configurable, it depends on the kernel, how exactly the values get mangled. Relax the check for that. Fixes: 996f617011ad ('[tests] Add full kernel-roundtrip test-suite for rtnl_nh') https://github.com/thom311/libnl/issues/444 --- tests/cksuite-route-nh.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/cksuite-route-nh.c b/tests/cksuite-route-nh.c index bd0a1953f..f011c3b27 100644 --- a/tests/cksuite-route-nh.c +++ b/tests/cksuite-route-nh.c @@ -378,11 +378,13 @@ START_TEST(test_kernel_roundtrip_group_resilient) tmp32 = 0; ck_assert_int_eq(rtnl_nh_get_res_group_idle_timer(grp_kernel, &tmp32), 0); - ck_assert_uint_eq(tmp32, 15U); + ck_assert_uint_ge(tmp32, 12U); + ck_assert_uint_le(tmp32, 15U); tmp32 = 0; ck_assert_int_eq( rtnl_nh_get_res_group_unbalanced_timer(grp_kernel, &tmp32), 0); - ck_assert_uint_eq(tmp32, 25U); + ck_assert_uint_ge(tmp32, 24U); + ck_assert_uint_le(tmp32, 25U); } END_TEST