577577rm -rf " $SOURCE_REPO "
578578rm -rf " $TARGET_REPO "
579579
580+ echo -e " \n----------------------------------------------------------------------------------"
581+ echo " Running the analysis with all checks excluded. This test should return an error code."
582+ echo -e " ----------------------------------------------------------------------------------\n"
583+ $RUN_MACARON -dp tests/e2e/defaults/exclude_all_checks.ini analyze -rp https://github.com/apache/maven --skip-deps
584+
585+ if [ $? -eq 0 ];
586+ then
587+ echo -e " Expect non-zero status code but got $? ."
588+ log_fail
589+ fi
590+
580591echo -e " \n----------------------------------------------------------------------------------"
581592echo " apache/maven: test analyzing without the environment variable GITHUB_TOKEN being set."
582593echo -e " ----------------------------------------------------------------------------------\n"
626637
627638# Testing the CUE provenance expectation verifier.
628639echo -e " \n----------------------------------------------------------------------------------"
629- echo " Test verifying CUE provenance expectation."
640+ echo " Test verifying CUE provenance expectation for ossf/scorecard"
641+ echo -e " ----------------------------------------------------------------------------------\n"
642+ JSON_EXPECTED=$WORKSPACE /tests/e2e/expected_results/scorecard/scorecard.json
643+ JSON_RESULT=$WORKSPACE /output/reports/github/ossf/scorecard/scorecard.json
644+ DEFAULTS_FILE=$WORKSPACE /tests/e2e/defaults/scorecard.ini
645+ EXPECTATION_FILE=$WORKSPACE /tests/slsa_analyzer/provenance/expectations/cue/resources/valid_expectations/scorecard_PASS.cue
646+ $RUN_MACARON -dp
$DEFAULTS_FILE analyze -pe
$EXPECTATION_FILE -purl pkg:github/ossf/
[email protected] --skip-deps
|| log_fail
647+
648+ check_or_update_expected_output $COMPARE_JSON_OUT $JSON_RESULT $JSON_EXPECTED || log_fail
649+
650+ echo -e " \n----------------------------------------------------------------------------------"
651+ echo " Test verifying CUE provenance expectation for slsa-verifier"
630652echo -e " ----------------------------------------------------------------------------------\n"
631653JSON_EXPECTED=$WORKSPACE /tests/e2e/expected_results/slsa-verifier/slsa-verifier_cue_PASS.json
632654JSON_RESULT=$WORKSPACE /output/reports/github_com/slsa-framework/slsa-verifier/slsa-verifier.json
633655EXPECTATION_FILE=$WORKSPACE /tests/slsa_analyzer/provenance/expectations/cue/resources/valid_expectations/slsa_verifier_PASS.cue
634- $RUN_MACARON analyze -pe $EXPECTATION_FILE -rp https://github.com/slsa-framework/slsa-verifier -b main -d fc50b662fcfeeeb0e97243554b47d9b20b14efac --skip-deps || log_fail
656+ DEFAULTS_FILE=$WORKSPACE /tests/e2e/defaults/slsa_verifier.ini
657+ $RUN_MACARON -dp $DEFAULTS_FILE analyze -pe $EXPECTATION_FILE -rp https://github.com/slsa-framework/slsa-verifier -b main -d fc50b662fcfeeeb0e97243554b47d9b20b14efac --skip-deps || log_fail
635658
636659check_or_update_expected_output $COMPARE_JSON_OUT $JSON_RESULT $JSON_EXPECTED || log_fail
637660
@@ -648,16 +671,15 @@ check_or_update_expected_output $COMPARE_JSON_OUT $JSON_RESULT $JSON_EXPECTED ||
648671
649672# Testing the Souffle policy engine.
650673echo -e " \n----------------------------------------------------------------------------------"
651- echo " Run policy CLI with slsa-verifier results."
674+ echo " Run policy CLI with scorecard results."
652675echo -e " ----------------------------------------------------------------------------------\n"
653676RUN_POLICY=" macaron verify-policy"
654- POLICY_FILE=$WORKSPACE /tests/policy_engine/resources/policies/valid/slsa-verifier .dl
677+ POLICY_FILE=$WORKSPACE /tests/policy_engine/resources/policies/scorecard/scorecard .dl
655678POLICY_RESULT=$WORKSPACE /output/policy_report.json
656- POLICY_EXPECTED=$WORKSPACE /tests/policy_engine/expected_results/policy_report .json
679+ POLICY_EXPECTED=$WORKSPACE /tests/policy_engine/expected_results/scorecard/scorecard_policy_report .json
657680VSA_RESULT=$WORKSPACE /output/vsa.intoto.jsonl
658- VSA_PAYLOAD_EXPECTED=$WORKSPACE /tests/vsa/integration/github_slsa-framework_slsa-verifier /vsa_payload.json
681+ VSA_PAYLOAD_EXPECTED=$WORKSPACE /tests/vsa/integration/github_slsa-framework_scorecard /vsa_payload.json
659682
660- # Run policy engine on the database and compare results.
661683$RUN_POLICY -f $POLICY_FILE -d " $WORKSPACE /output/macaron.db" || log_fail
662684check_or_update_expected_output $COMPARE_POLICIES $POLICY_RESULT $POLICY_EXPECTED || log_fail
663685check_or_update_expected_output " $COMPARE_VSA " " $VSA_RESULT " " $VSA_PAYLOAD_EXPECTED " || log_fail
0 commit comments