Gating: Remove all steps and only leave ddiskit --help

Signed-off-by: Ziqian SUN (Zamir) <zsun@redhat.com>
This commit is contained in:
Ziqian SUN (Zamir) 2025-03-24 11:36:04 +08:00
parent 8d1cdab52b
commit ba46ae835b
7 changed files with 3 additions and 155 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

View File

@ -1,62 +0,0 @@
#!/bin/bash
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Description: Gating test for ddiskit
# Author: Ziqian SUN (Zamir) <zsun@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2022 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.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TOPLEVEL_NAMESPACE=kernel
PACKAGE_NAME=ddiskit
RELATIVE_PATH=general/ddiskit/gating
export TESTVERSION=1.0
export TEST=/$(TOPLEVEL_NAMESPACE)/$(RELATIVE_PATH)
.PHONY: all install download clean
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
chmod a+x ./runtest.sh
clean:
rm -f *~ *.rpm $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@touch $(METADATA)
@echo "Owner: Ziqian SUN (Zamir) <zsun@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Description: ddiskit gating test">> $(METADATA)
@echo "TestTime: 90m" >> $(METADATA)
@echo "RunFor: $(PACKAGE_NAME)" >> $(METADATA)
@echo "Requires: gcc kernel-devel ddiskit" >> $(METADATA)
@echo "RhtsRequires: " >> $(METADATA)

View File

@ -1 +0,0 @@
Gating test for ddiskit

View File

@ -1,14 +0,0 @@
[General]
name=ddiskit
owner= Ziqian SUN (Zamir) <zsun@redhat.com>
description=Gating test for ddiskit
license=GPLv2
confidential=no
destructive=no
[restraint]
entry_point=make run
max_time=90m
dependencies=ddiskit
softDependencies=kernel-devel
repoRequires=

View File

@ -1,68 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh for ddiskit gating test.
# Author: Ziqian SUN (Zamir) <zsun@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2022 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# 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, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
kerneltag=$(uname -r | sed "s/.$(uname -m)//g")
rhelrelease=$(rpm -q redhat-release | awk -F '-' '{print $3}' | awk -F '.' '{print $1}')
tmpdir=.
rlJournalStart
rlPhaseStartSetup
rlRun -l "date"
rm -rf ${tmpdir}/ddiskit-test
rm -rf ${tmpdir}/kernel-rhel${rhelrelease}
rlRun -l "rpm -q ddiskit || dnf install -y -q ddiskit"
rlRun "dnf install -y -q git"
rlRun -l "git clone https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-${rhelrelease}.git"
rlRun -l "date"
rlPhaseEnd
rlPhaseStartTest "Test ddiskit prepare"
mkdir ${tmpdir}/ddiskit-test
pushd ${tmpdir}/ddiskit-test
rlRun -l "ddiskit --help 2>&1 | tee -a ddiskit-help"
rlAssertNotGrep "invalid|error" ddiskit-help "-E -i"
rlRun -l "ddiskit -v -p rh-testing -C defaults.git_dir=../kernel-rhel${rhelrelease}/.git -C spec_file.module_name=virtio_blk -C spec_file.module_version=1.0.1_dup7.4a -C spec_file.rpm_dist=el${rhelrelease} -C spec_file.kernel_version=${kerneltag} -C spec_file.kernel_arch=$(arch) prepare_sources -d 'drivers/block drivers/ata'"
rlRun "sed -i '/ENTER_VENDOR_NAME$/a module_vendor = redhat' module.config"
rlRun "sed -i '/ENTER_AUTHOR$/a module_author = Core Kernel QE' module.config"
rlRun "sed -i '/ENTER_AUTHOR_EMAIL$/a module_author_email = core-kernel-qe@redhat.com' module.config"
rlRun -l "ddiskit -v -p rh-testing -C defaults.git_dir=../kernel-rhel${rhelrelease}/.git/ -C spec_file.make_targets=virtio_blk.ko build_rpm -s -G"
rlRun -l "rpm -qp --requires rpm/SRPMS/kmod-redhat-*.src.rpm | grep kernel-abi-stablelists"
rlRun "dnf builddep -y -q rpm/SRPMS/kmod-redhat-*.src.rpm"
rlRun "rpmbuild --rebuild rpm/SRPMS/kmod-redhat-*.src.rpm"
popd
rlPhaseEnd
rlPhaseStartCleanup
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

2
tests/smoke.fmf Normal file
View File

@ -0,0 +1,2 @@
execute:
script: ddiskit --help

View File

@ -1,10 +0,0 @@
- hosts: localhost
tags:
- classic
roles:
- role: standard-test-beakerlib
tests:
- sanity
required_packages:
- kernel-devel
- ddiskit