-
Notifications
You must be signed in to change notification settings - Fork 76
OCPQE-30680: Fix OPM test cases failure: Ensure container policy.json exists #1144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@Xia-Zhao-rh: This pull request references OCPQE-30680 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.21.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/payload-aggregate periodic-ci-openshift-release-master-ci-4.21-e2e-gcp-ovn-techpreview 5 |
|
@Xia-Zhao-rh: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/5564dc70-beca-11f0-86b9-461c6b9d558e-0 |
|
/approve |
|
@jianzhangbjz: This PR has been marked as verified by In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/hold |
|
/payload-job periodic-ci-openshift-release-master-ci-4.21-e2e-gcp-ovn-techpreview |
|
@jianzhangbjz: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/32f538f0-bf61-11f0-8adb-ee56d8bb1e44-0 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jianzhangbjz, Xia-Zhao-rh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/payload-aggregate periodic-ci-openshift-release-master-ci-4.21-e2e-gcp-ovn-techpreview 5 |
|
@Xia-Zhao-rh: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/5cb03610-bfa0-11f0-8026-f9d2eb924f2d-0 |
|
/payload-aggregate periodic-ci-openshift-release-master-ci-4.21-e2e-gcp-ovn-techpreview 5 |
|
@Xia-Zhao-rh: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/05531960-c14d-11f0-8d02-a60a4dd39113-0 |
This PR fixes 10 OPM test cases that were failing with the error:
no policy.json file found at any of the following: "/tmp/home/.config/containers/policy.json", "/etc/containers/policy.json"
Problem
OPM commands that interact with container images require a containers policy.json file. When this file doesn't exist, OPM operations fail. The following test cases were affected:
Solution
- Checks if ${HOME}/.config/containers/policy.json exists
- Creates the file with insecureAcceptAnything policy if it doesn't exist
- Thread-safe implementation using sync.Mutex to support parallel test execution
- Uses a policyCreated flag to avoid redundant file operations
- Added opmcli.EnsureContainerPolicy() call at the beginning of each affected test case
- Ensures policy file exists before executing OPM commands
Changes
Files modified:
Key features:
Testing: