tests/db_upgrade: disable for old sqlite versions

Skip the test if the installed sqlite version is older than 3.16.2
(current version of debian 9). This prevents test failures caused by
the way we dump tables in the test, which does not work with older
versions.

This patch is a middle ground between reverting the db upgrade patch,
and spending lots of time to replace the table dumping code with
something that works with old sqlite versions to fix current build
failures in OBS.

Usually version checking is done in configure.ac, however I could not
find a good way to pass the result to testsuite.at. So I decided to
use pkg-config to do the test there.

Fixes: 5b65461d686327ead0cb2a6d8493dfa9173d376c ("add db_upgrade test")
Related: https://lists.osmocom.org/pipermail/openbsc/2019-November/013063.html
Change-Id: I348c133003a95badbd6807d1519aa669115872fb
diff --git a/tests/testsuite.at b/tests/testsuite.at
index a8efe42..bd758c9 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -37,7 +37,10 @@
 AT_CHECK([$abs_top_builddir/tests/db/db_test], [], [expout], [experr])
 AT_CLEANUP
 
+# AT_SKIP_IF: disable for old sqlite versions, because the way we dump tables in the test doesn't work with it.
+# https://lists.osmocom.org/pipermail/openbsc/2019-November/013063.html
 AT_SETUP([db_upgrade])
+AT_SKIP_IF([ ! pkg-config sqlite3 --exists --atleast-version=3.16.2 ])
 AT_KEYWORDS([db_upgrade])
 cat $abs_srcdir/db_upgrade/db_upgrade_test.ok > expout
 cat $abs_srcdir/db_upgrade/db_upgrade_test.err > experr