public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/fedora-repos] f45: Create test for rawhide signatures check
@ 2026-08-10  9:41 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-08-10  9:41 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/fedora-repos
            Branch : f45
            Commit : dbade8b30098bc569ef49f792b30db3bf334fee1
            Author : Petr Menšík <pemensik@redhat.com>
            Date   : 2021-03-10T10:11:48+00:00
            Stats  : +173/-0 in 6 file(s)
            URL    : https://src.fedoraproject.org/rpms/fedora-repos/c/dbade8b30098bc569ef49f792b30db3bf334fee1?branch=f45

            Log:
            Create test for rawhide signatures check

Should prevent usual broken signatures after new version branch.
Tests possible enablement from stable branch and upgrade. It should work
without GPG validation disabled.

Add STI entry for new test

Adds fmf and tmt support.

Remove RHTS dependencies

Workaround on platforms, where $basearch != $(arch)

i686 has a key on i386. Those platforms are not the same.

Use dnf to obtain basearch in test

Keep using just coreutils in spec, dnf build dependency might create
circular dependencies.

Signed-off-by: Petr Menšík <pemensik@redhat.com>

---
diff --git a/tests/.fmf/version b/tests/.fmf/version
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/tests/.fmf/version
@@ -0,0 +1 @@
+1

diff --git a/tests/rawhide-enable/Makefile b/tests/rawhide-enable/Makefile
new file mode 100644
index 0000000..3388bfc
--- /dev/null
+++ b/tests/rawhide-enable/Makefile
@@ -0,0 +1,61 @@
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#   Makefile of /CoreOS/tests/Regression/rawhide-enable
+#   Description: Tries enabling rawhide and upgrading after it
+#   Author: Petr Mensik <pemensik@redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#   Copyright (c) 2020 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=/CoreOS/tests/Regression/rawhide-enable
+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)
+	test -x runtest.sh || chmod a+x runtest.sh
+
+clean:
+	rm -f *~ $(BUILT_FILES)
+
+
+include $(realpath /usr/share/rhts/lib/rhts-make.include)
+
+$(METADATA): Makefile
+	@echo "Owner:           Petr Mensik <pemensik@redhat.com>" > $(METADATA)
+	@echo "Name:            $(TEST)" >> $(METADATA)
+	@echo "TestVersion:     $(TESTVERSION)" >> $(METADATA)
+	@echo "Path:            $(TEST_DIR)" >> $(METADATA)
+	@echo "Description:     Tries enabling rawhide and upgrading after it" >> $(METADATA)
+	@echo "Type:            Regression" >> $(METADATA)
+	@echo "TestTime:        5m" >> $(METADATA)
+	@echo "RunFor:          fedora-repos" >> $(METADATA)
+	@echo "Requires:        fedora-gpg-keys fedora-repos dnf-utils sed gnupg dnf" >> $(METADATA)
+	@echo "Priority:        Normal" >> $(METADATA)
+	@echo "License:         GPLv2+" >> $(METADATA)
+	@echo "Confidential:    no" >> $(METADATA)
+	@echo "Destructive:     yes" >> $(METADATA)
+	@echo "Releases:        -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)

diff --git a/tests/rawhide-enable/PURPOSE b/tests/rawhide-enable/PURPOSE
new file mode 100644
index 0000000..5d50d75
--- /dev/null
+++ b/tests/rawhide-enable/PURPOSE
@@ -0,0 +1,6 @@
+PURPOSE of /CoreOS/tests/Regression/rawhide-enable
+Description: Tries enabling rawhide and upgrading after it
+Author: Petr Mensik <pemensik@redhat.com>
+
+Check enabling of Rawhide from stable release.
+Ensure packages can be updated to Rawhide from a stable release.

