From 835526b1201e1d86b923cb536dbfd5c655669a5d Mon Sep 17 00:00:00 2001 From: David Sterba Date: Thu, 27 Jul 2023 20:28:45 +0200 Subject: [PATCH] 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 --- tests/check-setup.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 tests/check-setup.sh diff --git a/tests/check-setup.sh b/tests/check-setup.sh new file mode 100755 index 00000000..15890cf3 --- /dev/null +++ b/tests/check-setup.sh @@ -0,0 +1,23 @@ +#!/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