public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] main: kernel/selinux-testsuite: add a simple script for verifying changes
@ 2026-10-15 9:13 Ondrej Mosnacek
0 siblings, 0 replies; only message in thread
From: Ondrej Mosnacek @ 2026-10-15 9:13 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : tests/selinux
Branch : main
Commit : c2d6fbca07ce182862c2c22b60b7fb0f5a8e32b4
Author : Ondrej Mosnacek <omosnace@redhat.com>
Date : 2026-10-15T10:10:18+02:00
Stats : +86/-0 in 1 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/c2d6fbca07ce182862c2c22b60b7fb0f5a8e32b4?branch=main
Log:
kernel/selinux-testsuite: add a simple script for verifying changes
Add a simple Python script that can be used to run a modified version of
the testsuite in Testing Farm in all currently supported
Fedora/CentOS/RHEL streams. The purpose to ensure there will be no false
positives in CKI, where the test is run frequently.
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
---
diff --git a/kernel/selinux-testsuite/test_matrix.py b/kernel/selinux-testsuite/test_matrix.py
new file mode 100755
index 0000000..b4f2dc1
--- /dev/null
+++ b/kernel/selinux-testsuite/test_matrix.py
@@ -0,0 +1,86 @@
+#!/usr/bin/python3
+#
+# Runs /kernel/selinux-testsuite on all supported platforms via Testing Farm
+#
+# You need to pass RH ranch TF API token to the script - see below.
+#
+# Usage: TESTING_FARM_API_TOKEN=... ./test_matrix.py <GIT_URL> <GIT_BRANCH>
+#
+
+import requests
+import json
+
+def build_compose(compose, arches=['x86_64', 'aarch64', 'ppc64le', 's390x']):
+ for arch in arches:
+ yield { "arch": arch, "os": { "compose": compose } }
+
+def build_environments():
+ # Fedora
+ # known issue - Beaker provisioning fails
+ yield from build_compose('Fedora-Rawhide', arches=['x86_64'])
+ # known issue - wrong variant in Beaker
+ yield from build_compose('Fedora-eln', arches=['x86_64'])
+ # known issue - provisioning fails for non-x86_64
+ yield from build_compose('Fedora-45', arches=['x86_64'])
+ yield from build_compose('Fedora-44')
+ yield from build_compose('Fedora-43')
+
+ # CentOS Stream
+ yield from build_compose('CentOS-Stream-10')
+ yield from build_compose('CentOS-Stream-9')
+
+ # RHEL 10
+ yield from build_compose('RHEL-10.3-Nightly')
+ yield from build_compose('RHEL-10.2-Nightly')
+ yield from build_compose('RHEL-10.0-Nightly')
+
+ # RHEL 9
+ yield from build_compose('RHEL-9.9.0-Nightly')
+ yield from build_compose('RHEL-9.8.0-Nightly')
+ yield from build_compose('RHEL-9.6.0-Nightly')
+ yield from build_compose('RHEL-9.4.0-Nightly')
+ yield from build_compose('RHEL-9.2.0-Nightly')
+
+ # RHEL 8
+ yield from build_compose('RHEL-8.10.0-Nightly')
+ yield from build_compose('RHEL-8.8.0-Nightly')
+ yield from build_compose('RHEL-8.6.0-Nightly')
+ # Only x86_64 is supported
+ yield from build_compose('RHEL-8.4.0-Nightly', arches=['x86_64'])
+
+ # RHEL 7
+ yield from build_compose('RHEL-7.9-Nightly', arches=['x86_64', 'ppc64', 'ppc64le', 's390x'])
+
+def build_request(tmt_url, tmt_ref):
+ return {
+ "test": {
+ "tmt": {
+ "url": tmt_url,
+ "ref": tmt_ref,
+ "test_name": "/kernel/selinux-testsuite",
+ "name": "/plans/tier1",
+ }
+ },
+ "environments": list(build_environments()),
+ "settings": {
+ "pipeline": { "parallel-limit": 20 }
+ },
+ }
+
+def tf_request_test(tf_api_token, request):
+ print(request)
+ headers = { 'Authorization': f'Bearer {tf_api_token}' }
+ res = requests.post('https://api.testing-farm.io/v0.1/requests',
+ headers=headers, json=request).json()
+ if 'detail' in res:
+ err = res['detail'][0]
+ raise RuntimeError(f'{err["type"]}: {err["msg"]} ({".".join(err["loc"])})')
+ return res["id"]
+
+if __name__ == '__main__':
+ import os
+ import sys
+
+ tf_api_token = os.environ['TESTING_FARM_API_TOKEN']
+ req_id = tf_request_test(tf_api_token, build_request(sys.argv[1], sys.argv[2]))
+ print(f'https://api.testing-farm.io/v0.1/requests/{req_id}')
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-15 9:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-15 9:13 [tests/selinux] main: kernel/selinux-testsuite: add a simple script for verifying changes Ondrej Mosnacek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox