btrfs-progs/tests/check-setup.sh
David Sterba 835526b120 btrfs-progs: tests: add script to check global prerequisities
Check for each test directory if the utilities requested by
check_global_prereq can be found on the system.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-08-11 19:59:29 +02:00

24 lines
536 B
Bash
Executable File

#!/bin/bash
#
# Check that the system setup and configuration are sufficient for all tests to run
for dir in *-tests; do
missing=
echo "Checking prerequisities for: $dir"
for prog in $(find "$dir" -name 'test.sh' -exec grep check_global_prereq '{}' \; | sort -u); do
if [ "$prog" = check_global_prereq ]; then
continue
fi
if type -p "$prog" &> /dev/null; then
echo "Check $prog: OK"
else
echo "Check $prog: MISSING"
missing+=" $prog"
fi
done
if ! [ -z "$missing" ]; then
echo "MISSING: $missing"
fi
done