From ffc0425ad46788d7e83d93b1c0017255759d7c33 Mon Sep 17 00:00:00 2001 From: pdancak Date: Tue, 8 Oct 2024 17:03:53 +0200 Subject: [PATCH] tests --- .fmf/version | 1 + .../Makefile | 66 +++++++++++++++++++ .../PURPOSE | 5 ++ .../main.fmf | 37 +++++++++++ .../runtest.sh | 60 +++++++++++++++++ 5 files changed, 169 insertions(+) create mode 100644 .fmf/version create mode 100644 Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too/Makefile create mode 100644 Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too/PURPOSE create mode 100644 Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too/main.fmf create mode 100755 Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too/runtest.sh diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too/Makefile b/Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too/Makefile new file mode 100644 index 0000000..fa7185b --- /dev/null +++ b/Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too/Makefile @@ -0,0 +1,66 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/mkbootdisk/Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too +# Description: Test for bz761590 (mkbootdisk --iso fails with Volume ID string too) +# Author: Petr Sklenar +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2012 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/mkbootdisk/Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too +export TESTVERSION=1.1 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Petr Sklenar " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for bz761590 (mkbootdisk --iso fails with Volume ID string too)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 15m" >> $(METADATA) + @echo "RunFor: mkbootdisk" >> $(METADATA) + @echo "Requires: mkbootdisk" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 761590" >> $(METADATA) + @echo "Architectures: i386 x86_64" >> $(METADATA) + @echo "Releases: -RHEL5 -RedHatEnterpriseLinuxClient5 -RedHatEnterpriseLinuxServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too/PURPOSE b/Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too/PURPOSE new file mode 100644 index 0000000..e63ebe9 --- /dev/null +++ b/Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /CoreOS/mkbootdisk/Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too +Description: Test for bz761590 (mkbootdisk --iso fails with Volume ID string too) +Author: Petr Sklenar +Bug summary: mkbootdisk --iso fails with Volume ID string too long +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=761590 diff --git a/Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too/main.fmf b/Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too/main.fmf new file mode 100644 index 0000000..562d14f --- /dev/null +++ b/Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too/main.fmf @@ -0,0 +1,37 @@ +summary: Test for bz761590 (mkbootdisk --iso fails with Volume ID string too) +description: |+ + Bug summary: mkbootdisk --iso fails with Volume ID string too long + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=761590 + + +contact: Petr Dancak +component: + - mkbootdisk +test: ./runtest.sh +framework: beakerlib +recommend: + - mkbootdisk +duration: 15m +enabled: true +tag: + - NoRHEL5 + - TIPfail_infra + - TIPpass + - Tier1 +tier: '1' +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=761590 +adjust: + - enabled: false + when: arch != x86_64 + continue: false + - enabled: false + when: distro == rhel-5 + continue: false + - enabled: false + when: distro > rhel-7 + continue: false +extra-nitrate: TC#0136562 +extra-summary: /CoreOS/mkbootdisk/Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too +extra-task: /CoreOS/mkbootdisk/Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too +id: 1b33dd27-5610-4d1e-81b8-226a6eaadd36 diff --git a/Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too/runtest.sh b/Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too/runtest.sh new file mode 100755 index 0000000..78ada27 --- /dev/null +++ b/Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too/runtest.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/mkbootdisk/Regression/bz761590-mkbootdisk-iso-fails-with-Volume-ID-string-too +# Description: Test for bz761590 (mkbootdisk --iso fails with Volume ID string too) +# Author: Petr Sklenar +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2012 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="mkbootdisk" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + mytempdir=`mktemp -d` + mytempfile=`mktemp` + rlPhaseEnd + + rlPhaseStartTest "test the bug" + rlRun "mkbootdisk --iso --device $mytempfile `uname -r`" + rlRun "file $mytempfile | grep -i boot" + rlPhaseEnd + rlPhaseStartTest "sanity test" + rlRun "mount -o loop $mytempfile $mytempdir" + lines=`find $mytempdir | wc -l` + if [ "$lines" -ge "6" ];then + rlPass "there is $lines lines" + else + rlFail "there is $lines lines" + fi + rlPhaseEnd + + rlPhaseStartCleanup + umount $mytempdir + rm -rf $mytempdir $mytempfile + rlPhaseEnd +rlJournalPrintText +rlJournalEnd