github.com/dmaizel/tests@v0.0.0-20210728163746-cae6a2d9cee8/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  	export KUBECONFIG="${KUBECONFIG:-$HOME/.kube/config}"
    12  	get_pod_config_dir
    13  }
    14  
    15  @test "Pod quota" {
    16  	resource_name="pod-quota"
    17  	deployment_name="deploymenttest"
    18  
    19  	# Create the resourcequota
    20  	kubectl create -f "${pod_config_dir}/resource-quota.yaml"
    21  
    22  	# View information about resourcequota
    23  	kubectl get resourcequota "$resource_name" --output=yaml | grep 'pods: "2"'
    24  
    25  	# Create deployment
    26  	kubectl create -f "${pod_config_dir}/pod-quota-deployment.yaml"
    27  
    28  	# View deployment
    29  	kubectl wait --for=condition=Available --timeout=$timeout deployment/${deployment_name}
    30  }
    31  
    32  teardown() {
    33  	kubectl delete resourcequota "$resource_name"
    34  	kubectl delete deployment "$deployment_name"
    35  }