kata-containers/tests/integration/kubernetes/k8s-sysctls.bats
ChengyuZhu6 93453c37d6 tests: Re-enable k8s-sysctls.bats
This test was fixed by previous patches in this PR: kata-containers#9695

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-07-05 08:10:04 +08:00

40 lines
767 B
Bash

#!/usr/bin/env bats
#
# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
load "${BATS_TEST_DIRNAME}/../../common.bash"
load "${BATS_TEST_DIRNAME}/tests_common.sh"
setup() {
pod_name="sysctl-test"
get_pod_config_dir
yaml_file="${pod_config_dir}/pod-sysctl.yaml"
add_allow_all_policy_to_yaml "${yaml_file}"
}
@test "Setting sysctl" {
# Create pod
kubectl apply -f "${yaml_file}"
# Check pod creation
kubectl wait --for=condition=Ready --timeout=$timeout pod $pod_name
# Check sysctl configuration
cmd="cat /proc/sys/kernel/shm_rmid_forced"
result=$(kubectl exec $pod_name -- sh -c "$cmd")
[ "${result}" = 0 ]
}
teardown() {
# Debugging information
kubectl describe "pod/$pod_name"
kubectl delete pod "$pod_name"
}