tests: k8s-security-context.bats allow all policy

Use the "allow all" policy for k8s-security-context.bats, instead of
relying on the Kata Guest image to use the same policy as its default.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
This commit is contained in:
Dan Mihai
2024-04-02 19:38:20 +00:00
parent 02a050b47e
commit 839993f245

View File

@@ -10,13 +10,16 @@ load "${BATS_TEST_DIRNAME}/tests_common.sh"
setup() { setup() {
get_pod_config_dir get_pod_config_dir
yaml_file="${pod_config_dir}/pod-security-context.yaml"
add_allow_all_policy_to_yaml "${yaml_file}"
} }
@test "Security context" { @test "Security context" {
pod_name="security-context-test" pod_name="security-context-test"
# Create pod # Create pod
kubectl create -f "${pod_config_dir}/pod-security-context.yaml" kubectl create -f "${yaml_file}"
# Check pod creation # Check pod creation
kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name" kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"