File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ def destroy
42
42
43
43
def policies_init
44
44
policies = { }
45
+ OpenSCAP . raise! unless OpenSCAP . xccdf_policy_model_build_all_useful_policies ( raw ) == 0
45
46
polit = OpenSCAP . xccdf_policy_model_get_policies raw
46
47
while OpenSCAP . xccdf_policy_iterator_has_more polit
47
48
policy_p = OpenSCAP . xccdf_policy_iterator_next polit
@@ -56,6 +57,7 @@ def policies_init
56
57
57
58
attach_function :xccdf_policy_model_new , [ :pointer ] , :pointer
58
59
attach_function :xccdf_policy_model_free , [ :pointer ] , :void
60
+ attach_function :xccdf_policy_model_build_all_useful_policies , [ :pointer ] , :int
59
61
60
62
attach_function :xccdf_policy_model_get_policies , [ :pointer ] , :pointer
61
63
attach_function :xccdf_policy_iterator_has_more , [ :pointer ] , :bool
Original file line number Diff line number Diff line change @@ -22,7 +22,8 @@ def test_new_policy_model
22
22
b = OpenSCAP ::Xccdf ::Benchmark . new @s
23
23
pm = OpenSCAP ::Xccdf ::PolicyModel . new b
24
24
assert !b . nil?
25
- assert pm . policies . size == 0 , pm . policies . to_s
25
+ assert pm . policies . size == 1 , pm . policies . to_s
26
+ assert pm . policies [ 'xccdf_org.ssgproject.content_profile_common' ]
26
27
pm . destroy
27
28
end
28
29
end
You can’t perform that action at this time.
0 commit comments