@@ -29,43 +29,85 @@ def setup
2929 end
3030
3131 context 'profiles' do
32+ test 'profile_id' do
33+ assert_match ( /^xccdf_org.ssgproject.content_profile_C2S/ ,
34+ @test_result_file2 . benchmark . profiles . first . id )
35+ end
36+
37+ test 'profile_selected_rule_ids' do
38+ assert_equal ( 238 , @test_result_file2 . benchmark . profiles . first . selected_rule_ids . length )
39+ refute_includes ( @test_result_file2 . benchmark . profiles . first . selected_rule_ids , "xccdf_org.ssgproject.rules_group_crypto" )
40+ refute_includes ( @test_result_file2 . benchmark . profiles . first . selected_rule_ids , "xccdf_org.ssgproject.content_group_rule_crypto" )
41+ refute_includes ( @test_result_file2 . benchmark . profiles . first . selected_rule_ids , "xccdf_org.ssgproject.contentrule_group_crypto" )
42+ refute_includes ( @test_result_file2 . benchmark . profiles . first . selected_rule_ids , "xccdf_org.ssgproject.content_group_rule_group_crypto" )
43+ end
44+
45+ test 'profile_selected_group_ids' do
46+ assert_equal ( [ "xccdf_org.ssgproject.rules_group_crypto" ,
47+ "xccdf_org.ssgproject_rules.content_group_crypto" ,
48+ "xccdf_org.ssgproject.contentrule_group_crypto" ,
49+ "xccdf_org.ssgproject.content_group_rule_crypto" ,
50+ "xccdf_org.ssgproject.content_group_rule_group_crypto" ,
51+ "xccdf_org.ssgproject.content_group_endpoint_rule_security_software" ,
52+ "xccdf_org.ssgproject.content_group_nfs_configuring_all_machines" ,
53+ "xccdf_org.ssgproject.content_group_nfs_client_or_server_not_both" ,
54+ "xccdf_org.ssgproject.content_group_nfs_configure_fixed_ports" ,
55+ "xccdf_org.ssgproject.content_group_mounting_remote_filesystems" ] ,
56+ @test_result_file2 . benchmark . profiles . first . selected_group_ids )
57+ end
58+
59+ test 'profile_selected_entity_ids' do
60+ all_selected_ids = @test_result_file2 . benchmark . profiles . first . selected_rule_ids +
61+ @test_result_file2 . benchmark . profiles . first . selected_group_ids
62+ assert_equal ( 248 , @test_result_file2 . benchmark . profiles . first . selected_entity_ids . length )
63+ assert_equal ( all_selected_ids . sort , @test_result_file2 . benchmark . profiles . first . selected_entity_ids . sort )
64+ end
3265 end
3366
3467 context 'groups' do
3568 test 'group_id' do
3669 assert_match ( /^xccdf_org.ssgproject.content_group_system/ ,
3770 @test_result_file2 . benchmark . groups . first . id )
3871 end
72+
3973 test 'group_no_conflicts' do
4074 assert_equal ( [ ] , @test_result_file2 . benchmark . groups . first . conflicts )
4175 end
76+
4277 test 'group_with_conflicts' do
4378 assert_equal ( [ "xccdf_org.ssgproject.content_rule_selinux_state" ,
4479 "xccdf_org.ssgproject.content_group_mcafee_security_software" ] ,
4580 @test_result_file2 . benchmark . groups [ 1 ] . conflicts )
4681 end
82+
4783 test 'group_no_requires' do
4884 assert_equal ( [ ] , @test_result_file2 . benchmark . groups [ 1 ] . requires )
4985 end
86+
5087 test 'group_with_requires' do
5188 assert_equal ( [ 'A' , 'B' , 'C' ] , @test_result_file2 . benchmark . groups . first . requires )
5289 end
90+
5391 test 'group_description' do
5492 assert_match ( /^Contains rules that check correct system settings./ ,
5593 @test_result_file2 . benchmark . groups . first . description )
5694 end
95+
5796 test 'group_parent_id_benchmark' do
5897 assert_match ( /^xccdf_org.ssgproject.content_benchmark_RHEL-7/ ,
5998 @test_result_file2 . benchmark . groups . first . parent_id )
6099 end
100+
61101 test 'group_parent_id_group' do
62102 assert_match ( /^xccdf_org.ssgproject.content_group_system/ ,
63103 @test_result_file2 . benchmark . groups [ 1 ] . parent_id )
64104 end
105+
65106 test 'group_parent_type_with_benchmark_parent' do
66107 assert_match ( /^Benchmark/ ,
67108 @test_result_file2 . benchmark . groups . first . parent_type )
68109 end
110+
69111 test 'group_parent_type_with_group_parent' do
70112 assert_match ( /^Group/ ,
71113 @test_result_file2 . benchmark . groups [ 1 ] . parent_type )
0 commit comments