Skip to content

Commit 191f7fc

Browse files
akofinkdLobatog
authored andcommitted
Add a test for ospp42 in rhel7 SSG (#11)
Signed-off-by: Andrew Kofink <akofink@redhat.com>
1 parent bdc0d3b commit 191f7fc

1 file changed

Lines changed: 36 additions & 17 deletions

File tree

test/openscap_parser/profiles_test.rb

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,45 @@
33
require 'test_helper'
44

55
class ProfilesTest < Minitest::Test
6-
def test_result
7-
OpenStruct.new(id: ['xccdf_org.ssgproject.content_profile_standard'])
8-
end
6+
describe 'profiles are parsed from' do
7+
include OpenscapParser::Profiles
8+
include OpenscapParser::XMLReport
99

10-
def report_description
11-
'description'
12-
end
10+
def report_description
11+
'description'
12+
end
1313

14-
include OpenscapParser::Profiles
15-
include OpenscapParser::XMLReport
14+
def setup
15+
@profiles = nil
16+
end
1617

17-
def setup
18-
report_xml(file_fixture('xccdf_report.xml').read)
19-
end
18+
test 'standard fedora' do
19+
def test_result_node
20+
OpenStruct.new(id: ['xccdf_org.ssgproject.content_profile_standard'])
21+
end
22+
23+
report_xml(file_fixture('xccdf_report.xml').read)
24+
25+
expected = {
26+
'xccdf_org.ssgproject.content_profile_standard' => \
27+
'Standard System Security Profile for Fedora'
28+
}
29+
assert_equal expected, profiles
30+
end
31+
32+
test 'ospp42 rhel' do
33+
def test_result_node
34+
OpenStruct.new(id: ['xccdf_org.open-scap_testresult_xccdf_org.'\
35+
'ssgproject.content_profile_ospp42'])
36+
end
37+
38+
report_xml(file_fixture('rhel-xccdf-report.xml').read)
2039

21-
test 'profiles' do
22-
expected = {
23-
'xccdf_org.ssgproject.content_profile_standard' => \
24-
'Standard System Security Profile for Fedora'
25-
}
26-
assert_equal expected, profiles
40+
expected = {
41+
'xccdf_org.ssgproject.content_profile_ospp42' => 'OSPP - Protection '\
42+
'Profile for General Purpose Operating Systems v. 4.2'
43+
}
44+
assert_equal expected, profiles
45+
end
2746
end
2847
end

0 commit comments

Comments
 (0)