mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-18 06:44:23 +01:00
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>
41 lines
927 B
Bash
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"
|
|
}
|