mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-03 18:47:03 +00:00
tests: k8s: k8s-custom-dns auto-generated policy
Auto-generate policy for k8s-custom-dns.bats. Fixes: #9072 Signed-off-by: Dan Mihai <dmihai@microsoft.com>
This commit is contained in:
parent
f693f49e92
commit
0a4fc071ac
@ -69,4 +69,6 @@ teardown() {
|
||||
|
||||
kubectl delete pod "$pod_name" "$second_pod_name"
|
||||
kubectl delete secret "$secret_name"
|
||||
|
||||
delete_tmp_policy_settings_dir "${policy_settings_dir}"
|
||||
}
|
||||
|
@ -12,11 +12,21 @@ setup() {
|
||||
pod_name="custom-dns-test"
|
||||
file_name="/etc/resolv.conf"
|
||||
get_pod_config_dir
|
||||
yaml_file="${pod_config_dir}/pod-custom-dns.yaml"
|
||||
|
||||
# Add policy to the yaml file
|
||||
policy_settings_dir="$(create_tmp_policy_settings_dir "${pod_config_dir}")"
|
||||
|
||||
exec_command="cat ${file_name}"
|
||||
add_exec_to_policy_settings "${policy_settings_dir}" "${exec_command}"
|
||||
add_requests_to_policy_settings "${policy_settings_dir}" "ReadStreamRequest"
|
||||
|
||||
auto_generate_policy "${policy_settings_dir}" "${yaml_file}"
|
||||
}
|
||||
|
||||
@test "Check custom dns" {
|
||||
# Create the pod
|
||||
kubectl create -f "${pod_config_dir}/pod-custom-dns.yaml"
|
||||
kubectl create -f "${yaml_file}"
|
||||
|
||||
# Check pod creation
|
||||
kubectl wait --for=condition=Ready --timeout=$timeout pod $pod_name
|
||||
@ -31,4 +41,6 @@ teardown() {
|
||||
kubectl describe "pod/$pod_name"
|
||||
|
||||
kubectl delete pod "$pod_name"
|
||||
|
||||
delete_tmp_policy_settings_dir "${policy_settings_dir}"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user