mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-12 22:58:58 +00:00
This test was fixed by previous patches in this PR: kata-containers#9695 Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
40 lines
767 B
Bash
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"
|
|
}
|