openbao-helm/test/chart/_helpers.bash

22 lines
547 B
Bash
Raw Normal View History

2023-02-13 16:48:20 +00:00
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
# chart_dir returns the directory for the chart
chart_dir() {
echo ${BATS_TEST_DIRNAME}/../..
}
# 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" ]
}