tests: k8s: reduce policy testing complexity

Don't add the "allow all" policy to all the test YAML files anymore.

After this change, the k8s tests assume that all the Kata CI Guest
rootfs image files either:

- Don't support Agent Policy at all, or
- Include an "allow all" default policy.

This relience/assumption will be addressed in a future commit.

Fixes: #9395

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
This commit is contained in:
Dan Mihai
2024-04-02 16:18:31 +00:00
parent 7795f9c016
commit 39805822fc

View File

@@ -131,14 +131,6 @@ add_policy_to_yaml() {
esac
}
add_policy_to_successful_tests() {
info "Add policy to test YAML files"
for K8S_TEST_YAML in runtimeclass_workloads_work/*.yaml
do
add_policy_to_yaml "${K8S_TEST_YAML}"
done
}
test_successful_actions() {
info "Test actions that must be successful"
for K8S_TEST_ENTRY in ${K8S_TEST_UNION[@]}
@@ -169,7 +161,6 @@ fi
if policy_tests_enabled; then
ensure_yq
run_policy_specific_tests
add_policy_to_successful_tests
else
info "Policy tests are disabled on this platform"
fi