diff --git a/tar-testsuite/Makefile b/tar-testsuite/Makefile index e8b8faf..6d40a43 100644 --- a/tar-testsuite/Makefile +++ b/tar-testsuite/Makefile @@ -52,9 +52,9 @@ $(METADATA): Makefile @echo "Path: $(TEST_DIR)" >> $(METADATA) @echo "Description: TAR testsuite" >> $(METADATA) @echo "Type: Regression" >> $(METADATA) - @echo "TestTime: 60m" >> $(METADATA) + @echo "TestTime: 120m" >> $(METADATA) @echo "RunFor: tar" >> $(METADATA) - @echo "Requires: tar texinfo libacl-devel rsh libselinux-devel rpm-build gcc wget" >> $(METADATA) + @echo "Requires: tar rpm-build gcc dnf-plugins-core yum-utils" >> $(METADATA) @echo "Priority: Normal" >> $(METADATA) @echo "License: GPLv2" >> $(METADATA) @echo "Confidential: no" >> $(METADATA) diff --git a/tar-testsuite/runtest.sh b/tar-testsuite/runtest.sh index 4bb1a4d..ca7fe5b 100755 --- a/tar-testsuite/runtest.sh +++ b/tar-testsuite/runtest.sh @@ -33,6 +33,20 @@ PACKAGE="tar" TESTUSER="tar-testsuite" +install_build_deps() +{ + if rlIsFedora || rlIsRHEL '>7'; then + rlIsRHEL 8 && additional_repo='--enablerepo rhel-buildroot' + rlRun "dnf -y $additional_repo builddep $*" + else + # WARNING: yum-builddep doesn't work on RHEL5 as we would expect from + # modern RHEL/Fedora distributions. Only "package names" are accepted, + # not SRPMs or SPEC files. On RHEL6 this seems to work fine with SRPMs + # only. + rlRun "yum-builddep -y $*" + fi +} + rlJournalStart rlPhaseStartSetup rlAssertRpm $PACKAGE @@ -40,6 +54,12 @@ rlJournalStart rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" rlRun "chmod -R 777 $TmpDir" rlRun "pushd $TmpDir" + if rlIsRHEL 5; then + fix_rpm='echo %_topdir $HOME > $HOME/.rpmmacros' + rlRun "su - $TESTUSER -c '$fix_rpm'" + # on RHEL5, this isn't create automatically for some reason + rlRun "su - $TESTUSER -c 'mkdir \$HOME/BUILD'" + fi rlPhaseEnd rlPhaseStartTest @@ -49,8 +69,9 @@ rlJournalStart VERSION=`ls -1 *.src.rpm | head -1 | sed 's/tar-\([0-9.]*\).*src.rpm/\1/'` RPM_NAME=`ls -1 *.src.rpm | head -1` RPM_FULL_NAME=`readlink -f $RPM_NAME` - SPECFILE=/home/$TESTUSER/rpmbuild/SPECS/tar.spec - BUILDDIR=/home/$TESTUSER/rpmbuild/BUILD/tar-$VERSION + TOPDIR=$(su - "$TESTUSER" -c 'rpm --eval %_topdir') + SPECFILE=$TOPDIR/SPECS/tar.spec + BUILDDIR=$TOPDIR/BUILD/tar-$VERSION rlRun "chmod -R 777 $TmpDir" @@ -63,14 +84,14 @@ rlJournalStart rlLog "Version: $VERSION" # Dependencies - rlRun "yum-builddep -y $SPECFILE" + install_build_deps tar # Building rlRun -s "su $TESTUSER -c \"rpmbuild -bc $SPECFILE\"" rlRun "mv $rlRun_LOG $TmpDir/rpmbuild.log" # Using system /bin/tar for testsuite - wrapper='export PATH=/usr/bin ; exec tar "$@"' + wrapper='export PATH=/bin ; exec tar "$@"' wrapper=`printf "%q" "$wrapper"` rlRun "echo $wrapper > $BUILDDIR/src/tar"