mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-13 21:56:32 +00:00
Let's keep both checks for now, but in the future we'll be able to
remove the check for "firecracker", as the hypervisor name used as part
of the GitHub Actions has to match what's used as part of the
kata-deploy stuff, which is `fc` (as in `kata-fc for the runtime class)
instead of `firecracker`.
Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
(cherry picked from commit 3cc20b47a6
)
42 lines
1.3 KiB
Bash
42 lines
1.3 KiB
Bash
#!/usr/bin/env bats
|
|
#
|
|
# Copyright (c) 2021 IBM Corporation
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
load "${BATS_TEST_DIRNAME}/../../common.bash"
|
|
load "${BATS_TEST_DIRNAME}/tests_common.sh"
|
|
|
|
setup() {
|
|
[ "${KATA_HYPERVISOR}" == "firecracker" ] && skip "test not working see: ${fc_limitations}"
|
|
[ "${KATA_HYPERVISOR}" == "fc" ] && skip "test not working see: ${fc_limitations}"
|
|
|
|
get_pod_config_dir
|
|
|
|
pod_name="nested-configmap-secret-pod"
|
|
}
|
|
|
|
@test "Nested mount of a secret volume in a configmap volume for a pod" {
|
|
# Creates a configmap, secret and pod that mounts the secret inside the configmap
|
|
kubectl create -f "${pod_config_dir}/pod-nested-configmap-secret.yaml"
|
|
|
|
# Check pod creation
|
|
kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name"
|
|
|
|
# Check config/secret value are correct
|
|
[ "myconfig" == $(kubectl exec $pod_name -- cat /config/config_key) ]
|
|
[ "mysecret" == $(kubectl exec $pod_name -- cat /config/secret/secret_key) ]
|
|
}
|
|
|
|
teardown() {
|
|
[ "${KATA_HYPERVISOR}" == "firecracker" ] && skip "test not working see: ${fc_limitations}"
|
|
[ "${KATA_HYPERVISOR}" == "fc" ] && skip "test not working see: ${fc_limitations}"
|
|
|
|
# Debugging information
|
|
kubectl describe "pod/$pod_name"
|
|
|
|
# Delete the configmap, secret, and pod used for testing
|
|
kubectl delete -f "${pod_config_dir}/pod-nested-configmap-secret.yaml"
|
|
}
|