@@ -60,6 +60,8 @@ fi
build_root="$build_iotests/../.."
+export BUILDCONF="$build_root/scripts/buildconf.py"
+
if [ -x "$build_iotests/socket_scm_helper" ]
then
export SOCKET_SCM_HELPER="$build_iotests/socket_scm_helper"
@@ -470,6 +470,13 @@ _require_command()
[ -x "$c" ] || _notrun "$1 utility required, skipped this test"
}
+# tests whether a given configure time feature is enabled
+#
+_require_feature()
+{
+ $BUILDCONF -c -n $1 || _notrun "feature not enabled: $1"
+}
+
_full_imgfmt_details()
{
if [ -n "$IMGOPTS" ]; then
With the previously introduced buildconf.py script, it's possible to determine if a feature needed by a test is present or not. This adds a thin layer on top of scripts/buildconf.py, and allows tests to be skipped when a feature is required. The naming of the function, while different in tense from the _supported_* family of functions, was chosen to match the style of _require_command(), which seems pretty similar. Signed-off-by: Cleber Rosa <crosa@redhat.com> --- tests/qemu-iotests/check | 2 ++ tests/qemu-iotests/common.rc | 7 +++++++ 2 files changed, 9 insertions(+)