mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-02 00:02:01 +00:00
tests: k8s: k8s-qos-pods auto-generated policy
Auto-generate policy for k8s-qos-pods.bats. Fixes: #9096 Signed-off-by: Dan Mihai <dmihai@microsoft.com>
This commit is contained in:
parent
0179f53469
commit
56689c6800
@ -16,9 +16,15 @@ setup() {
|
||||
|
||||
@test "Guaranteed QoS" {
|
||||
pod_name="qos-test"
|
||||
yaml_file="${pod_config_dir}/pod-guaranteed.yaml"
|
||||
|
||||
# Add policy to the yaml file
|
||||
policy_settings_dir="$(create_tmp_policy_settings_dir "${pod_config_dir}")"
|
||||
add_requests_to_policy_settings "${policy_settings_dir}" "ReadStreamRequest"
|
||||
auto_generate_policy "${policy_settings_dir}" "${yaml_file}"
|
||||
|
||||
# Create pod
|
||||
kubectl create -f "${pod_config_dir}/pod-guaranteed.yaml"
|
||||
kubectl create -f "${yaml_file}"
|
||||
|
||||
# Check pod creation
|
||||
kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"
|
||||
@ -29,9 +35,15 @@ setup() {
|
||||
|
||||
@test "Burstable QoS" {
|
||||
pod_name="burstable-test"
|
||||
yaml_file="${pod_config_dir}/pod-burstable.yaml"
|
||||
|
||||
# Add policy to the yaml file
|
||||
policy_settings_dir="$(create_tmp_policy_settings_dir "${pod_config_dir}")"
|
||||
add_requests_to_policy_settings "${policy_settings_dir}" "ReadStreamRequest"
|
||||
auto_generate_policy "${policy_settings_dir}" "${yaml_file}"
|
||||
|
||||
# Create pod
|
||||
kubectl create -f "${pod_config_dir}/pod-burstable.yaml"
|
||||
kubectl create -f "${yaml_file}"
|
||||
|
||||
# Check pod creation
|
||||
kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"
|
||||
@ -42,9 +54,15 @@ setup() {
|
||||
|
||||
@test "BestEffort QoS" {
|
||||
pod_name="besteffort-test"
|
||||
yaml_file="${pod_config_dir}/pod-besteffort.yaml"
|
||||
|
||||
# Add policy to the yaml file
|
||||
policy_settings_dir="$(create_tmp_policy_settings_dir "${pod_config_dir}")"
|
||||
add_requests_to_policy_settings "${policy_settings_dir}" "ReadStreamRequest"
|
||||
auto_generate_policy "${policy_settings_dir}" "${yaml_file}"
|
||||
|
||||
# Create pod
|
||||
kubectl create -f "${pod_config_dir}/pod-besteffort.yaml"
|
||||
kubectl create -f "${yaml_file}"
|
||||
|
||||
# Check pod creation
|
||||
kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"
|
||||
@ -55,4 +73,5 @@ setup() {
|
||||
|
||||
teardown() {
|
||||
kubectl delete pod "$pod_name"
|
||||
delete_tmp_policy_settings_dir "${policy_settings_dir}"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user