Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scripts/run_tests.sh: Add check dependencies #625

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions scripts/lib_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,33 @@ export NITRO_CLI_ARTIFACTS="$SCRIPTDIR/../build"
ARCH="$(uname -m)"
AWS_ACCOUNT_ID=667861386598

check_dependencies() {
# check we are root
if [ "${EUID}" -ne 0 ]
then
echo "The testing requires the capabilities to load and unload kernel modules. Please run as root."
exit 1
fi

# Check that docker is available
if ! type docker; then
echo "Could not find docker installed. Please ensure you have docker installed and reachable through your PATH."
exit 1
fi

# ...and usable
if ! docker ps; then
echo "Docker seems to be not functional. Please ensure docker can be used by $USER."
exit 1
fi

# The testing relies on pytest-3 for orchestration. Ensure we have that installed.
if ! type pytest-3; then
echo "Could not find pytest-3 installed. Please ensure you have pytest-3 installed and reachable through your PATH."
exit 1
fi
}

test_start() {
TEST_SUITES_TOTAL=$((TEST_SUITES_TOTAL + 1))
}
Expand Down
2 changes: 2 additions & 0 deletions scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ source "$SCRIPTDIR/lib_tests.sh"

trap test_failed ERR

check_dependencies

# Build and install NE CLI
build_and_install

Expand Down