Bug#1068665: cfengine3: FTBFS on arm{el,hf}: 1 of 60 tests failed

2024-05-04 Thread Andreas Beckmann
Followup-For: Bug #1068665
Control: tag -1 pending

Hi,

in order to make progress with the t64 transition, I've uploaded
Emanuele's patch as a NMU to DELAYED/2. Please let me know if I should
delay it longer.


Andreas



Bug#1068665: cfengine3: FTBFS on arm{el,hf}: 1 of 60 tests failed

2024-04-18 Thread Emanuele Rocca
Control: tags -1 + patch

Hi,

On 2024-04-08 11:17, Sebastian Ramacher wrote:
> 1 != 3
> ERROR: connection_management_test.c:39 Failure!
> 1 != 2
> ERROR: connection_management_test.c:69 Failure!
> 1 != 2
> ERROR: connection_management_test.c:99 Failure!
> 1 != 2
> ERROR: connection_management_test.c:129 Failure!

Casting time_t to long long addresses the issue. Please consider
applying the attached patch, tested on both armhf and armel. 

  Emanuele
diff -Nru cfengine3-3.21.4/debian/changelog cfengine3-3.21.4/debian/changelog
--- cfengine3-3.21.4/debian/changelog	2024-03-12 12:14:12.0 +0100
+++ cfengine3-3.21.4/debian/changelog	2024-04-18 11:32:38.0 +0200
@@ -1,3 +1,10 @@
+cfengine3 (3.21.4-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * d/patches/time-t-long-long.patch: coerce time_t to long long (closes: #1068665)
+
+ -- Emanuele Rocca   Thu, 18 Apr 2024 11:32:38 +0200
+
 cfengine3 (3.21.4-1) unstable; urgency=medium
 
   * New upstream version 3.21.4
diff -Nru cfengine3-3.21.4/debian/patches/series cfengine3-3.21.4/debian/patches/series
--- cfengine3-3.21.4/debian/patches/series	2024-03-12 12:14:12.0 +0100
+++ cfengine3-3.21.4/debian/patches/series	2024-04-18 11:31:53.0 +0200
@@ -8,3 +8,4 @@
 openssl3.patch
 libxml2.patch
 cf3_path_root_prog.patch
+time-t-long-long.patch
diff -Nru cfengine3-3.21.4/debian/patches/time-t-long-long.patch cfengine3-3.21.4/debian/patches/time-t-long-long.patch
--- cfengine3-3.21.4/debian/patches/time-t-long-long.patch	1970-01-01 01:00:00.0 +0100
+++ cfengine3-3.21.4/debian/patches/time-t-long-long.patch	2024-04-18 11:32:12.0 +0200
@@ -0,0 +1,72 @@
+Index: cfengine3-3.21.4/tests/unit/connection_management_test.c
+===
+--- cfengine3-3.21.4.orig/tests/unit/connection_management_test.c
 cfengine3-3.21.4/tests/unit/connection_management_test.c
+@@ -23,13 +23,13 @@ static void test_purge_old_connections_n
+ Item *connections = NULL;
+ char time_str[64];
+ 
+-xsnprintf(time_str, sizeof(time_str), "%ld", time_now - CONNECTION_MAX_AGE_SECONDS);
++xsnprintf(time_str, sizeof(time_str), "%lld", (long long)time_now - CONNECTION_MAX_AGE_SECONDS);
+ PrependItem(, "123.123.123.3", time_str);
+ 
+-xsnprintf(time_str, sizeof(time_str), "%ld", time_now - CONNECTION_MAX_AGE_SECONDS + 1);
++xsnprintf(time_str, sizeof(time_str), "%lld", (long long)time_now - CONNECTION_MAX_AGE_SECONDS + 1);
+ PrependItem(, "123.123.123.2", time_str);
+ 
+-xsnprintf(time_str, sizeof(time_str), "%ld", time_now - CONNECTION_MAX_AGE_SECONDS + 100);
++xsnprintf(time_str, sizeof(time_str), "%lld", (long long)time_now - CONNECTION_MAX_AGE_SECONDS + 100);
+ PrependItem(, "123.123.123.1", time_str);
+ 
+ assert_int_equal(ListLen(connections), 3);
+@@ -53,13 +53,13 @@ static void test_purge_old_connections_p
+ Item *connections = NULL;
+ char time_str[64];
+ 
+-xsnprintf(time_str, sizeof(time_str), "%ld", time_now - CONNECTION_MAX_AGE_SECONDS + 100);
++xsnprintf(time_str, sizeof(time_str), "%lld", (long long)time_now - CONNECTION_MAX_AGE_SECONDS + 100);
+ PrependItem(, "123.123.123.3", time_str);
+ 
+-xsnprintf(time_str, sizeof(time_str), "%ld", time_now - CONNECTION_MAX_AGE_SECONDS + 2);
++xsnprintf(time_str, sizeof(time_str), "%lld", (long long)time_now - CONNECTION_MAX_AGE_SECONDS + 2);
+ PrependItem(, "123.123.123.2", time_str);
+ 
+-xsnprintf(time_str, sizeof(time_str), "%ld", time_now - CONNECTION_MAX_AGE_SECONDS - 5);
++xsnprintf(time_str, sizeof(time_str), "%lld", (long long)time_now - CONNECTION_MAX_AGE_SECONDS - 5);
+ PrependItem(, "123.123.123.1", time_str);
+ 
+ assert_int_equal(ListLen(connections), 3);
+@@ -83,13 +83,13 @@ static void test_purge_old_connections_p
+ Item *connections = NULL;
+ char time_str[64];
+ 
+-xsnprintf(time_str, sizeof(time_str), "%ld", time_now - CONNECTION_MAX_AGE_SECONDS);
++xsnprintf(time_str, sizeof(time_str), "%lld", (long long)time_now - CONNECTION_MAX_AGE_SECONDS);
+ PrependItem(, "123.123.123.3", time_str);
+ 
+-xsnprintf(time_str, sizeof(time_str), "%ld", time_now - CONNECTION_MAX_AGE_SECONDS - 1);
++xsnprintf(time_str, sizeof(time_str), "%lld", (long long)time_now - CONNECTION_MAX_AGE_SECONDS - 1);
+ PrependItem(, "123.123.123.2", time_str);
+ 
+-xsnprintf(time_str, sizeof(time_str), "%ld", time_now - CONNECTION_MAX_AGE_SECONDS + 100);
++xsnprintf(time_str, sizeof(time_str), "%lld", (long long)time_now - CONNECTION_MAX_AGE_SECONDS + 100);
+ PrependItem(, "123.123.123.1", time_str);
+ 
+ assert_int_equal(ListLen(connections), 3);
+@@ -113,13 +113,13 @@ static void test_purge_old_connections_p
+ Item *connections = NULL;
+ char time_str[64];
+ 
+-xsnprintf(time_str, sizeof(time_str), "%ld", time_now - CONNECTION_MAX_AGE_SECONDS - 100);
++xsnprintf(time_str, sizeof(time_str), "%lld", 

Bug#1068665: cfengine3: FTBFS on arm{el,hf}: 1 of 60 tests failed

2024-04-08 Thread Sebastian Ramacher
Source: cfengine3
Version: 3.21.4-1
Severity: serious
Tags: ftbfs
Justification: fails to build from source (but built successfully in the past)
X-Debbugs-Cc: sramac...@debian.org

https://buildd.debian.org/status/fetch.php?pkg=cfengine3=armel=3.21.4-1=1712477798=0

==
Starting test: files_interfaces_test.c
==
test_cfreadline_valid: Starting test
test_cfreadline_valid: Test completed successfully.
test_cfreadline_corrupted: Starting test
test_cfreadline_corrupted: Test completed successfully.
All 2 tests passed
PASS: files_interfaces_test
1 != 3
ERROR: connection_management_test.c:39 Failure!
1 != 2
ERROR: connection_management_test.c:69 Failure!
1 != 2
ERROR: connection_management_test.c:99 Failure!
1 != 2
ERROR: connection_management_test.c:129 Failure!
4 out of 4 tests failed!
test_purge_old_connections_nochange
test_purge_old_connections_purge_first
test_purge_old_connections_purge_middle
test_purge_old_connections_purge_last
==
Starting test: connection_management_test.c
==
test_purge_old_connections_nochange: Starting test
test_purge_old_connections_nochange: Test failed.
test_purge_old_connections_purge_first: Starting test
test_purge_old_connections_purge_first: Test failed.
test_purge_old_connections_purge_middle: Starting test
test_purge_old_connections_purge_middle: Test failed.
test_purge_old_connections_purge_last: Starting test
test_purge_old_connections_purge_last: Test failed.
FAIL: connection_management_test

Cheers
-- 
Sebastian Ramacher