diff --git a/Sanity/default-map-type/main.fmf b/Sanity/default-map-type/main.fmf new file mode 100644 index 0000000..4542eb3 --- /dev/null +++ b/Sanity/default-map-type/main.fmf @@ -0,0 +1,24 @@ +summary: Default map type +description: 'Tests default map type' +contact: FrantiĊĦek Hrdina +component: + - postfix +test: ./test.sh +framework: beakerlib +recommend: + - postfix + - postfix-lmdb +duration: 5m +enabled: true +tag: + - Tier1 +tier: '1' +link: + - verifies: https://issues.redhat.com/browse/RHEL-50557 +adjust: + - enabled: false + when: distro < rhel-8 + continue: false + - enabled: false + when: distro < centos-stream-8 + continue: false diff --git a/Sanity/default-map-type/test.sh b/Sanity/default-map-type/test.sh new file mode 100755 index 0000000..43ff1d5 --- /dev/null +++ b/Sanity/default-map-type/test.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm "postfix" + # postfix-lmdb presented on rhel9.3 and higher, but default only on rhel10/c10s and higher and fedora + (rlIsRHEL '>=9.3' || rlIsFedora || rlIsCentOS '>=9') && rlAssertRpm "postfix-lmdb" + rlFileBackup --clean /etc/postfix + rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory" + rlRun "pushd $tmp" + rlPhaseEnd + + rlPhaseStartTest + rlRun "echo \"test_key test_value\" > /etc/postfix/test" 0 "Creating config" + rlRun "postmap /etc/postfix/test &> postmap.log" 0 "Running postmap" + + if rlIsRHELLike '<10' || rlIsFedora; then + rlAssertExists "/etc/postfix/test.db" + else + rlAssertExists "/etc/postfix/test.lmdb" + fi + rlAssertNotGrep "postmap: fatal: unsupported map type: hash" postmap.log + rlPhaseEnd + + rlPhaseStartCleanup + rlFileRestore + rlRun "popd" + rlRun "rm -r $tmp" 0 "Remove tmp directory" + rlPhaseEnd +rlJournalEnd