Skip to content

Commit

Permalink
Merge pull request #2129 from evgenyz/cleanup-1.4
Browse files Browse the repository at this point in the history
Cleanup 1.4
  • Loading branch information
jan-cerny authored Jul 4, 2024
2 parents 91134a8 + e043657 commit 22140fc
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 42 deletions.
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ if(ACL_FOUND)
check_include_file(sys/acl.h HAVE_SYS_ACL_H)
endif()

find_package(AptPkg)

find_package(Blkid)
if(BLKID_FOUND)
check_library_exists("${BLKID_LIBRARY}" blkid_get_tag_value "" HAVE_BLKID_GET_TAG_VALUE)
Expand Down Expand Up @@ -277,7 +275,7 @@ cmake_dependent_option(OPENSCAP_PROBE_INDEPENDENT_YAMLFILECONTENT "Independent y
cmake_dependent_option(OPENSCAP_PROBE_UNIX_DNSCACHE "Unix dnscache probe" ON "ENABLE_PROBES_UNIX" OFF)
cmake_dependent_option(OPENSCAP_PROBE_UNIX_FILE "Unix file probe" ON "ENABLE_PROBES_UNIX" OFF)
cmake_dependent_option(OPENSCAP_PROBE_UNIX_FILEEXTENDEDATTRIBUTE "Unix fileextendedattribute probe" ON "ENABLE_PROBES_UNIX; HAVE_SYS_XATTR_H OR HAVE_ATTR_XATTR_H OR HAVE_SYS_EXTATTR_H" OFF)
cmake_dependent_option(OPENSCAP_PROBE_UNIX_GCONF "Unix gconf probe" ON "ENABLE_PROBES_UNIX; GCONF_FOUND" OFF)
cmake_dependent_option(OPENSCAP_PROBE_UNIX_GCONF "Unix gconf probe" OFF "ENABLE_PROBES_UNIX; GCONF_FOUND" OFF)
cmake_dependent_option(OPENSCAP_PROBE_UNIX_INTERFACE "Unix interface probe" ON "ENABLE_PROBES_UNIX" OFF)
cmake_dependent_option(OPENSCAP_PROBE_UNIX_PASSWORD "Unix password probe" ON "ENABLE_PROBES_UNIX" OFF)
cmake_dependent_option(OPENSCAP_PROBE_UNIX_PROCESS "Unix process probe" ON "ENABLE_PROBES_UNIX" OFF)
Expand Down
4 changes: 0 additions & 4 deletions openscap.spec
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,8 @@ Tool for scanning Atomic containers.
# gconf is a legacy system not used any more, and it blocks testing of oscap-anaconda-addon
# as gconf is no longer part of the installation medium
%cmake \
%if 0%{?fedora}
-DWITH_PCRE2=ON \
%endif
-DENABLE_PERL=OFF \
-DENABLE_DOCS=ON \
-DOPENSCAP_PROBE_UNIX_GCONF=OFF \
-DGCONF_LIBRARY=
%cmake_build
make docs
Expand Down
2 changes: 1 addition & 1 deletion tests/API/OVAL/unittests/test_xsinil_envv58_pid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ echo "Result file: $result"
echo "Evaluating content."
$OSCAP oval eval --results $result $srcdir/${name}.oval.xml
echo "Validating results."
$OSCAP oval validate --results --schematron $result
$OSCAP oval validate --results $result
echo "Testing results values."
assert_exists 1 '/oval_results'
assert_exists 1 '/oval_results/oval_definitions'
Expand Down
2 changes: 1 addition & 1 deletion tests/API/OVAL/validate/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function oval-schema-fail {
}

function oval-schematron-fail {
$OSCAP oval validate --schematron ${srcdir}/oval-schematron-fail.xml
$OSCAP oval validate ${srcdir}/oval-schematron-fail.xml
ret=$?
if [ $ret -eq 2 ]; then
return 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ assert_exists 1 '//TestResult[@id="xccdf_org.open-scap_testresult_default-profil
assert_exists 1 '//TestResult[@id="xccdf_org.open-scap_testresult_default-profile001"]/rule-result/result'
assert_exists 1 '//TestResult[@id="xccdf_org.open-scap_testresult_default-profile001"]/rule-result/result[text()="fixed"]'

rm $resultx $arf $sds
rm $resultx $arf
40 changes: 20 additions & 20 deletions tests/API/XCCDF/variable_instance/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function xccdf_export_1_multival() {
[ -f $stderr ]; [ ! -s $stderr ]
[ -f $variables0 ]
[ ! -f $variables1 ]
$OSCAP oval validate --schematron $variables0
$OSCAP oval validate $variables0
assert_exists 1 '/oval_variables'
assert_exists 1 '/oval_variables/variables'
assert_exists 1 '/oval_variables/variables/variable'
Expand Down Expand Up @@ -73,8 +73,8 @@ function xccdf_export_2_multiset(){
[ -f $variables0 ]
[ -f $variables1 ]
[ ! -f $variables2 ]
$OSCAP oval validate --schematron $variables0
$OSCAP oval validate --schematron $variables1
$OSCAP oval validate $variables0
$OSCAP oval validate $variables1
local result="$variables0"
assert_exists 1 '/oval_variables'
assert_exists 1 '/oval_variables/variables'
Expand Down Expand Up @@ -112,7 +112,7 @@ function xccdf_export_3_twice_same(){
[ -f $stderr ]; [ ! -s $stderr ]
[ -f $variables0 ]
[ ! -f $variables1 ]
$OSCAP oval validate --schematron $variables0
$OSCAP oval validate $variables0
local result="$variables0"
assert_exists 1 '/oval_variables'
assert_exists 1 '/oval_variables/variables'
Expand Down Expand Up @@ -142,7 +142,7 @@ function xccdf_export_4_two_same(){
[ -f $stderr ]; [ ! -s $stderr ]
[ -f $variables0 ]
[ ! -f $variables1 ]
$OSCAP oval validate --schematron $variables0
$OSCAP oval validate $variables0
local result="$variables0"
assert_exists 1 '/oval_variables'
assert_exists 1 '/oval_variables/variables'
Expand Down Expand Up @@ -171,7 +171,7 @@ function xccdf_export_5_multival_twice(){
[ -f $stderr ]; [ ! -s $stderr ]
[ -f $variables0 ]
[ ! -f $variables1 ]
$OSCAP oval validate --schematron $variables0
$OSCAP oval validate $variables0
local result="$variables0"
assert_exists 1 '/oval_variables'
assert_exists 1 '/oval_variables/variables'
Expand Down Expand Up @@ -204,8 +204,8 @@ function xccdf_export_6_multiset_multival(){
[ -f $variables0 ]
[ -f $variables1 ]
[ ! -f $variables2 ]
$OSCAP oval validate --schematron $variables0
$OSCAP oval validate --schematron $variables1
$OSCAP oval validate $variables0
$OSCAP oval validate $variables1
local result="$variables0"
assert_exists 1 '/oval_variables'
assert_exists 1 '/oval_variables/variables'
Expand Down Expand Up @@ -246,7 +246,7 @@ function xccdf_export_7_shuffled_multival(){
[ -f $stderr ]; [ ! -s $stderr ]
[ -f $variables0 ]
[ ! -f $variables1 ]
$OSCAP oval validate --schematron $variables0
$OSCAP oval validate $variables0
local result="$variables0"
assert_exists 1 '/oval_variables'
assert_exists 1 '/oval_variables/variables'
Expand Down Expand Up @@ -279,7 +279,7 @@ function xccdf_export_8_shuffled_multival(){
[ -f $stderr ]; [ ! -s $stderr ]
[ -f $variables0 ]
[ ! -f $variables1 ]
$OSCAP oval validate --schematron $variables0
$OSCAP oval validate $variables0
local result="$variables0"
assert_exists 1 '/oval_variables'
assert_exists 1 '/oval_variables/variables'
Expand Down Expand Up @@ -313,8 +313,8 @@ function xccdf_export_9_first_subset(){
[ -f $variables0 ]
[ -f $variables1 ]
[ ! -f $variables2 ]
$OSCAP oval validate --schematron $variables0
$OSCAP oval validate --schematron $variables1
$OSCAP oval validate $variables0
$OSCAP oval validate $variables1
local result="$variables0"
assert_exists 1 '/oval_variables'
assert_exists 1 '/oval_variables/variables'
Expand Down Expand Up @@ -358,8 +358,8 @@ function xccdf_export_A_second_subset(){
[ -f $variables0 ]
[ -f $variables1 ]
[ ! -f $variables2 ]
$OSCAP oval validate --schematron $variables0
$OSCAP oval validate --schematron $variables1
$OSCAP oval validate $variables0
$OSCAP oval validate $variables1
local result="$variables0"
assert_exists 1 '/oval_variables'
assert_exists 1 '/oval_variables/variables'
Expand Down Expand Up @@ -413,9 +413,9 @@ function xccdf_eval_2_multiset(){
[ -f $variables0 ]
[ -f $variables1 ]
[ ! -f $variables2 ]
$OSCAP oval validate --schematron $variables0
$OSCAP oval validate --schematron $variables1
$OSCAP oval validate --schematron $oval_result
$OSCAP oval validate $variables0
$OSCAP oval validate $variables1
$OSCAP oval validate $oval_result
local result="$xccdf_result"
assert_exists 1 '/Benchmark/TestResult'
assert_exists 1 '/Benchmark/TestResult/profile'
Expand Down Expand Up @@ -574,9 +574,9 @@ function xccdf_eval_1_multiset_syschar(){
[ -f $variables0 ]
[ -f $variables1 ]
[ ! -f $variables2 ]
$OSCAP oval validate --schematron $variables0
$OSCAP oval validate --schematron $variables1
$OSCAP oval validate --schematron $oval_result
$OSCAP oval validate $variables0
$OSCAP oval validate $variables1
$OSCAP oval validate $oval_result
result="$variables0"
assert_exists 1 '/oval_variables'
assert_exists 1 '/oval_variables/variables'
Expand Down
2 changes: 1 addition & 1 deletion tests/CPE/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e -o pipefail
. $builddir/tests/test_common.sh

function test_cpe() {
$OSCAP oval validate --schematron ${top_srcdir}/cpe/openscap-cpe-oval.xml
$OSCAP oval validate ${top_srcdir}/cpe/openscap-cpe-oval.xml
$OSCAP cpe validate ${top_srcdir}/cpe/openscap-cpe-dict.xml
}

Expand Down
4 changes: 2 additions & 2 deletions tests/DS/schematron/schematron.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e -o pipefail

# both XCCDF and SDS schematrons find only warnings but not errors
output="$(mktemp)"
$OSCAP xccdf validate --schematron "$srcdir/simple_ds.xml" >"$output"
$OSCAP xccdf validate "$srcdir/simple_ds.xml" >"$output"
[ $? = 0 ]
grep -q "Schematron validation of OVAL Definition component 'test_single_rule.oval.xml': PASS" "$output"
grep -q "Schematron validation of XCCDF Checklist component 'scap_org.open-scap_cref_test_single_rule.xccdf.xml': PASS" "$output"
Expand All @@ -16,7 +16,7 @@ rm -f "$output"
# XCCDF schematron reports an error
output="$(mktemp)"
stderr="$(mktemp)"
$OSCAP xccdf validate --schematron "$srcdir/simple_ds_xccdf_schematron_error.xml" >"$output" 2>"$stderr" || ret=$?
$OSCAP xccdf validate "$srcdir/simple_ds_xccdf_schematron_error.xml" >"$output" 2>"$stderr" || ret=$?
[ $ret = 2 ]
grep -q "Error: The given @idref attribute 'xccdf_com.example.www_rule_test-pass2' must match a the @id or @cluster-id attributes of a 'Rule' or 'Group' element. See the XCCDF 1.2.1 specification, Section 6.5.3." $output
grep -q "Schematron validation of OVAL Definition component 'test_single_rule.oval.xml': PASS" "$output"
Expand Down
2 changes: 1 addition & 1 deletion tests/probes/sql57/unsupported_engine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $OSCAP oval eval --results $result $srcdir/${name}.oval.xml 2> $stderr
sed -i -E "/^E: probe_sql57: DB engine not supported: sqlserver/d" "$stderr"
[ -f $stderr ]; [ ! -s $stderr ]; rm $stderr
echo "Validating results."
#$OSCAP oval validate --results --schematron $result
#$OSCAP oval validate --results $result
echo "Testing results values."
assert_exists 1 '/oval_results'
assert_exists 1 '/oval_results/oval_definitions'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set -e
function oval_validation {
DF="test_probes_systemdunitdependency_validate.xml"
${srcdir}/test_probes_systemdunitdependency.xml.sh "true" > $DF
$OSCAP oval validate --schematron $DF
$OSCAP oval validate $DF
}

test_run "OVAL 5.11 validation (systemdunitdependency)" oval_validation
Expand Down
4 changes: 1 addition & 3 deletions tests/sce/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
if(ENABLE_SCE)
if(${PYTHON_VERSION_MAJOR} EQUAL "3")
add_oscap_test("test_sce.sh")
endif()
add_oscap_test("test_sce.sh")
add_oscap_test("test_passing_vars.sh")
add_oscap_test("test_check_engine_results.sh")
add_oscap_test("test_sce_in_ds.sh")
Expand Down
2 changes: 0 additions & 2 deletions utils/oscap-oval.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,6 @@ bool getopt_oval_validate(int argc, char **argv, struct oscap_action *action)
{ "syschar", no_argument, &action->doctype, OSCAP_DOCUMENT_OVAL_SYSCHAR },
{ "results", no_argument, &action->doctype, OSCAP_DOCUMENT_OVAL_RESULTS },
{ "directives", no_argument, &action->doctype, OSCAP_DOCUMENT_OVAL_DIRECTIVES },
//TODO: force schematron validation (no-op, deprecate and remove)
{ "schematron", no_argument, &action->schematron, 1 },
{ "skip-schematron",no_argument, &action->schematron, 0 },
// end
{ 0, 0, 0, 0 }
Expand Down
2 changes: 0 additions & 2 deletions utils/oscap-xccdf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1254,8 +1254,6 @@ bool getopt_xccdf(int argc, char **argv, struct oscap_action *action)
{"remediate", no_argument, &action->remediate, 1},
{"hide-profile-info", no_argument, &action->hide_profile_info, 1},
{"export-variables", no_argument, &action->export_variables, 1},
//TODO: deprecate and remove
{"schematron", no_argument, &action->schematron, 1},
{"skip-schematron", no_argument, &action->schematron, 0},
{"without-syschar", no_argument, &action->without_sys_chars, 1},
{"thin-results", no_argument, &action->thin_results, 1},
Expand Down

0 comments on commit 22140fc

Please sign in to comment.