openbao-helm/test/chart/_helpers.bash
Jan Martens 5fba05f8f8
fix chart verifier tests
Signed-off-by: Jan Martens <jan@martens.eu.org>
2024-09-04 23:51:48 +02:00

21 lines
562 B
Bash

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
# chart_dir returns the directory for the chart
chart_dir() {
echo ${BATS_TEST_DIRNAME}/../../charts/openbao
}
# check_result checks if the specified test passed
# results schema example:
# {
# "check": "has-minkubeversion",
# "type": "Mandatory",
# "outcome": "PASS",
# "reason": "Minimum Kubernetes version specified"
# }
check_result() {
local -r var="$1"
local check=$(cat $VERIFY_OUTPUT | jq -r ".results[] | select(.check==\"${var}\").outcome")
[ "$check" = "PASS" ]
}