fmt/tests/basic/test.sh
Akira TAGOH a78a50e5e1 Add gating.yaml and tmt test case
Resolves: RHELMISC-5979
2024-08-15 23:58:44 +09:00

25 lines
871 B
Bash
Executable File

#!/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
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
rlRun "pushd $tmp"
rlRun "set -o pipefail"
rlPhaseEnd
rlPhaseStartTest
BUILD_PATH=$(rpm -q --qf '%{NAME}-%{VERSION}' fmt)
echo $BUILD_PATH > output
rlAssertNotGrep "installed" output
rlRun "rpmbuild -bc --define \"_sourcedir $TMT_SOURCE_DIR\" --define \"_builddir $TMT_SOURCE_DIR/BUILD\" $TMT_SOURCE_DIR/fmt.spec" 0 "Build"
rlRun "ctest --test-dir $TMT_SOURCE_DIR/BUILD/$BUILD_PATH/redhat-linux-build --output-on-failure --force-new-ctest-process" 0 "Test"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $tmp" 0 "Remove tmp directory"
rlPhaseEnd
rlJournalEnd