Skip to content

Commit

Permalink
tweaked test checking
Browse files Browse the repository at this point in the history
  • Loading branch information
garethahealy committed May 17, 2023
1 parent 6fae029 commit 07d33a3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions _test/gatekeeper-k8s-integrationtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,12 @@ teardown() {

print_info "${status}" "${output}" "${cmd}" "${tmp}"
[ "$status" -eq 1 ]
[[ "${lines[0]}" == *"denied the request: [containerresourcesmemoryunitincorrect] RHCOP-OCP_BESTPRACT-00013: Deployment/invalidresourcesrequestsmemoryunits"* ]]
[[ "${lines[1]}" == *"denied the request: [containerresourcesmemoryunitincorrect] RHCOP-OCP_BESTPRACT-00013: Deployment/invalidresourceslimitsmemoryunits"* ]]
[[ "${#lines[@]}" -eq 2 ]]

[[ "${lines[0]}" == *"spec.template.spec.containers[0].resources.requests[memory]: fractional byte value"* ]]
[[ "${lines[1]}" == *"spec.template.spec.containers[0].resources.limits[memory]: fractional byte value"* ]]
[[ "${lines[2]}" == *"denied the request: [containerresourcesmemoryunitincorrect] RHCOP-OCP_BESTPRACT-00013: Deployment/invalidresourcesrequestsmemoryunits"* ]]
[[ "${lines[3]}" == *"denied the request: [containerresourcesmemoryunitincorrect] RHCOP-OCP_BESTPRACT-00013: Deployment/invalidresourceslimitsmemoryunits"* ]]
[[ "${#lines[@]}" -eq 4 ]]
}

@test "policy/ocp/bestpractices/container-resources-requests-cpuunit-incorrect" {
Expand Down

0 comments on commit 07d33a3

Please sign in to comment.