From 574c370852d1ab99c1e4d4fa6ac9cbac0da4317f Mon Sep 17 00:00:00 2001
From: Markus Frosch <markus.frosch@icinga.com>
Date: Fri, 26 Apr 2019 11:39:54 +0200
Subject: [PATCH] testing: Use meta package for MySQL by default

---
 testing/start_test.sh | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/testing/start_test.sh b/testing/start_test.sh
index c517eea..ba9ea3d 100755
--- a/testing/start_test.sh
+++ b/testing/start_test.sh
@@ -11,8 +11,16 @@ if [ -d archive ]; then
     sudo apt-get update
 fi
 
-sudo DEBIAN_FRONTEND=noninteractive apt-get install --allow-unauthenticated -y icinga2 icinga2-ido-mysql mysql-server
+sudo bash -xe <<ROOTSHELL
+    export DEBIAN_FRONTEND=noninteractive
 
-sudo icinga2 feature list
+    if ! apt-get install -y default-mysql-server; then
+        # Fallback to non-metapackage on older distributions
+        apt-get install -y mysql-server
+    fi
 
-sudo icinga2 daemon -C
+    apt-get install --allow-unauthenticated -y icinga2 icinga2-ido-mysql
+
+    icinga2 feature list
+    icinga2 daemon -C
+ROOTSHELL
-- 
GitLab