Files
kata-containers/tests/functional/kata-agent-apis/run-agent-api-tests.sh
Fabiano Fidêncio 9ee4ef9ac0 tests: Fix shellcheck issues in run-agent-api-tests.sh
Fix shellcheck warnings and notes identified by running
shellcheck --severity=style.

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2026-04-24 08:14:08 +02:00

64 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Copyright (c) 2024 Microsoft Corporation
#
# SPDX-License-Identifier: Apache-2.0
set -e
kata_agent_apis_dir="$(dirname "$(readlink -f "$0")")"
# shellcheck source=/dev/null
source "${kata_agent_apis_dir}/../../common.bash"
# shellcheck source=/dev/null
source "${kata_agent_apis_dir}/setup_common.sh"
usage()
{
# shellcheck disable=SC2154
cat <<EOF
Usage: ${script_name} [<command>]
Summary: Test agent ttrpc apis using agent-ctl tool.
Description: Test agent exposed ttrpc api endpoints using agent-ctl tool.
A number of variations of the inputs are used to test an inidividual api
to validate success & failure code paths.
Commands:
help - Show usage.
Notes:
- Currently, the script *does not support* running individual agent api tests.
EOF
}
run_tests() {
info "Running agent API tests"
bats "${kata_agent_apis_dir}/api-tests"
}
main()
{
local cmd="${1:-}"
case "${cmd}" in
help|-h|-help|--help) usage; exit 0;;
esac
trap cleanup EXIT
install_policy_doc
try_and_remove_coco_attestation_procs
setup_agent
run_tests
}
main "$@"