RHSecurityCompliance / contest

Content Testing for ComplianceAsCode/content
Other
4 stars 7 forks source link

Fix rpmbuild-ctest to use also upstream Content #224

Closed mildas closed 3 months ago

mildas commented 3 months ago

Use util.get_content to get SSG content. If content is provided by env variable, use it, not the packaged one. Otherwise, use packaged content. In both cases, built it and test it using cmake.

mildas commented 3 months ago

@comps besides of added check=True, added also more recommend packages to enable more ssg unit tests

mildas commented 3 months ago

Added new commit to fix search for failed ctests.

Previously, failed and passed results had same format:

40/52 Test #40: cce_avail_check-sle15 ............................................   Passed    0.04 sec
41/52 Test #41: utils-build_control_from_reference_sanity ........................   Failed   11.75 sec

but now there is:

40/52 Test #40: cce_avail_check-sle15 ............................................   Passed    0.04 sec
41/52 Test #41: utils-build_control_from_reference_sanity ........................***Failed   11.75 sec

and the regex didn't account for that as it expected spaces after .....

Thus, I've changed that to match only the part before result: 52 Test #40: cce_avail_check-sle15 ............................................ and not to match result. Just find the line and then search for Passed in it.

mildas commented 3 months ago

@comps There are new packages added in main.fmf and some python3 modules are installed via pip3 in test code. I want to enable as much as possible and as those are not available via dnf, I've chosen pip3-way. And intentionally without check=True in case any of the modules would be unavailable.

Tested on rhel8 and rhel9, passes. Thus, ready for merge.