Skip to content

Commit 69231b6

Browse files
committed
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: 996f617 ('[tests] Add full kernel-roundtrip test-suite for rtnl_nh') #444 #445
1 parent 5eeee28 commit 69231b6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/cksuite-route-nh.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,13 @@ START_TEST(test_kernel_roundtrip_group_resilient)
378378
tmp32 = 0;
379379
ck_assert_int_eq(rtnl_nh_get_res_group_idle_timer(grp_kernel, &tmp32),
380380
0);
381-
ck_assert_uint_eq(tmp32, 15U);
381+
ck_assert_uint_ge(tmp32, 12U);
382+
ck_assert_uint_le(tmp32, 15U);
382383
tmp32 = 0;
383384
ck_assert_int_eq(
384385
rtnl_nh_get_res_group_unbalanced_timer(grp_kernel, &tmp32), 0);
385-
ck_assert_uint_eq(tmp32, 25U);
386+
ck_assert_uint_ge(tmp32, 24U);
387+
ck_assert_uint_le(tmp32, 25U);
386388
}
387389
END_TEST
388390

0 commit comments

Comments
 (0)