diff --git a/tests/rawhide-enable/main.fmf b/tests/rawhide-enable/main.fmf
new file mode 100644
index 0000000..423a505
--- /dev/null
+++ b/tests/rawhide-enable/main.fmf
@@ -0,0 +1,20 @@
+summary: Tries enabling rawhide and upgrading after it
+description: |
+    Check enabling of Rawhide from stable release.
+    Ensure packages can be updated to Rawhide from a stable release.
+contact:
+- Petr Mensik <pemensik@redhat.com>
+component:
+- fedora-repos
+test: ./runtest.sh
+framework: beakerlib
+recommend:
+- fedora-gpg-keys
+- fedora-repos
+- dnf-utils
+- sed
+- gnupg
+- dnf
+duration: 5m
+extra-summary: /CoreOS/tests/Regression/rawhide-enable
+extra-task: /CoreOS/tests/Regression/rawhide-enable

diff --git a/tests/rawhide-enable/runtest.sh b/tests/rawhide-enable/runtest.sh
new file mode 100755
index 0000000..cee5490
--- /dev/null
+++ b/tests/rawhide-enable/runtest.sh
@@ -0,0 +1,77 @@
+#!/bin/bash
+# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#   runtest.sh of /CoreOS/tests/Regression/rawhide-enable
+#   Description: Tries enabling rawhide and upgrading after it
+#   Author: Petr Mensik <pemensik@redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#   Copyright (c) 2020 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
+
+PACKAGE="fedora-repos"
+
+basearch() {
+	dnf config-manager --dump-variables | sed -e '/^basearch\s*=/ ! d' -e 's/^[^=]*=\s*//'
+}
+
+test_keyring() {
+	rlRun "KEYRING=$(mktemp --tmpdir keyring.XXXXXXX)"
+	rlRun "BASEARCH=$(basearch)"
+	rlRun "gpg --no-default-keyring --keyring $KEYRING --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$RAWHIDE_RELEASE-$BASEARCH" 0 "Test import of rawhide key"
+	rlRun "rm -f $KEYRING"
+}
+
+rlJournalStart
+  if rpm -q $PACKAGE-rawhide; then
+    rlPhaseStartTest
+	rlLogWarning "This test should test stable releases, not rawhide!"
+	# Just check GPG key can be imported on this arch
+	rlRun "RAWHIDE_RELEASE=$(rpm -q fedora-repos-rawhide | cut -d- -f4)"
+	test_keyring
+    rlPhaseEnd
+  else
+    rlPhaseStartSetup
+        rlAssertRpm $PACKAGE
+	rlAssertNotRpm $PACKAGE-rawhide # rawhide should not yet be installed at this point
+	rlRun "dnf -y upgrade fedora-repos fedora-gpg-keys"
+	rlRun "dnf -y install fedora-repos-rawhide"
+	rlRun "dnf config-manager --set-enabled rawhide"
+	rlRun "RAWHIDE_RELEASE=$(dnf --repo rawhide repoquery fedora-repos | sed -e 's/fedora-repos-\(0:\)\?\([0-9]\+\)-.*/\2/')" 0 "Find rawhide version"
+    rlPhaseEnd
+
+    rlPhaseStartTest
+	# Until proposal https://pagure.io/releng/issue/7445 is solved, this might fail
+	rlRun "dnf -y upgrade fedora-gpg-keys" 0,1 "Try normal upgrade"
+	# Ensure it works with manual release increment
+	rlRun "dnf -y --repo rawhide --releasever $RAWHIDE_RELEASE upgrade fedora-gpg-keys" 0 "Upgrade with bumped release"
+	test_keyring
+    rlPhaseEnd
+
+    rlPhaseStartCleanup
+	rlRun "dnf config-manager --set-disabled rawhide"
+	rlRun "dnf -y downgrade fedora-gpg-keys fedora-repos-rawhide" 0 "Cleanup dnf changes back"
+	rlRun "dnf -y remove --noautoremove fedora-repos-rawhide"
+    rlPhaseEnd
+  fi
+rlJournalPrintText
+rlJournalEnd

diff --git a/tests/tests.yml b/tests/tests.yml
new file mode 100644
index 0000000..420fb8d
--- /dev/null
+++ b/tests/tests.yml
@@ -0,0 +1,8 @@
+---
+# This first play always runs on the local staging system
+- hosts: localhost
+  roles:
+  - role: standard-test-beakerlib
+    tags:
+    - classic
+    fmf_filter: "tier: 1"

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-10  9:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-10  9:41 [rpms/fedora-repos] f45: Create test for rawhide signatures check 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox