From a6eca09d180168051b71e5998d978f7a4247751f Mon Sep 17 00:00:00 2001 From: Lichen Liu Date: Mon, 15 Apr 2024 09:19:28 +0800 Subject: [PATCH] Enable gating test for dmidecode Enable gating test for c10s dmidecode by copying from c9s. Resolves: RHEL-33027 Signed-off-by: Lichen Liu --- gating.yaml | 6 ++++ tests/selftest/Makefile | 64 +++++++++++++++++++++++++++++++++++++++ tests/selftest/PURPOSE | 4 +++ tests/selftest/runtest.sh | 60 ++++++++++++++++++++++++++++++++++++ tests/tests.yml | 12 ++++++++ 5 files changed, 146 insertions(+) create mode 100644 gating.yaml create mode 100644 tests/selftest/Makefile create mode 100644 tests/selftest/PURPOSE create mode 100755 tests/selftest/runtest.sh create mode 100644 tests/tests.yml diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..4ca9235 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-10 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/tests/selftest/Makefile b/tests/selftest/Makefile new file mode 100644 index 0000000..f82e38d --- /dev/null +++ b/tests/selftest/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/patch/Sanity/selftest +# Description: Executes upstream test suite +# Author: Miroslav Vadkerti +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2010 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=/CoreOS/dmidecode/Sanity/selftest +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.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: Martin Cermak " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Just executes binaries and checks for right exitcode." >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 4m" >> $(METADATA) + @echo "RunFor: dmidecode" >> $(METADATA) + @echo "Requires: dmidecode" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Architectures: i386 x86_64 ia64" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/selftest/PURPOSE b/tests/selftest/PURPOSE new file mode 100644 index 0000000..49deb86 --- /dev/null +++ b/tests/selftest/PURPOSE @@ -0,0 +1,4 @@ +PURPOSE of /CoreOS/dmidecode/Sanity/selftest +Description: Just executes binaries and checks for right exitcode. +Author: Matej Susta + diff --git a/tests/selftest/runtest.sh b/tests/selftest/runtest.sh new file mode 100755 index 0000000..e79205e --- /dev/null +++ b/tests/selftest/runtest.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# vim: dict=/usr/share/rhts-library/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/dmidecode/Sanity/basic-sanity-check +# Description: Just executes binaries and checks for right exitcode. +# Author: Matej Susta +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2009 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 rhts environment +. /usr/bin/rhts-environment.sh +. /usr/share/rhts-library/rhtslib.sh + +PACKAGE="dmidecode" + +rlJournalStart + rlPhaseStartSetup Setup + rlAssertRpm $PACKAGE + if [ "`uname -p`" = "ia64" ]; then + IA64=1 + fi + rlPhaseEnd + + rlPhaseStartTest Testing + (($IA64)) || rlRun "biosdecode" 0 "biosdecode" + rlRun "dmidecode >$TmpDir/normal" 0 "dmidecode without args" + grep "OUT OF SPEC" "$TmpDir/normal" && rlLogWarning "OUT OF SPEC issue, see bug #714591 and bug #714595" + + rlAssertNotGrep "BAD INDEX" "$TmpDir/normal" + # DBG: + echo "##### NORMAL #####" + cat $TmpDir/normal + rlRun "dmidecode --quiet >$TmpDir/quiet" 0 "dmidecode in quieter mode" + rlRun "diff $TmpDir/normal $TmpDir/quiet" 1 "quiet should be quiet" + rlRun "dmidecode --type 0 >$TmpDir/type" 0 "dmidecode for type" + rlRun "diff $TmpDir/normal $TmpDir/type" 1 "type output check" +# rlRun "dmidecode --dump --quiet" 2 "dmidecode shouldn't like dump+quiet" + (($IA64)) || rlRun "ownership" 0 "ownership" + (($IA64)) || rlRun "vpddecode" 0 "vpddecode" + rlPhaseEnd +rlJournalPrintText diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..c219f29 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,12 @@ +--- +# This first play always runs on the local staging system +- hosts: localhost + roles: + - role: standard-test-beakerlib + tags: + - classic + tests: + - selftest + required_packages: + - make + - gcc