github.com/dmaizel/tests@v0.0.0-20210728163746-cae6a2d9cee8/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  issue="https://github.com/kata-containers/runtime/issues/1127"
    12  memory_issue="https://github.com/kata-containers/runtime/issues/1249"
    13  
    14  setup() {
    15  	skip "test not working see: ${issue}, ${memory_issue}"
    16  	export KUBECONFIG="${KUBECONFIG:-$HOME/.kube/config}"
    17  	get_pod_config_dir
    18  }
    19  
    20  @test "Guaranteed QoS" {
    21  	skip "test not working see: ${issue}, ${memory_issue}"
    22  
    23  	pod_name="qos-test"
    24  
    25  	# Create pod
    26  	kubectl create -f "${pod_config_dir}/pod-guaranteed.yaml"
    27  
    28  	# Check pod creation
    29  	kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"
    30  
    31  	# Check pod class
    32  	kubectl get pod "$pod_name" --output=yaml | grep "qosClass: Guaranteed"
    33  }
    34  
    35  @test "Burstable QoS" {
    36  	skip "test not working see: ${issue}, ${memory_issue}"
    37  
    38  	pod_name="burstable-test"
    39  
    40  	# Create pod
    41  	kubectl create -f "${pod_config_dir}/pod-burstable.yam"l
    42  
    43  	# Check pod creation
    44  	kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"
    45  
    46  	# Check pod class
    47  	kubectl get pod "$pod_name" --output=yaml | grep "qosClass: Burstable"
    48  }
    49  
    50  @test "BestEffort QoS" {
    51  	skip "test not working see: ${issue}, ${memory_issue}"
    52  	pod_name="besteffort-test"
    53  
    54  	# Create pod
    55  	kubectl create -f "${pod_config_dir}/pod-besteffort.yam"l
    56  
    57  	# Check pod creation
    58  	kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"
    59  
    60  	# Check pod class
    61  	kubectl get pod "$pod_name" --output=yaml | grep "qosClass: BestEffort"
    62  }
    63  
    64  teardown() {
    65  	skip "test not working see: ${issue}, ${memory_issue}"
    66  	kubectl delete pod "$pod_name"
    67  }