aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2019-06-03 09:29:55 +0200
committerOliver Smith <osmith@sysmocom.de>2019-06-03 11:35:45 +0200
commit1a1398ed54038ab0be3d1154260119836b7c2980 (patch)
treecbf48cd78144187acb1c34453f99fdf015d1354b
parenta8253a54bab70c2414a674f5e924de17aa586301 (diff)
db_test: set timezone to work around mktime bug
Apply workaround for db_test failure on ubuntu 19.04 in OBS. When the timezone is set to UTC (default in OBS), and the glibc version is 2.29, the test case is failing sometimes (not always) with the following errors in the test log: DAUC Cannot convert LU timestamp '2019-05-26 03:05:03' to time_t: Value too large for defined Force the timezone to be CET when running the test, so it passes again. I found this workaround in a Fedora bugreport [1], and tested with an ubuntu 19.04 system running in docker, that setting the environment variable like this makes the test pass 25 times in a row. Without it, it fails every two or three times. Then I verified in my OBS namespace, that the test also passes in OBS again. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1653340 Related: OS#4026 Change-Id: Ic8080ba1914bb364169ab0c563b132a4ab9a9aab
-rw-r--r--tests/testsuite.at4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 70ae7ae..7d268d1 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -29,10 +29,12 @@ cat $abs_srcdir/gsup_server/gsup_server_test.err > experr
AT_CHECK([$abs_top_builddir/tests/gsup_server/gsup_server_test], [], [expout], [experr])
AT_CLEANUP
+# TZ=CET: workaround for glibc bug in mktime() (https://osmocom.org/issues/4026):
+# "Cannot convert LU timestamp '2019-05-26 03:05:03' to time_t: Value too large for defined data type"
AT_SETUP([db])
AT_KEYWORDS([db])
cat $abs_srcdir/db/db_test.ok > expout
cat $abs_srcdir/db/db_test.err > experr
sqlite3 db_test.db < $abs_top_srcdir/sql/hlr.sql
-AT_CHECK([$abs_top_builddir/tests/db/db_test], [], [expout], [experr])
+AT_CHECK([TZ=CET $abs_top_builddir/tests/db/db_test], [], [expout], [experr])
AT_CLEANUP