From e0e914eaf86e2d10454f7b9dae1295d3f3213a49 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 22 Oct 2021 09:39:55 +0200 Subject: [PATCH] test-networkd-address: fix clock type The clock to use internally is clock_boottime_or_monotonic(), but the test used CLOCK_MONOTONIC. After one system suspend the test thus likely starts to fail. --- src/network/test-networkd-address.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/test-networkd-address.c b/src/network/test-networkd-address.c index 564c76f848..46e8369abb 100644 --- a/src/network/test-networkd-address.c +++ b/src/network/test-networkd-address.c @@ -16,7 +16,7 @@ static void test_FORMAT_LIFETIME(void) { log_info("/* %s */", __func__); - now_usec = now(CLOCK_MONOTONIC); + now_usec = now(clock_boottime_or_monotonic()); test_FORMAT_LIFETIME_one(now_usec, "for 0"); test_FORMAT_LIFETIME_one(usec_add(now_usec, 2 * USEC_PER_SEC - 1), "for 1s"); @@ -25,7 +25,7 @@ static void test_FORMAT_LIFETIME(void) { } int main(int argc, char *argv[]) { - test_setup_logging(LOG_INFO); + test_setup_logging(LOG_DEBUG); test_FORMAT_LIFETIME();