Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build / test under Fedora #1883

Closed
wants to merge 10 commits into from
Closed

Build / test under Fedora #1883

wants to merge 10 commits into from

Conversation

maage
Copy link
Contributor

@maage maage commented Sep 4, 2022

Because my other PR got dinged by some other build issues, here is my take to slightly improve spec file and testing. See: #1881

I tried to change some tests to skip in my mock build environment as it runs w/o network, systemd and is chrooted env. See: #1886

Then I tried to make tests actually run parallel, but it was no go. Too many of them use shared file names like test_file. And because they are not parametrized it was too much work. So I modified spec not to use parallel ctest runs.

I simplified bugs fixed under Fedora. As I was unable to test these under CentOS I used if block.

I converted BuildRequires to use pkgconfig and tried to minimize list.

As oscap is really complex C/C++ program I decided to compile it with ASAN/UBSAN and found couple of simple issues. See: #1885

Because there is some stylish choices I made and was not able to see out full tests okayed, with-perl, yaml-filter and so on, this is still draft.

@maage maage changed the title Build 1 Build / test under Fedora Sep 4, 2022
maage and others added 10 commits September 12, 2022 10:51
Multiple tests share test file names. If tests are run parallel, they will fail.

BuildRequire programs used in ctests.

Use %{with check}
ldconfig_scriptlets needed if support pre Fedora 28.
https://fedoraproject.org/wiki/Changes/Removing_ldconfig_scriptlets

redhat-rpm-config can mangle shebangs
- added v90

la files are handled automatically:
https://fedoraproject.org/wiki/Changes/RemoveLaFiles

service bugs are fixed, see relevant bugs
It is better to list files explicitly.

Order bin, then man.

Move oscap-run-sce-script to engine-sce.
- use ninja-build
- ensure pkg-config is used
- systemd-rpm-macros are used in spec
- cmake requirement now: cmake_minimum_required(VERSION 2.8...3.19)
Do not sprinkle BuildRequires between subpackages, instead
try to follow CMakeLists.txt order of dependencies.

Handle gconf using 'with'.

Handle perl using 'with'.
As this spec is used for testing and program is complex C/C++ program,
it seems prudent to use asan.

Also enables ubsan.

By default do not detect leaks as there was way too many to fix.
@maage
Copy link
Contributor Author

maage commented Sep 19, 2022

It seems there is at least some kind of issue of tests and build system change to ninja.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Run upstream test suite against installed openscap
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 08:13:06 ] :: [  BEGIN   ] :: Running 'export OSCAP_FULL_VALIDATION=1'
:: [ 08:13:06 ] :: [   PASS   ] :: Command 'export OSCAP_FULL_VALIDATION=1' (Expected 0, got 0)
:: [ 08:13:07 ] :: [  BEGIN   ] :: Running 'export CUSTOM_OSCAP=/usr/bin/oscap'
:: [ 08:13:07 ] :: [   PASS   ] :: Command 'export CUSTOM_OSCAP=/usr/bin/oscap' (Expected 0, got 0)
:: [ 08:13:07 ] :: [  BEGIN   ] :: Running 'cmake --build /root/rpmbuild/BUILD/openscap-1.3.7/redhat-linux-build --target test -- ARGS='--output-on-failure''
ninja: error: unknown target 'ARGS=--output-on-failure'
:: [ 08:13:07 ] :: [   FAIL   ] :: Command 'cmake --build /root/rpmbuild/BUILD/openscap-1.3.7/redhat-linux-build --target test -- ARGS='--output-on-failure'' (Expected 0, got 1)
:: [ 08:13:07 ] :: [   LOG    ] :: Bundling logs
:: [ 08:13:07 ] :: [   INFO   ] :: rlBundleLogs: Adding '/root/rpmbuild/BUILD/openscap-1.3.7/redhat-linux-build/tests' as '_root_rpmbuild_BUILD_openscap-1.3.7_redhat-linux-build_tests'
tar: Removing leading `/' from member names
:: [ 08:13:07 ] :: [   INFO   ] :: Sending /tmp/test_outputs_all.tar.gz as tmp-test_outputs_all.tar.gz
File '/tmp/tmp.nHbvxKIKHc/tmp-test_outputs_all.tar.gz' stored to '/var/ARTIFACTS/work-packiteEd2ZH/packit/execute/data/Sanity/smoke-test/data'.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 1s
::   Assertions: 2 good, 1 bad
::   RESULT: FAIL (Run upstream test suite against installed openscap)

@evgenyz
Copy link
Contributor

evgenyz commented Feb 9, 2024

Closing due to the lack of activity.

@evgenyz evgenyz closed this Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants