From 96c775e0f0e74c37f14ac0d9dc773187a14be682 Mon Sep 17 00:00:00 2001 From: Andrew Bower Date: Sun, 9 Feb 2025 15:46:02 +0000 Subject: [PATCH] test: schedule test logins on correct day As the current time is moving on throught the test, the calculation of "n days ago" ends up picking a time which is slightly more than "n days ago", so reduce n by one. This error was mostly neutralised by the rotation threshold throwing away microseconds, but with that fixed, the tests always fail unless this is also fixed. --- tests/tst-login-logout.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/tst-login-logout.c b/tests/tst-login-logout.c index 7a34c2b..fd8b21d 100644 --- a/tests/tst-login-logout.c +++ b/tests/tst-login-logout.c @@ -184,26 +184,26 @@ main(void) /* make sure there is no old stuff flying around. The backup file is not so important. */ remove (db_path); - if (test_args (db_path, "user1", "test-tty", "localhost", NULL, 4) != 0) + if (test_args (db_path, "user1", "test-tty", "localhost", NULL, 3) != 0) return 1; - if (test_args (db_path, "user2", NULL, NULL, NULL, 4) != 0) + if (test_args (db_path, "user2", NULL, NULL, NULL, 3) != 0) return 1; - if (test_args (db_path, "user3", NULL, NULL, NULL, 4) != 0) + if (test_args (db_path, "user3", NULL, NULL, NULL, 3) != 0) return 1; - if (test_args (db_path, "user4", "test-tty", NULL, NULL, 4) != 0) + if (test_args (db_path, "user4", "test-tty", NULL, NULL, 3) != 0) return 1; - if (test_args (db_path, "user5", NULL, "localhost", NULL, 4) != 0) + if (test_args (db_path, "user5", NULL, "localhost", NULL, 3) != 0) return 1; - if (test_args (db_path, "user1", "test-tty", "localhost", NULL, 3) != 0) + if (test_args (db_path, "user1", "test-tty", "localhost", NULL, 2) != 0) return 1; - if (test_args (db_path, "user2", NULL, NULL, NULL, 3) != 0) + if (test_args (db_path, "user2", NULL, NULL, NULL, 2) != 0) return 1; - if (test_args (db_path, "user3", NULL, NULL, NULL, 3) != 0) + if (test_args (db_path, "user3", NULL, NULL, NULL, 2) != 0) return 1; - if (test_args (db_path, "user4", "test-tty", NULL, NULL, 3) != 0) + if (test_args (db_path, "user4", "test-tty", NULL, NULL, 2) != 0) return 1; - if (test_args (db_path, "user5", NULL, "localhost", NULL, 3) != 0) + if (test_args (db_path, "user5", NULL, "localhost", NULL, 2) != 0) return 1; if (test_rotate (db_path, 3) != 0)