public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Ondrej Mosnacek <omosnace@redhat.com>
To: git-commits@fedoraproject.org
Subject: [tests/selinux] main: kernel/selinux-testsuite: add a simple script for verifying changes
Date: Thu, 15 Oct 2026 09:13:04 GMT	[thread overview]
Message-ID: <179205558469.1.15413685994718159751.tests-selinux-c2d6fbca07ce@fedoraproject.org> (raw)

            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}')

                 reply	other threads:[~2026-10-15  9:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179205558469.1.15413685994718159751.tests-selinux-c2d6fbca07ce@fedoraproject.org \
    --to=omosnace@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox