From: Michal Hrusecky Date: Thu, 1 Oct 2020 06:53:57 +0000 (+0200) Subject: mariadb: Add basic test X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=aa62c4c157495fcc01dd478e3df6da98060731c5;p=feed%2Fpackages.git mariadb: Add basic test Add simple to test to try to run MariaDB and get the version. Signed-off-by: Michal Hrusecky --- diff --git a/utils/mariadb/test.sh b/utils/mariadb/test.sh new file mode 100755 index 0000000000..cb33bbae05 --- /dev/null +++ b/utils/mariadb/test.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# shellcheck disable=SC1090 +. "$CI_HELPER" + +check_version() { + bin="$1" + ver="$2" + com="$3" + + if [ -x "$bin" ]; then + if "$bin" --version | grep " $ver-MariaDB"; then + success "MariaDB $com is in version $2" + else + err_die "MariaDB $com seems to be in wrong version" + fi + else + err_die "Can't find $com server binary" + fi +} + +case "$PKG_NAME" in + mariadb-server) check_version /usr/bin/mysqld "$PKG_VERSION" "server" ;; + mariadb-client) check_version /usr/bin/mysql "$PKG_VERSION" "client";; + *) info "Skipping $PKG_NAME" ;; +esac