File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ def destroy
4242
4343 def policies_init
4444 policies = { }
45+ OpenSCAP . raise! unless OpenSCAP . xccdf_policy_model_build_all_useful_policies ( raw ) == 0
4546 polit = OpenSCAP . xccdf_policy_model_get_policies raw
4647 while OpenSCAP . xccdf_policy_iterator_has_more polit
4748 policy_p = OpenSCAP . xccdf_policy_iterator_next polit
@@ -56,6 +57,7 @@ def policies_init
5657
5758 attach_function :xccdf_policy_model_new , [ :pointer ] , :pointer
5859 attach_function :xccdf_policy_model_free , [ :pointer ] , :void
60+ attach_function :xccdf_policy_model_build_all_useful_policies , [ :pointer ] , :int
5961
6062 attach_function :xccdf_policy_model_get_policies , [ :pointer ] , :pointer
6163 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
2222 b = OpenSCAP ::Xccdf ::Benchmark . new @s
2323 pm = OpenSCAP ::Xccdf ::PolicyModel . new b
2424 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' ]
2627 pm . destroy
2728 end
2829end
You can’t perform that action at this time.
0 commit comments