generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add integration tests for maven repo verification check
Signed-off-by: Mohammad Abdollahpour <[email protected]>
- Loading branch information
1 parent
a4255e7
commit c0cce14
Showing
5 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Copyright (c) 2024 - 2024, Oracle and/or its affiliates. All rights reserved. | ||
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/. | ||
|
||
[analysis.checks] | ||
exclude = | ||
include = mcn_maven_repo_verification_1 |
10 changes: 10 additions & 0 deletions
10
tests/integration/cases/maven_repo_verification/policy_fail_1.dl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* Copyright (c) 2024 - 2024, Oracle and/or its affiliates. All rights reserved. */ | ||
/* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/. */ | ||
|
||
#include "prelude.dl" | ||
|
||
Policy("test_policy", component_id, "") :- | ||
check_failed(component_id, "mcn_maven_repo_verification_1"). | ||
|
||
apply_policy_to("test_policy", component_id) :- | ||
is_component(component_id, "pkg:maven/com.alibaba.ververica/[email protected]"). |
10 changes: 10 additions & 0 deletions
10
tests/integration/cases/maven_repo_verification/policy_pass_1.dl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* Copyright (c) 2024 - 2024, Oracle and/or its affiliates. All rights reserved. */ | ||
/* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/. */ | ||
|
||
#include "prelude.dl" | ||
|
||
Policy("test_policy", component_id, "") :- | ||
check_passed(component_id, "mcn_maven_repo_verification_1"). | ||
|
||
apply_policy_to("test_policy", component_id) :- | ||
is_component(component_id, "pkg:maven/org.antlr/[email protected]"). |
10 changes: 10 additions & 0 deletions
10
tests/integration/cases/maven_repo_verification/policy_pass_2.dl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* Copyright (c) 2024 - 2024, Oracle and/or its affiliates. All rights reserved. */ | ||
/* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/. */ | ||
|
||
#include "prelude.dl" | ||
|
||
Policy("test_policy", component_id, "") :- | ||
check_passed(component_id, "mcn_maven_repo_verification_1"). | ||
|
||
apply_policy_to("test_policy", component_id) :- | ||
is_component(component_id, "pkg:maven/org.neo4j/[email protected]"). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Copyright (c) 2024 - 2024, Oracle and/or its affiliates. All rights reserved. | ||
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/. | ||
|
||
description: | | ||
Integration tests for mcn_maven_repo_verification_1 check. | ||
tags: | ||
- macaron-python-package | ||
- macaron-docker-image | ||
|
||
steps: | ||
- name: Run macaron analyze on passing case 1 | ||
kind: analyze | ||
options: | ||
ini: config.ini | ||
command_args: | ||
- -purl | ||
- pkg:maven/org.antlr/[email protected] | ||
- name: Verify that the check passsed | ||
kind: verify | ||
options: | ||
policy: policy_pass_1.dl | ||
- name: Run macaron analyze on passing case 2 | ||
kind: analyze | ||
options: | ||
ini: config.ini | ||
command_args: | ||
- -purl | ||
- pkg:maven/org.neo4j/[email protected] | ||
- name: Verify that the check passsed | ||
kind: verify | ||
options: | ||
policy: policy_pass_2.dl | ||
- name: Run macaron analyze on failing case 1 | ||
kind: analyze | ||
options: | ||
ini: config.ini | ||
command_args: | ||
- -purl | ||
- pkg:maven/com.alibaba.ververica/[email protected] | ||
- name: Verify that the check passsed | ||
kind: verify | ||
options: | ||
policy: policy_fail_1.dl |