-
Notifications
You must be signed in to change notification settings - Fork 690
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
Add SCAPVal to CTest #10802
Add SCAPVal to CTest #10802
Conversation
Skipping CI for Draft Pull Request. |
/packit rebuild-failed |
1 similar comment
/packit rebuild-failed |
CMakeLists.txt
Outdated
# SCAPVal Options | ||
option(ENABLE_SCAPVAL13 "Set to ON to enable scapval tests" OFF) | ||
set(SCAPVAL_VERSION "1.3.5" CACHE STRING "What version of SCAPVal to use") | ||
set(SCAPVAL_PATH "/opt/scapval/SCAP-Content-Validation-Tool-${SCAPVAL_VERSION}/scapval-${SCAPVAL_VERSION}.jar" CACHE PATH "Which minor version of OVAL are we targetting. Only 11 is supported at the moment.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In CMake the paths to tools can't be hardcoded but they need to be found by the find_program
or by a custom find module or similar construction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have just removed the default value, you need to provide -DSCAPVAL_PATH='/opt/scapval/SCAP-Content-Validation-Tool-1.3.5/scapval-1.3.5.jar'
to give the path to the SCAPVal jar.
Code Climate has analyzed commit 2dc4f96 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 53.5% (0.0% change). View more on Code Climate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have built RHEL 9 content using this command:
[jcerny@fedora scap-security-guide{pr/10802}]$ ADDITIONAL_CMAKE_OPTIONS="-DENABLE_SCAPVAL13:BOOL=ON -DSCAPVAL_PATH=/opt/scapval/scapval-1.3.5.jar" ./build_product -d rhel9
Then, I have executed the new CTest test introduced by your PR:
[jcerny@fedora build{pr/10802}]$ ctest --verbose -R scapval
UpdateCTestConfiguration from :/home/jcerny/work/git/scap-security-guide/build/DartConfiguration.tcl
UpdateCTestConfiguration from :/home/jcerny/work/git/scap-security-guide/build/DartConfiguration.tcl
Test project /home/jcerny/work/git/scap-security-guide/build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 52
Start 52: scapval-rhel9
52: Test command: /usr/bin/env "PYTHONPATH=/home/jcerny/work/git/scap-security-guide" "/usr/bin/python3" "/home/jcerny/work/git/scap-security-guide/tests/run_scapval.py" "--scap-version" "1.3" "--scapval-path" "/opt/scapval/scapval-1.3.5.jar" "--datastream" "/home/jcerny/work/git/scap-security-guide/build/ssg-rhel9-ds.xml"
52: Working Directory: /home/jcerny/work/git/scap-security-guide/build/rhel9
52: Test timeout computed to be: 10000000
52: Build dir: /home/jcerny/work/git/scap-security-guide/build
52: Testing ssg-rhel9-ds.xml ...
52: ssg-rhel9-ds.xml: PASS
1/1 Test #52: scapval-rhel9 .................... Passed 91.73 sec
The following tests passed:
scapval-rhel9
100% tests passed, 0 tests failed out of 1
Label Time Summary:
scapval = 91.73 sec*proc (1 test)
Total Test time (real) = 91.73 sec
[jcerny@fedora build{pr/10802}]$
The CI fails on Rawhide aren't related to the content of this PR. |
Description:
This PR adds the ability to
ENABLE_SCAPVAL13
option is enabledtests/run_scalval.py
to test one fileRationale:
Review Hints: