Files
kata-containers/tests/integration/kubernetes/k8s-pod-quota.bats
Dan Mihai bf21411e90 tests: add policy to k8s tests
Use AGENT_POLICY=yes when building the Guest images, and add a
permissive test policy to the k8s tests for:
- CBL-Mariner
- SEV
- SNP
- TDX

Also, add an example of policy rejecting ExecProcessRequest.

Fixes: #7667

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2023-09-01 14:28:08 +00:00

41 lines
927 B
Bash

#
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
load "${BATS_TEST_DIRNAME}/../../common.bash"
load "${BATS_TEST_DIRNAME}/tests_common.sh"
setup() {
get_pod_config_dir
}
@test "Pod quota" {
resource_name="pod-quota"
deployment_name="deploymenttest"
# Create the resourcequota
kubectl create -f "${pod_config_dir}/resource-quota.yaml"
# View information about resourcequota
kubectl get resourcequota "$resource_name" \
--output=yaml | grep 'pods: "2"'
# Create deployment
kubectl create -f "${pod_config_dir}/pod-quota-deployment.yaml"
# View deployment
kubectl wait --for=condition=Available --timeout=$timeout \
deployment/${deployment_name}
}
teardown() {
# Debugging information
kubectl describe deployment ${deployment_name}
# Clean-up
kubectl delete -f "${pod_config_dir}/pod-quota-deployment.yaml"
kubectl delete -f "${pod_config_dir}/resource-quota.yaml"
}