Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tests/utils/autotailor_integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ python3 $autotailor --id-namespace "com.example.www" --json-tailoring $json_tail
$OSCAP xccdf eval --profile CMDL_P --progress --tailoring-file $tailoring --results $result $ds
assert_exists 1 '/Benchmark/TestResult/rule-result[@idref="xccdf_com.example.www_rule_R3"]/result[text()="pass"]'

# JSON tailoring with base_profile_id must set 'extends' attribute
python3 $autotailor $ds --id-namespace "com.example.www" --json-tailoring $json_tailoring > $tailoring
saved_result=$result
result=$tailoring
assert_exists 1 '/*[local-name()="Tailoring"]/*[local-name()="Profile"][@id="xccdf_com.example.www_profile_JSON_P1"][@extends="xccdf_com.example.www_profile_P1"]'
assert_exists 1 '/*[local-name()="Tailoring"]/*[local-name()="Profile"][@id="xccdf_com.example.www_profile_JSON_P11"][@extends="xccdf_com.example.www_profile_P1"]'
assert_exists 0 '/*[local-name()="Tailoring"]/*[local-name()="Profile"][@id="xccdf_com.example.www_profile_JSON_P12"][@extends]'
result=$saved_result

# test --local-path option with absolute path (should use basename)
python3 $autotailor --id-namespace "com.example.www" --local-path --select R3 $ds $original_profile > $tailoring
saved_result=$result
Expand Down
3 changes: 2 additions & 1 deletion utils/autotailor
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,8 @@ if __name__ == "__main__":

if args.profile or (args.json_tailoring and args.tailored_profile_id):
p = t.get_or_create_tailored_profile_with_id(args.tailored_profile_id)
p.extends = args.profile
if args.profile:
p.extends = args.profile

# Validate base profile
try:
Expand Down
Loading