Convert gating to restraint and tmt

Signed-off-by: Ziqian SUN (Zamir) <zsun@redhat.com>
This commit is contained in:
Ziqian SUN (Zamir) 2025-03-20 16:50:10 +08:00
parent 62e12e062c
commit 65e12d75f3
10 changed files with 40 additions and 126 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

View File

@ -1,46 +0,0 @@
# SPDX-License-Identifier: LGPL-2.1+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /CoreOS/libkmod
# Description: Test if libkmod working ok
# Author: Susant Sahani<susant@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/CoreOS/libkmod
export TESTVERSION=1.0
OBJS = test-libkmod.c
CFLAG = -Wall -g3
CC = gcc
LIBS = -lkmod -lcmocka
test-libkmod:${OBJ}
${CC} ${CFLAGS} ${INCLUDES} -o $@ ${OBJS} ${LIBS}
run: test-libkmod
./runtest.sh
clean:
-rm -f test-libkmod
.c.o:
${CC} ${CFLAGS} ${INCLUDES} -c $<
CC = gcc
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Susant Sahani<susant@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Test libkmod works ok" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 5m" >> $(METADATA)
@echo "RunFor: libkmod" >> $(METADATA)
@echo "Requires: libkmod libkmod-devel" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -Fedora 29" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -0,0 +1,6 @@
test: bash ./runtest.sh
require:
- libcmocka-devel
- kmod-devel
- make
- gcc

14
tests/libkmod/metadata Normal file
View File

@ -0,0 +1,14 @@
[General]
name=libkmod gating test
owner=Susant Sahani <susant@redhat.com>
description=libkmod gating test
license=GPLv2
confidential=no
destructive=no
[restraint]
entry_point=./runtest.sh
max_time=15m
use_pty=false
dependencies=gcc,make,libcmocka-devel,kmod-devel

View File

@ -18,6 +18,7 @@ rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlAssertExists "$IPIP"
rlRun "gcc -o test-libkmod test-libkmod.c -lkmod -lcmocka"
rlRun "cp test-libkmod /usr/bin/"
rlPhaseEnd

4
tests/plan.fmf Normal file
View File

@ -0,0 +1,4 @@
discover:
how: fmf
execute:
how: tmt

View File

@ -1,79 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of general/kmod/sanity
# Description: kmod test
#
# 2016-07-31
# Author: Chunyu Hu <chuhu@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2016 Red Hat, Inc.
#
# 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.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TENV=_env
ifeq ($(PKG_TOP_DIR),)
export PKG_TOP_DIR := $(shell p=$$PWD; while :; do \
[ -e $$p/env.mk -o -z "$$p" ] && { echo $$p; break; }; p=$${p%/*}; done)
export _TOP_DIR := $(shell p=$$PWD; while :; do \
[ -d $$p/.git -o -z "$$p" ] && { echo $$p; break; }; p=$${p%/*}; done)
-include $(PKG_TOP_DIR)/env.mk
endif
include $(TENV)
ifeq ($(_TOP_DIR),)
_TOP_DIR=/mnt/tests/$(TOPLEVEL_NAMESPACE)
endif
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(TENV) $(METADATA) _env runtest.sh Makefile PURPOSE lib.sh
.PHONY: all install download clean
run: $(FILES) build
( set +o posix; . /usr/bin/rhts_environment.sh; \
. /usr/share/beakerlib/beakerlib.sh; \
. runtest.sh )
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -fr *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Chunyu Hu <chuhu@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: kmod kernel module check from kernel modules tools">> $(METADATA)
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 1h" >> $(METADATA)
@echo "RunFor: kernel" >> $(METADATA)
@echo "Requires: kernel" >> $(METADATA)
@echo "Requires: sysstat perf trace-cmd" >> $(METADATA)
@echo "Requires: $(PACKAGE_NAME) python rpm wget" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
rhts-lint $(METADATA)

12
tests/sanity/metadata Normal file
View File

@ -0,0 +1,12 @@
[General]
name=kmod gating test
owner=Ziqian SUN <zsun@redhat.com>
description=kmod gating test
license=GPLv2
confidential=no
destructive=no
[restraint]
entry_point=./runtest.sh
max_time=15m
use_pty=false

1
tests/sanity/sanity.fmf Normal file
View File

@ -0,0 +1 @@
test: bash ./runtest.sh

View File

@ -2,7 +2,7 @@
tags:
- classic
roles:
- role: standard-test-beakerlib
- role: standard-test-basic
tests:
- sanity
- libkmod