Files
kata-containers/tests/integration/kubernetes/k8s-memory.bats
Fabiano Fidêncio cda6c8c6e0 tests: raise k8s memory/QoS pod limits for TEE runtime-rs CI
Increase memory request/limit values used by k8s memory and QoS
integration workloads so SNP/TDX static-sized sandboxes boot reliably
under the new sizing defaults.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2026-06-11 22:03:36 +02:00

69 lines
1.5 KiB
Bash

#!/usr/bin/env bats
#
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
load "${BATS_TEST_DIRNAME}/lib.sh"
load "${BATS_TEST_DIRNAME}/../../common.bash"
load "${BATS_TEST_DIRNAME}/tests_common.sh"
setup() {
setup_common || die "setup_common failed"
pod_name="memory-test"
}
setup_yaml() {
sed \
-e "s/\${memory_size}/${memory_limit_size}/" \
-e "s/\${memory_allocated}/${allocated_size}/" \
"${pod_config_dir}/pod-memory-limit.yaml"
}
@test "Exceeding memory constraints" {
memory_limit_size="50Mi"
allocated_size="250M"
# Create test .yaml
test_yaml="${pod_config_dir}/test_exceed_memory.yaml"
setup_yaml > "${test_yaml}"
# Add policy to yaml file
auto_generate_policy "${pod_config_dir}" "${test_yaml}"
# Create the pod exceeding memory constraints
run kubectl create -f "${test_yaml}"
[ "$status" -ne 0 ]
rm -f "${test_yaml}"
}
@test "Running within memory constraints" {
memory_limit_size="800Mi"
allocated_size="150M"
# Create test .yaml
test_yaml="${pod_config_dir}/test_within_memory.yaml"
setup_yaml > "${test_yaml}"
# Add policy to yaml file
auto_generate_policy "${pod_config_dir}" "${test_yaml}"
# Create the pod within memory constraints
kubectl create -f "${test_yaml}"
# Check pod creation
kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"
rm -f "${test_yaml}"
kubectl delete pod "$pod_name"
}
teardown() {
# Debugging information
kubectl describe "pod/$pod_name" || true
teardown_common "${node}" "${node_start_time:-}"
}