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

     1  #
     2  # Copyright (c) 2018 Intel Corporation
     3  #
     4  # SPDX-License-Identifier: Apache-2.0
     5  #
     6  
     7  load "${BATS_TEST_DIRNAME}/../../.ci/lib.sh"
     8  load "${BATS_TEST_DIRNAME}/tests_common.sh"
     9  
    10  setup() {
    11  	get_pod_config_dir
    12  }
    13  
    14  @test "Pod quota" {
    15  	resource_name="pod-quota"
    16  	deployment_name="deploymenttest"
    17  	namespace="test-quota-ns"
    18  
    19  	# Create the resourcequota
    20  	kubectl create -f "${pod_config_dir}/resource-quota.yaml"
    21  
    22  	# View information about resourcequota
    23  	kubectl get -n "$namespace" resourcequota "$resource_name" \
    24  		--output=yaml | grep 'pods: "2"'
    25  
    26  	# Create deployment
    27  	kubectl create -f "${pod_config_dir}/pod-quota-deployment.yaml"
    28  
    29  	# View deployment
    30  	kubectl wait --for=condition=Available --timeout=$timeout \
    31  		-n "$namespace" deployment/${deployment_name}
    32  }
    33  
    34  teardown() {
    35  	kubectl delete -n "$namespace" deployment "$deployment_name"
    36  	kubectl delete -f "${pod_config_dir}/resource-quota.yaml"
    37  }