From 53582d1cb6bc16e7c5499baf4403195cb4290257 Mon Sep 17 00:00:00 2001 From: Jakub Heger Date: Apr 26 2022 07:44:18 +0000 Subject: mysql/basic: ake sure mysql-server is installed --- diff --git a/mysql/basic/lib.sh b/mysql/basic/lib.sh index 4b99598..01397e2 100755 --- a/mysql/basic/lib.sh +++ b/mysql/basic/lib.sh @@ -502,6 +502,12 @@ mysqlLibraryLoaded() { # recognize parameter to set collection via tcms case RUN_ON_DB=${RUN_ON_DB:-"$COLLECTIONS"} + if ( [ -z "$RUN_ON_DB" ] || echo $RUN_ON_DB | grep -q '^mysql' ) && ! rpm -q mysql-server ; then + rlLog "MySQL is not installed. Install it." + [ -d /var/lib/mysql ] && rlRun "rm -rf /var/lib/mysql" + rlRun "yum install -y --disablerepo=beaker-tasks --allowerasing mysql mysql-server" + fi + # Set variables according to collection # FIXME: this must handle selection from multiple matches in the future # (or the scheduling tools must ensure only one match) @@ -579,7 +585,7 @@ mysqlLibraryLoaded() { mysqlPkgPrefix="" mysqlRootDir="" mysqlServiceName="mysqld" - if rlIsRHEL 8 ; then + if rlIsRHEL '>=8' ; then mysqlLogDir="/var/log/mysql" mysqlCnfDir="/etc" mysqlCnfIncDir="${mysqlCnfDir}/my.cnf.d" @@ -647,6 +653,7 @@ true <<'=cut' Branislav Blaskovic Karel Volny +Jakub Heger =back