postfix/Regression/bz345851-Postfix-MySQL-Support/runtest.sh
Frantisek Hrdina b39584c583 Adding tests
/CoreOS/postfix/Sanity/SRV-lookup
/CoreOS/postfix/Sanity/basic
/CoreOS/postfix/Sanity/bz1057593-When-server-is-un-cleanly-shutdown-postfix-does
/CoreOS/postfix/Sanity/bz1888286-logging-to-file
/CoreOS/postfix/Sanity/pflogsumm-filter-not-work-with-underscore
/CoreOS/postfix/Sanity/postfix-master-pid-file
/CoreOS/postfix/Sanity/suppress-openssl-key-generation-output-when-installing
/CoreOS/postfix/Sanity/virtual-MAILBOX-separate-domains-non-UNIX-accounts
/CoreOS/postfix/Regression/bz251677-example-scripts-missing
/CoreOS/postfix/Regression/bz345851-Postfix-MySQL-Support
/CoreOS/postfix/Regression/bz502412-Postfix-MySQL-map-support
/CoreOS/postfix/Regression/bz574439-config-file-in-usr
/CoreOS/postfix/Regression/bz645348-Postfix-init-script-status-not-very-robust
/CoreOS/postfix/Regression/postfix-is-limited-to-using-security-protocols
/CoreOS/postfix/Regression/bz1905484-backport-TLS-1-3-support-to-postfix-3-3-1
/CoreOS/postfix/Regression/cleanup-crash-when-message-with-whitespaceonly-fullname
/CoreOS/postfix/Regression/postfix-doesn-t-support-LDAP-SASL
2023-05-23 13:50:01 +02:00

70 lines
2.9 KiB
Bash
Executable file

#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/postfix/Regression/bz345851-Postfix-MySQL-Support
# Description: Test for BZ#345851 (Postfix - MySQL Support)
# Author: Robin Hack <rhack@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="postfix"
SUB_PACKAGES="cdb mysql sqlite pgsql ldap pcre perl-scripts"
rlJournalStart
rlPhaseStartTest "Check presence of relevant [sub-]packages on the system"
rlAssertRpm $PACKAGE
if (rlIsRHEL '>=8' || rlIsCentOS '>=8'); then
# assert existence of all postfix sub-packages
for _sub in $SUB_PACKAGES; do
rlAssertRpm "postfix-$_sub"
done
fi
rlPhaseEnd
rlPhaseStartTest "perform some other simple tests"
rlRun "postconf -m | grep -q mysql" 0 "postconf: Checking if postfix is configured with mysql"
if (rlIsRHEL '<8' || rlIsCentOS '<8'); then
rlRun "rpm -qR postfix | grep -q mysql" 0 "rpm: Checking if postfix is configured with mysql"
rlRun "ldd `which postfix` | grep -q libmysqlclient" 0 "ldd: Checking if postfix is compiled with mysql"
else
rlRun "rpm -qR postfix-mysql | grep -q libmysqlclient" 0 "rpm: Checking if postfix is configured with mysql"
fi
rlPhaseEnd
rlPhaseStartTest "RHEL-8 specific tests: subpackages should be present in AppStream"
if (rlIsRHEL '>=8' || rlIsCentOS '>=8'); then
# check whether all postfix subpackages are provided by some main repo
for _sub in $SUB_PACKAGES; do
rlRun "dnf whatprovides postfix-${_sub}"
done
# check whether all postfix subpackages are docked in AppStream repo
for _sub in $SUB_PACKAGES; do
{ dnf whatprovides postfix-${_sub} | grep -qie '^Repo.*AppStream'; } || rlWarning "sub-package 'postfix-$_sub' should be in AppStream repository"
done
fi
rlPhaseEnd
rlJournalPrintText
rlJournalEnd