From: Arran Cudbard-Bell Date: Wed, 28 Jan 2026 03:25:09 +0000 (-0800) Subject: Fix spurious failure in cipher tests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d70a4b853c814d4d79dcf81130453f7774281117;p=thirdparty%2Ffreeradius-server.git Fix spurious failure in cipher tests --- diff --git a/src/tests/modules/cipher/valid.unlang b/src/tests/modules/cipher/valid.unlang index a7a9ac70e4e..5d11c02d57b 100644 --- a/src/tests/modules/cipher/valid.unlang +++ b/src/tests/modules/cipher/valid.unlang @@ -1,11 +1,14 @@ date test_date1 date test_date2 +time_delta test_delta test_date1 := %cipher_rsa.certificate('notBefore') test_date2 := %cipher_rsa.certificate('notAfter') -# Check the cert validity period is 30 days -if !((test_date2 - test_date1) == ((time_delta) (86400 * 60))) { +test_delta = (test_date2 - test_date1) - (time_delta) (86400 * 60) + +# Check the cert validity period is 30 days. Add fudge factor for issuance occuring across a second boundary +if !((test_delta >= -1) && (test_delta <= 1)) { test_fail } else { test_pass