From ccd906e78b7481082c8b695793e71374832b1f2a Mon Sep 17 00:00:00 2001 From: Boyang Xue Date: Sat, 14 Sep 2024 01:25:52 +0800 Subject: [PATCH] gating: fix rpm-tmt-test failure by adding public gating test Signed-off-by: Boyang Xue --- ci.fmf | 2 + gating.yaml | 2 +- plans/internal.fmf | 1 + plans/public.fmf | 8 ++++ tests/fuse3-sanity-test/Makefile | 60 ++++++++++++++++++++++++++++++ tests/fuse3-sanity-test/PURPOSE | 5 +++ tests/fuse3-sanity-test/main.fmf | 14 +++++++ tests/fuse3-sanity-test/runtest.sh | 43 +++++++++++++++++++++ 8 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 ci.fmf create mode 100644 plans/public.fmf create mode 100644 tests/fuse3-sanity-test/Makefile create mode 100644 tests/fuse3-sanity-test/PURPOSE create mode 100644 tests/fuse3-sanity-test/main.fmf create mode 100755 tests/fuse3-sanity-test/runtest.sh diff --git a/ci.fmf b/ci.fmf new file mode 100644 index 0000000..da04079 --- /dev/null +++ b/ci.fmf @@ -0,0 +1,2 @@ +resultsdb-testcase: separate + diff --git a/gating.yaml b/gating.yaml index 9cac74a..bf2999b 100644 --- a/gating.yaml +++ b/gating.yaml @@ -5,4 +5,4 @@ product_versions: decision_context: osci_compose_gate rules: - !PassingTestCaseRule {test_case_name: osci.brew-build./plans/internal.functional} - + - !PassingTestCaseRule {test_case_name: osci.brew-build./plans/public.functional} diff --git a/plans/internal.fmf b/plans/internal.fmf index d4a6681..ccb0fff 100644 --- a/plans/internal.fmf +++ b/plans/internal.fmf @@ -5,6 +5,7 @@ adjust: enabled: true because: private tests are accesible only within rhel pipline discover: + - name: rhel-fuse3 how: fmf url: https://gitlab.cee.redhat.com/kernel-qe/kernel.git test: [ diff --git a/plans/public.fmf b/plans/public.fmf new file mode 100644 index 0000000..962b12b --- /dev/null +++ b/plans/public.fmf @@ -0,0 +1,8 @@ +summary: Public fuse3 gating test +execute: + how: tmt +discover: + how: fmf + test: [ + "fuse3-sanity-test", + ] diff --git a/tests/fuse3-sanity-test/Makefile b/tests/fuse3-sanity-test/Makefile new file mode 100644 index 0000000..612ae4b --- /dev/null +++ b/tests/fuse3-sanity-test/Makefile @@ -0,0 +1,60 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of fuse3-sanity-test +# Description: fuse3-sanity-test +# Author: Boyang Xue +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2024 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/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/kernel/filesystems/fuse/gating/fuse3 +export TESTVERSION=0.1 + +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: Boyang Xue " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: fuse3-sanity-test" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 15m" >> $(METADATA) + @echo "RunFor: fuse3" >> $(METADATA) + @echo "Requires: fuse3-libs" >> $(METADATA) + @echo "Requires: fuse3-devel" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/fuse3-sanity-test/PURPOSE b/tests/fuse3-sanity-test/PURPOSE new file mode 100644 index 0000000..a4c4033 --- /dev/null +++ b/tests/fuse3-sanity-test/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of fuse3-sanity-test +Description: fuse3-sanity-test +Author: Boyang Xue + +Note: diff --git a/tests/fuse3-sanity-test/main.fmf b/tests/fuse3-sanity-test/main.fmf new file mode 100644 index 0000000..17354c2 --- /dev/null +++ b/tests/fuse3-sanity-test/main.fmf @@ -0,0 +1,14 @@ +summary: fuse3-sanity-test +description: | + Note: +contact: Boyang Xue +component: + - fuse3 +test: ./runtest.sh +framework: beakerlib +recommend: + - fuse3-libs + - fuse3-devel +duration: 15m +extra-summary: /kernel/filesystems/fuse/gating/fuse3 +extra-task: /kernel/filesystems/fuse/gating/fuse3 diff --git a/tests/fuse3-sanity-test/runtest.sh b/tests/fuse3-sanity-test/runtest.sh new file mode 100755 index 0000000..71c8a7a --- /dev/null +++ b/tests/fuse3-sanity-test/runtest.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of fuse3-sanity-test +# Description: fuse3-sanity-test +# Author: Boyang Xue +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2024 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 + +set -o pipefail + +rlJournalStart + rlPhaseStartSetup Setup + if ! rlCheckRpm fuse3 fuse3-libs fuse3-devel; then + rlRun "yum install -y fuse3 fuse3-libs fuse3-devel" + rlAssertRpm fuse3 fuse3-libs fuse3-devel + fi + rlPhaseEnd + rlPhaseStartTest Test + rlRun "fusermount3 --version" + rlPhaseEnd +rlJournalEnd