Fix tests
adjust for rhel8, use lmdb instead of has on rhel9 and higher
This commit is contained in:
parent
7172aeddc1
commit
cbc1d76f3c
4 changed files with 57 additions and 25 deletions
|
|
@ -34,6 +34,14 @@ rlJournalStart
|
|||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
|
||||
if rlIsRHELLike '>=9' || rlIsFedora; then
|
||||
storagePrefix='lmdb'
|
||||
storagePostfix='lmdb'
|
||||
else
|
||||
storagePrefix='hash'
|
||||
storagePostfix='db'
|
||||
fi
|
||||
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "pushd $TmpDir"
|
||||
|
||||
|
|
@ -60,8 +68,8 @@ rlJournalStart
|
|||
cat << "EOF" > "/etc/postfix/main.cf"
|
||||
myhostname = randomstuff.at
|
||||
|
||||
alias_maps = lmdb:/etc/aliases
|
||||
alias_database = lmdb:/etc/aliases
|
||||
alias_maps = $storagePrefix:/etc/aliases
|
||||
alias_database = $storagePrefix:/etc/aliases
|
||||
|
||||
myorigin = /etc/mailname
|
||||
mydestination = localhost.randomstuff.at, localhost
|
||||
|
|
@ -76,14 +84,16 @@ smtpd_relay_restrictions = reject_unauth_destination
|
|||
|
||||
virtual_mailbox_domains = example.com
|
||||
virtual_mailbox_base = /var/mail/vhosts
|
||||
virtual_mailbox_maps = lmdb:/etc/postfix/vmailbox
|
||||
virtual_mailbox_maps = $storagePrefix:/etc/postfix/vmailbox
|
||||
virtual_minimum_uid = 100
|
||||
virtual_uid_maps = static:5000
|
||||
virtual_gid_maps = static:5000
|
||||
virtual_alias_maps = lmdb:/etc/postfix/virtual
|
||||
virtual_alias_maps = $storagePrefix:/etc/postfix/virtual
|
||||
|
||||
body_checks = regexp:/etc/postfix/body_checks
|
||||
EOF
|
||||
|
||||
rlRun 'sed -i "s/\$storagePrefix/${storagePrefix}/g" /etc/postfix/main.cf'
|
||||
|
||||
cat << "EOF" > "/etc/postfix/vmailbox"
|
||||
info@example.com example.com/info
|
||||
|
|
@ -98,8 +108,8 @@ EOF
|
|||
/Aliens/ REJECT
|
||||
EOF
|
||||
|
||||
rlRun "postmap lmdb:/etc/postfix/virtual"
|
||||
rlRun "postmap lmdb:/etc/postfix/vmailbox"
|
||||
rlRun "postmap $storagePrefix:/etc/postfix/virtual"
|
||||
rlRun "postmap $storagePrefix:/etc/postfix/vmailbox"
|
||||
|
||||
rlServiceStart "postfix"
|
||||
rlPhaseEnd
|
||||
|
|
@ -126,8 +136,8 @@ EOF
|
|||
|
||||
rlServiceStop "postfix"
|
||||
|
||||
rlRun "rm -rf /etc/postfix/vmailbox.lmdb"
|
||||
rlRun "rm -rf /etc/postfix/virtual.lmdb"
|
||||
rlRun "rm -rf /etc/postfix/vmailbox.$storagePostfix"
|
||||
rlRun "rm -rf /etc/postfix/virtual.$storagePostfix"
|
||||
rlRun "rm -rf /etc/postfix/body_checks"
|
||||
|
||||
rlFileRestore
|
||||
|
|
|
|||
|
|
@ -33,6 +33,15 @@ PACKAGE="postfix"
|
|||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
|
||||
if rlIsRHELLike '>=9' || rlIsFedora; then
|
||||
storagePrefix='lmdb'
|
||||
storagePostfix='lmdb'
|
||||
else
|
||||
storagePrefix='hash'
|
||||
storagePostfix='db'
|
||||
fi
|
||||
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "pushd $TmpDir"
|
||||
|
||||
|
|
@ -59,8 +68,8 @@ rlJournalStart
|
|||
cat << "EOF" > "/etc/postfix/main.cf"
|
||||
myhostname = randomstuff.at
|
||||
|
||||
alias_maps = lmdb:/etc/aliases
|
||||
alias_database = lmdb:/etc/aliases
|
||||
alias_maps = $storagePrefix:/etc/aliases
|
||||
alias_database = $storagePrefix:/etc/aliases
|
||||
|
||||
myorigin = /etc/mailname
|
||||
mydestination = localhost.randomstuff.at, localhost
|
||||
|
|
@ -75,15 +84,17 @@ smtpd_relay_restrictions = reject_unauth_destination
|
|||
|
||||
virtual_mailbox_domains = example.com
|
||||
virtual_mailbox_base = /var/mail/vhosts
|
||||
virtual_mailbox_maps = lmdb:/etc/postfix/vmailbox
|
||||
virtual_mailbox_maps = $storagePrefix:/etc/postfix/vmailbox
|
||||
virtual_minimum_uid = 100
|
||||
virtual_uid_maps = static:5000
|
||||
virtual_gid_maps = static:5000
|
||||
virtual_alias_maps = lmdb:/etc/postfix/virtual
|
||||
virtual_alias_maps = $storagePrefix:/etc/postfix/virtual
|
||||
|
||||
header_checks = regexp:/etc/postfix/header_checks
|
||||
EOF
|
||||
|
||||
rlRun 'sed -i "s/\$storagePrefix/${storagePrefix}/g" /etc/postfix/main.cf'
|
||||
|
||||
cat << "EOF" > "/etc/postfix/vmailbox"
|
||||
info@example.com example.com/info
|
||||
sales@example.com example.com/sales/
|
||||
|
|
@ -97,8 +108,8 @@ EOF
|
|||
/^From.*alien\.xt/ REJECT Sorry, no aliens welcome!
|
||||
EOF
|
||||
|
||||
rlRun "postmap lmdb:/etc/postfix/virtual"
|
||||
rlRun "postmap lmdb:/etc/postfix/vmailbox"
|
||||
rlRun "postmap $storagePrefix:/etc/postfix/virtual"
|
||||
rlRun "postmap $storagePrefix:/etc/postfix/vmailbox"
|
||||
|
||||
rlServiceStart "postfix"
|
||||
rlPhaseEnd
|
||||
|
|
@ -125,8 +136,8 @@ EOF
|
|||
rlRun "rm -rf /var/mail/vhosts"
|
||||
|
||||
rlServiceStop "postfix"
|
||||
rlRun "rm -rf /etc/postfix/vmailbox.lmdb"
|
||||
rlRun "rm -rf /etc/postfix/virtual.lmdb"
|
||||
rlRun "rm -rf /etc/postfix/vmailbox.$storagePostfix"
|
||||
rlRun "rm -rf /etc/postfix/virtual.$storagePostfix"
|
||||
rlRun "rm -rf /etc/postfix/header_checks"
|
||||
|
||||
rlFileRestore
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@ test: ./runtest.sh
|
|||
framework: beakerlib
|
||||
recommend:
|
||||
- postfix
|
||||
- postfix-lmdb
|
||||
- nc
|
||||
duration: 20m
|
||||
enabled: true
|
||||
tag:
|
||||
- Tier1
|
||||
- postfix::mailbox::virtual-domains
|
||||
tier: '1'
|
||||
adjust:
|
||||
- enabled: false
|
||||
|
|
|
|||
|
|
@ -33,6 +33,15 @@ PACKAGE="postfix"
|
|||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
|
||||
if rlIsRHELLike '>=9' || rlIsFedora; then
|
||||
storagePrefix='lmdb'
|
||||
storagePostfix='lmdb'
|
||||
else
|
||||
storagePrefix='hash'
|
||||
storagePostfix='db'
|
||||
fi
|
||||
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "pushd $TmpDir"
|
||||
|
||||
|
|
@ -52,8 +61,8 @@ rlJournalStart
|
|||
cat << "EOF" > "/etc/postfix/main.cf"
|
||||
myhostname = randomstuff.at
|
||||
|
||||
alias_maps = hash:/etc/aliases
|
||||
alias_database = hash:/etc/aliases
|
||||
alias_maps = $storagePrefix:/etc/aliases
|
||||
alias_database = $storagePrefix:/etc/aliases
|
||||
|
||||
myorigin = /etc/mailname
|
||||
mydestination = localhost.randomstuff.at, localhost
|
||||
|
|
@ -68,13 +77,15 @@ smtpd_relay_restrictions = reject_unauth_destination
|
|||
|
||||
virtual_mailbox_domains = example.com
|
||||
virtual_mailbox_base = /var/mail/vhosts
|
||||
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
|
||||
virtual_mailbox_maps = $storagePrefix:/etc/postfix/vmailbox
|
||||
virtual_minimum_uid = 100
|
||||
virtual_uid_maps = static:5000
|
||||
virtual_gid_maps = static:5000
|
||||
virtual_alias_maps = hash:/etc/postfix/virtual
|
||||
virtual_alias_maps = $storagePrefix:/etc/postfix/virtual
|
||||
EOF
|
||||
|
||||
rlRun 'sed -i "s/\$storagePrefix/${storagePrefix}/g" /etc/postfix/main.cf'
|
||||
|
||||
cat << "EOF" > "/etc/postfix/vmailbox"
|
||||
info@example.com example.com/info
|
||||
sales@example.com example.com/sales/
|
||||
|
|
@ -84,8 +95,8 @@ EOF
|
|||
postmaster@example.com postmaster
|
||||
EOF
|
||||
|
||||
rlRun "postmap /etc/postfix/virtual"
|
||||
rlRun "postmap /etc/postfix/vmailbox"
|
||||
rlRun "postmap $storagePrefix:/etc/postfix/virtual"
|
||||
rlRun "postmap $storagePrefix:/etc/postfix/vmailbox"
|
||||
|
||||
rlServiceStart "postfix"
|
||||
rlPhaseEnd
|
||||
|
|
@ -115,8 +126,8 @@ EOF
|
|||
|
||||
rlServiceStop "postfix"
|
||||
rlFileRestore
|
||||
rlRun "rm -rf /etc/postfix/vmailbox.db"
|
||||
rlRun "rm -rf /etc/postfix/virtual.db"
|
||||
rlRun "rm -rf /etc/postfix/vmailbox.$storagePostfix"
|
||||
rlRun "rm -rf /etc/postfix/virtual.$storagePostfix"
|
||||
rlServiceRestore "postfix"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue