File tree Expand file tree Collapse file tree 4 files changed +18
-58
lines changed
tests/DS/sds_detect_version Expand file tree Collapse file tree 4 files changed +18
-58
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,11 @@ CLEANFILES = *.log *.results oscap_debug.log.*
3
3
4
4
TESTS_ENVIRONMENT = \
5
5
builddir=$(top_builddir ) \
6
+ top_srcdir=$(top_srcdir ) \
6
7
OSCAP_FULL_VALIDATION=1 \
7
8
$(top_builddir ) /run
8
9
9
10
TESTS = test_detect_version.sh
10
11
11
12
EXTRA_DIST = test_detect_version.sh \
12
- scap-1.2-ds.xml \
13
- scap-1.3-ds.xml
13
+ scap-ds.xml
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" ?>
2
- <ns0 : data-stream-collection xmlns : dc =" http://purl.org/dc/elements/1.1/" xmlns : html =" http://www.w3.org/1999/xhtml" xmlns : ns0 =" http://scap.nist.gov/schema/scap/source/1.2" xmlns : ns1 =" http://www.w3.org/1999/xlink" xmlns : ns10 =" http://checklists.nist.gov/xccdf/1.2" xmlns : ns13 =" http://cpe.mitre.org/dictionary/2.0" xmlns : ns2 =" urn:oasis:names:tc:entity:xmlns:xml:catalog" xmlns : ns3 =" http://scap.nist.gov/schema/ocil/2.0" xmlns : ns4 =" http://oval.mitre.org/XMLSchema/oval-definitions-5" xmlns : ns6 =" http://oval.mitre.org/XMLSchema/oval-common-5" xmlns : ns7 =" http://oval.mitre.org/XMLSchema/oval-definitions-5#independent" xmlns : ns8 =" http://oval.mitre.org/XMLSchema/oval-definitions-5#unix" xmlns : ns9 =" http://oval.mitre.org/XMLSchema/oval-definitions-5#linux" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" id =" scap_org.open-scap_collection_from_xccdf_ssg-rhel8-xccdf-1.2.xml" schematron-version =" 1.3 " >
3
- <ns0 : data-stream id =" scap_org.open-scap_datastream_from_xccdf_ssg-rhel8-xccdf-1.2.xml" scap-version =" 1.3 " use-case =" OTHER" >
2
+ <ns0 : data-stream-collection xmlns : dc =" http://purl.org/dc/elements/1.1/" xmlns : html =" http://www.w3.org/1999/xhtml" xmlns : ns0 =" http://scap.nist.gov/schema/scap/source/1.2" xmlns : ns1 =" http://www.w3.org/1999/xlink" xmlns : ns10 =" http://checklists.nist.gov/xccdf/1.2" xmlns : ns13 =" http://cpe.mitre.org/dictionary/2.0" xmlns : ns2 =" urn:oasis:names:tc:entity:xmlns:xml:catalog" xmlns : ns3 =" http://scap.nist.gov/schema/ocil/2.0" xmlns : ns4 =" http://oval.mitre.org/XMLSchema/oval-definitions-5" xmlns : ns6 =" http://oval.mitre.org/XMLSchema/oval-common-5" xmlns : ns7 =" http://oval.mitre.org/XMLSchema/oval-definitions-5#independent" xmlns : ns8 =" http://oval.mitre.org/XMLSchema/oval-definitions-5#unix" xmlns : ns9 =" http://oval.mitre.org/XMLSchema/oval-definitions-5#linux" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" id =" scap_org.open-scap_collection_from_xccdf_ssg-rhel8-xccdf-1.2.xml" schematron-version =" X.X " >
3
+ <ns0 : data-stream id =" scap_org.open-scap_datastream_from_xccdf_ssg-rhel8-xccdf-1.2.xml" scap-version =" X.X " use-case =" OTHER" >
4
4
<ns0 : checks >
5
5
<ns0 : component-ref id =" scap_org.open-scap_cref_ssg-rhel8-oval.xml" ns1 : href =" #scap_org.open-scap_comp_ssg-rhel8-oval.xml" />
6
6
</ns0 : checks >
Original file line number Diff line number Diff line change 12
12
13
13
set -e -o pipefail
14
14
15
+ echo $srcdir
16
+
15
17
function test_oscap_info {
16
18
version=" $1 "
17
19
stdout=" $( mktemp) "
18
20
stderr=" $( mktemp) "
19
- $OSCAP info $srcdir /scap-$version -ds.xml > $stdout 2> $stderr
21
+ ds=" $( mktemp) "
22
+ cp $srcdir /scap-ds.xml $ds
23
+ sed -i " s/X.X/${version} /g" $ds
24
+
25
+ $OSCAP info $ds > $stdout 2> $stderr
20
26
[ ! -s $stderr ]
21
27
grep -q " Version: $version " $stdout
22
28
rm $stdout
23
29
rm $stderr
30
+ rm $ds
24
31
}
25
32
26
- test_oscap_info " 1.2"
27
- test_oscap_info " 1.3"
33
+ SDS=$( find $top_srcdir /schemas/sds -maxdepth 1 -mindepth 1 -type d -printf ' %f\n' )
34
+
35
+ for sds_version in $SDS
36
+ do
37
+ test_oscap_info $sds_version
38
+ done
You can’t perform that action at this time.
0 commit comments