use the system patch to test the upstream test suites

This commit is contained in:
Than Ngo 2019-03-05 09:34:48 +01:00
parent 4e0d39725c
commit a061c1d58d
7 changed files with 34 additions and 31 deletions

View File

@ -1 +0,0 @@
WORKING ON: Please don't migrate to dist-git

View File

@ -1,3 +0,0 @@
#!/bin/bash
export TEST_DOCKER_EXTRA_ARGS="--security-opt seccomp:unconfined"
exec merge-standard-inventory "$@"

View File

@ -1,3 +0,0 @@
PURPOSE of /CoreOS/patch/Sanity/selftest
Description: Executes upstream test suite
Author: Miroslav Vadkerti <mvadkert@redhat.com>

View File

@ -1,14 +1,14 @@
---
# This first play always runs on the local staging system
# Run tests in all contexts
- hosts: localhost
tags:
- classic
roles:
- role: standard-test-beakerlib
tags:
- classic
tests:
- Cannot-handle-file-names-with-integrated-spaces
- Regression-wrong-name-used-when-adding-new-file
- selftest
- upstream-test-suite
required_packages:
- patch
- expect

View File

@ -1,12 +1,13 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /CoreOS/patch/Sanity/selftest
# Description: Executes upstream test suite
# Makefile of /CoreOS/patch/Sanity/upstream-test-suite
# Description: tests upstream test suite
# Author: Miroslav Vadkerti <mvadkert@redhat.com>
# Author: Than Ngo <than@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2010 Red Hat, Inc. All rights reserved.
# Copyright (c) 2019 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
@ -24,7 +25,7 @@
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/CoreOS/patch/Sanity/selftest
export TEST=/CoreOS/patch/Sanity/upstream-test-suite
export TESTVERSION=1.0
BUILT_FILES=
@ -59,6 +60,6 @@ $(METADATA): Makefile
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL3 -RHEL4 -RHELServer5 -RHELClient5" >> $(METADATA)
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -0,0 +1,7 @@
PURPOSE of /CoreOS/patch/Sanity/upstream-test-suite
Description: Tests upstream test suite
Author: Miroslav Vadkerti <mvadkert@redhat.com>
tests following scenarios:
* download source rpm and build
* use the system patch to run the upstream test suite

View File

@ -40,15 +40,17 @@ if [[ $TARGET != "" ]]; then TARGET="--target `uname -m`"; fi
TOPDIR=`mktemp -d`
SPEC="$TOPDIR/SPECS/$PACKAGE*.spec"
TESTDIR="$TOPDIR/BUILD/$UPSTREAMPKG/"
PATCH=/usr/bin/patch
rlJournalStart
rlPhaseStartSetup
for PKG in $PACKAGES; do
rlAssertRpm $PKG
done
rlPhaseEnd
rlPhaseStartSetup
for PKG in $PACKAGES; do
rlAssertRpm $PKG
done
rlPhaseEnd
rlPhaseStartTest
rlPhaseStartTest
rlAssertExists $PATCH
rlFetchSrcForInstalled $PACKAGE
rlRun "rpm -ivh --define '_topdir $TOPDIR' $PACKAGE*.src.rpm" 0 "Installing $PACKAGE src rpm"
echo "+ Building $PACKAGE (Log: $BUILDLOG)"
@ -60,16 +62,16 @@ rlJournalStart
rlRun "cd $TESTDIR"
rlRun "make check &> $TESTLOG"
cat $TESTLOG
if rlIsRHEL 6; then
rlAssertGrep 'All tests succeeded!' $TESTLOG
else
rlAssertNotGrep "FAILED" $TESTLOG
fi
rlPhaseEnd
if rlIsRHEL 6; then
rlAssertGrep 'All tests succeeded!' $TESTLOG
else
rlAssertNotGrep "^FAIL:" $TESTLOG
fi
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -rf $PACKAGE*.src.rpm" 0 "Removing source rpm"
rlPhaseEnd
rlPhaseEnd
rlJournalPrintText
rlJournalEnd