diff --git a/test/bats/helpers.bash b/test/bats/helpers.bash index 9f94907ba4f..e2acb9e1205 100644 --- a/test/bats/helpers.bash +++ b/test/bats/helpers.bash @@ -73,21 +73,6 @@ wait_for_process() { return 1 } -wait_for_error() { - wait_time="$1" - sleep_time="$2" - cmd="$3" - while [ "$wait_time" -gt 0 ]; do - if eval "$cmd"; then - sleep "$sleep_time" - wait_time=$((wait_time - sleep_time)) - else - return 0 - fi - done - return 1 -} - get_ca_cert() { destination="$1" if [ $(kubectl get secret -n ${GATEKEEPER_NAMESPACE} gatekeeper-webhook-server-cert -o jsonpath='{.data.ca\.crt}' | wc -w) -eq 0 ]; then diff --git a/test/bats/test.bats b/test/bats/test.bats index ed5f388b8ee..e000324703c 100644 --- a/test/bats/test.bats +++ b/test/bats/test.bats @@ -97,10 +97,6 @@ teardown_file() { kubectl delete --ignore-not-found -f ${BATS_TESTS_DIR}/constraints/all_ns_must_have_label_provided_vapbinding_scoped.yaml wait_for_process ${WAIT_TIME} ${SLEEP_TIME} "kubectl delete --ignore-not-found -f ${BATS_TESTS_DIR}/templates/k8srequiredlabels_template_vap.yaml" - wait_for_error ${WAIT_TIME} ${SLEEP_TIME} "kubectl get ValidatingAdmissionPolicyBinding all-must-have-label-scoped" - wait_for_error ${WAIT_TIME} ${SLEEP_TIME} "kubectl get ValidatingAdmissionPolicyBinding all-must-have-label" - wait_for_error ${WAIT_TIME} ${SLEEP_TIME} "kubectl get ValidatingAdmissionPolicyBinding gatekeeper-all-must-have-label-scoped" - wait_for_error ${WAIT_TIME} ${SLEEP_TIME} "kubectl get ValidatingAdmissionPolicyBinding gatekeeper-all-must-have-label" fi }