public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jiri Jaburek <comps@nomail.dom>
To: git-commits@fedoraproject.org
Subject: [rpms/scap-security-guide] rawhide: replace Contest /static-checks/rpmbuild-ctest with simple ctest
Date: Thu, 17 Sep 2026 11:33:04 GMT	[thread overview]
Message-ID: <178964478407.1.1355824170879978375.rpms-scap-security-guide-87d1c82f2978@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/scap-security-guide
            Branch : rawhide
            Commit : 87d1c82f297842b753c2f5335192df4fe256f951
            Author : Jiri Jaburek <comps@nomail.dom>
            Date   : 2026-09-15T15:16:59+02:00
            Stats  : +41/-5 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/scap-security-guide/c/87d1c82f297842b753c2f5335192df4fe256f951?branch=rawhide

            Log:
            replace Contest /static-checks/rpmbuild-ctest with simple ctest

Contest is not compatible with Fedora, so this simply re-writes
the Contest test into a simple standalone bash script.

Arguably, this implementation is better because it uses 'rpmbuild'
to compile the SRPM, rather than doing 'cmake' on the extracted
source tarball.

Signed-off-by: Jiri Jaburek <comps@nomail.dom>

---
diff --git a/plans/ci.fmf b/plans/ci.fmf
index bae8765..bc9ff0e 100644
--- a/plans/ci.fmf
+++ b/plans/ci.fmf
@@ -1,8 +1,5 @@
 summary: CI test plan
 discover:
-    how: fmf
-    url: https://github.com/RHSecurityCompliance/contest
-    test:
-      - /static-checks/rpmbuild-ctest
+  how: fmf
 execute:
-    how: tmt
+  how: tmt

diff --git a/tests/ctest/main.fmf b/tests/ctest/main.fmf
new file mode 100644
index 0000000..787173d
--- /dev/null
+++ b/tests/ctest/main.fmf
@@ -0,0 +1,7 @@
+summary: Builds scap-security-guide source and runs ctest on it
+require:
+  - dnf-plugins-core
+  - rpm-build
+  - ansible-core
+duration: 4h
+test: ./test.sh

diff --git a/tests/ctest/test.sh b/tests/ctest/test.sh
new file mode 100755
index 0000000..060c2de
--- /dev/null
+++ b/tests/ctest/test.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+set -x -e
+
+ansible-galaxy -vvv collection install ansible.posix community.general
+
+tmpdir=$(mktemp -d -p /var/tmp)
+trap "rm -rf \"$tmpdir\"" EXIT
+cd "$tmpdir"
+
+dnf download --source scap-security-guide
+
+rpm -ivh --define "_topdir $tmpdir" *.src.rpm
+dnf -y builddep SPECS/scap-security-guide.spec
+rpmbuild --define "_topdir $tmpdir" -bc SPECS/scap-security-guide.spec
+
+# the BUILD rpmbuild-created directory may contain any wild number
+# of subdirectories or scap-security-guide-* suffixes, being inconsistent
+# across RHEL and Fedora versions; just try to find the actual real 'build'
+# directory inside the real source tree that was built
+#
+# for example Fedora has:
+#   BUILD/scap-security-guide-0.1.82-build/scap-security-guide-0.1.82/build
+# and RHEL has:
+#   BUILD/scap-security-guide-0.1.82/build
+#   BUILD/scap-security-guide-0.1.82-SPECPARTS   <-- bogus/ignored
+#
+build_ctestfile=$(find BUILD/ | grep build/CTestTestfile.cmake | head -1)
+build_dir=${build_ctestfile%/*}
+
+cd "$build_dir"
+ctest --output-on-failure

                 reply	other threads:[~2026-09-17 11:33 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=178964478407.1.1355824170879978375.rpms-scap-security-guide-87d1c82f2978@fedoraproject.org \
    --to=comps@nomail.dom \
    --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