tests/runk: convert to bats

Migrated runk tests from pure shell script to bats to be consistent with
other test suites.

The install_dependencies() will install the bats tool locally.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
This commit is contained in:
Wainer dos Santos Moschetta
2024-02-02 16:12:33 -03:00
parent bb5e33b33a
commit 8a606eb94d
3 changed files with 126 additions and 104 deletions

View File

@@ -12,6 +12,7 @@ set -o pipefail
kata_tarball_dir="${2:-kata-artifacts}"
runk_dir="$(dirname "$(readlink -f "$0")")"
source "${runk_dir}/../../common.bash"
source "${runk_dir}/../../gha-run-k8s-common.sh"
function install_dependencies() {
info "Installing the dependencies needed for running the runk tests"
@@ -38,12 +39,15 @@ function install_dependencies() {
IFS=":" read -r -a dep <<< "${github_dep}"
install_${dep[0]} "${dep[1]}"
done
# Requires bats to run the tests
install_bats
}
function run() {
info "Running runk tests using"
bash -c ${runk_dir}/runk-tests.sh
bats "${runk_dir}/runk-tests.bats"
}
function main() {