#4 Introduce CI gating with a simple test
Merged 3 years ago by codonell. Opened 3 years ago by vkadlcik.
Unknown source master  into  master

file added
+1
@@ -0,0 +1,1 @@

+ 1

file added
+13
@@ -0,0 +1,13 @@

+ --- !Policy

+ product_versions:

+   - fedora-*

+ decision_context: bodhi_update_push_stable

+ subject_type: koji_build

+ rules:

+   - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}

+ --- !Policy

+ product_versions:

+   - rhel-9

+ decision_context: osci_compose_gate

+ rules:

+   - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}

file added
+6
@@ -0,0 +1,6 @@

+ summary: CI Gating Plan

+ discover:

+     how: fmf

+     directory: tests

+ execute:

+     how: beakerlib

file added
+2
@@ -0,0 +1,2 @@

+ The test's Makefiles are not used in Fedora CI infrastructure.  But are kept here

+  for backward compatibility with traditional beakerlib test harness in RHEL.

@@ -0,0 +1,63 @@

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Makefile of /tools/ltrace/Sanity/broken-binary-handling

+ #   Description: Try to trace broken binary by ltrace

+ #   Author: Michal Nowak <mnowak@redhat.com>

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Copyright (c) 2011 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

+ #   and conditions of the GNU General Public License version 2.

+ #

+ #   This program is distributed in the hope that it will be

+ #   useful, but WITHOUT ANY WARRANTY; without even the implied

+ #   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR

+ #   PURPOSE. See the GNU General Public License for more details.

+ #

+ #   You should have received a copy of the GNU General Public

+ #   License along with this program; if not, write to the Free

+ #   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,

+ #   Boston, MA 02110-1301, USA.

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ 

+ export TEST=/tools/ltrace/Sanity/broken-binary-handling

+ export TESTVERSION=1.0

+ 

+ BUILT_FILES=

+ 

+ FILES=$(METADATA) runtest.sh Makefile PURPOSE broken.bin.gz

+ 

+ .PHONY: all install download clean

+ 

+ run: $(FILES) build

+ 	./runtest.sh

+ 

+ build: $(BUILT_FILES)

+ 	chmod a+x runtest.sh

+ 

+ clean:

+ 	rm -f *~ $(BUILT_FILES)

+ 

+ 

+ include /usr/share/rhts/lib/rhts-make.include

+ 

+ $(METADATA): Makefile

+ 	@echo "Owner:           Michal Nowak <mnowak@redhat.com>" > $(METADATA)

+ 	@echo "Name:            $(TEST)" >> $(METADATA)

+ 	@echo "TestVersion:     $(TESTVERSION)" >> $(METADATA)

+ 	@echo "Path:            $(TEST_DIR)" >> $(METADATA)

+ 	@echo "Description:     Try to trace broken binary by ltrace" >> $(METADATA)

+ 	@echo "Type:            Sanity" >> $(METADATA)

+ 	@echo "TestTime:        5m" >> $(METADATA)

+ 	@echo "RunFor:          ltrace" >> $(METADATA)

+ 	@echo "Requires:        ltrace gzip" >> $(METADATA)

+ 	@echo "Priority:        Normal" >> $(METADATA)

+ 	@echo "License:         GPLv2" >> $(METADATA)

+ 	@echo "Confidential:    yes" >> $(METADATA)

+ 	@echo "Destructive:     no" >> $(METADATA)

+ 

+ 	rhts-lint $(METADATA)

@@ -0,0 +1,3 @@

+ PURPOSE of /tools/ltrace/Sanity/broken-binary-handling

+ Description: Try to trace broken binary by ltrace

+ Author: Michal Nowak <mnowak@redhat.com>

empty or binary file added
@@ -0,0 +1,14 @@

+ summary: Try to trace broken binary by ltrace

+ description: ''

+ contact:

+ - Vaclav Kadlcik <vkadlcik@redhat.com>

+ component:

+ - ltrace

+ test: ./runtest.sh

+ framework: beakerlib

+ recommend:

+ - ltrace

+ - gzip

+ duration: 5m

+ extra-summary: /tools/ltrace/Sanity/broken-binary-handling

+ extra-task: /tools/ltrace/Sanity/broken-binary-handling

@@ -0,0 +1,56 @@

+ #!/bin/bash

+ # vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   runtest.sh of /tools/ltrace/Sanity/broken-binary-handling

+ #   Description: Try to trace broken binary by ltrace

+ #   Author: Michal Nowak <mnowak@redhat.com>

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ #

+ #   Copyright (c) 2011 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

+ #   and conditions of the GNU General Public License version 2.

+ #

+ #   This program is distributed in the hope that it will be

+ #   useful, but WITHOUT ANY WARRANTY; without even the implied

+ #   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR

+ #   PURPOSE. See the GNU General Public License for more details.

+ #

+ #   You should have received a copy of the GNU General Public

+ #   License along with this program; if not, write to the Free

+ #   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,

+ #   Boston, MA 02110-1301, USA.

+ #

+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ 

+ # Include Beaker environment

+ . /usr/share/beakerlib/beakerlib.sh || exit 1

+ 

+ PACKAGE="$(rpm -qf $(which ltrace))"

+ 

+ rlJournalStart

+ 	rlPhaseStartSetup

+                 rlAssertRpm $PACKAGE

+ 

+ 		rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"

+ 		cp broken.bin.gz $TmpDir

+ 		rlRun "pushd $TmpDir"

+ 		gunzip broken.bin.gz

+ 		chmod +x broken.bin

+ 	rlPhaseEnd

+ 

+ 	rlPhaseStartTest

+ 		rlRun "ltrace -f ./broken.bin > out 2>&1 " 1 "ltrace can't trace broken.bin"

+ 		OUT=`cat out`

+ 		rlLog "LOG: $OUT"

+ 	rlPhaseEnd

+ 

+ 	rlPhaseStartCleanup

+ 		rlRun "popd"

+ 		rlRun "rm -r $TmpDir" 0 "Removing tmp directory"

+ 		rlPhaseEnd

+ rlJournalPrintText

+ rlJournalEnd