github.com/kata-containers/tests@v0.0.0-20240307153542-772105b56064/integration/kubernetes/k8s-qos-pods.bats (about)

     1  #!/usr/bin/env bats
     2  #
     3  # Copyright (c) 2018 Intel Corporation
     4  #
     5  # SPDX-License-Identifier: Apache-2.0
     6  #
     7  
     8  load "${BATS_TEST_DIRNAME}/../../.ci/lib.sh"
     9  load "${BATS_TEST_DIRNAME}/tests_common.sh"
    10  TEST_INITRD="${TEST_INITRD:-no}"
    11  
    12  # Not working on ARM CI see https://github.com/kata-containers/tests/issues/4727  
    13  setup() {
    14  	get_pod_config_dir
    15  }
    16  
    17  @test "Guaranteed QoS" {
    18  	pod_name="qos-test"
    19  
    20  	# Create pod
    21  	kubectl create -f "${pod_config_dir}/pod-guaranteed.yaml"
    22  
    23  	# Check pod creation
    24  	kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"
    25  
    26  	# Check pod class
    27  	kubectl get pod "$pod_name" --output=yaml | grep "qosClass: Guaranteed"
    28  }
    29  
    30  @test "Burstable QoS" {
    31  	pod_name="burstable-test"
    32  
    33  	# Create pod
    34  	kubectl create -f "${pod_config_dir}/pod-burstable.yaml"
    35  
    36  	# Check pod creation
    37  	kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"
    38  
    39  	# Check pod class
    40  	kubectl get pod "$pod_name" --output=yaml | grep "qosClass: Burstable"
    41  }
    42  
    43  @test "BestEffort QoS" {
    44  	pod_name="besteffort-test"
    45  
    46  	# Create pod
    47  	kubectl create -f "${pod_config_dir}/pod-besteffort.yaml"
    48  
    49  	# Check pod creation
    50  	kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"
    51  
    52  	# Check pod class
    53  	kubectl get pod "$pod_name" --output=yaml | grep "qosClass: BestEffort"
    54  }
    55  
    56  teardown() {
    57  	kubectl delete pod "$pod_name"
    58  }