ts_finalize_subtest
ts_init_subtest "is-mounted-btrfs"
-grep -q '#define HAVE_BTRFS_SUPPORT' ${top_builddir}/config.h || ts_skip "no btrfs support"
+ts_skip_config HAVE_BTRFS_SUPPORT "no btrfs support"
ts_run $TESTPROG --is-mounted "$TS_SELF/files/fstab_btrfs" "$TS_SELF/files/mountinfo_btrfs" &> "$TS_OUTPUT"
ts_finalize_subtest
ts_init "$*"
# ts_skip_nonroot
-grep -q '#define HAVE_LINUX_NSFS_H' ${top_builddir}/config.h || ts_skip "no ioctl_ns support"
+ts_skip_config HAVE_LINUX_NSFS_H "no ioctl_ns support"
[ -r /proc/self/ns/user ] || ts_skip "no USER namespace kernel support"
[ -r /proc/self/ns/pid ] || ts_skip "no PID namespace kernel support"
ts_check_prog "mkfifo"
ts_check_prog "sed"
-grep -q '#define HAVE_LINUX_NET_NAMESPACE_H' ${top_builddir}/config.h || ts_skip "no netns support"
+ts_skip_config HAVE_LINUX_NET_NAMESPACE_H "no netns support"
if [ "$($TS_HELPER_SYSINFO ns-gettype-ok)" == "0" ]; then
ts_skip "NS_GET_NSTYPE ioctl cmd not available"
ts_finalize_subtest
ts_init_subtest "invalid-ascii"
-if [ "$HAVE_WIDECHAR" = true ]; then
- $TS_HELPER_MBSENCODE --invalid "${STRINGS[@]}" >> "$TS_OUTPUT" 2>> "$TS_ERRLOG"
-else
- ts_skip 'No widechar support'
-fi
+ts_skip_config HAVE_WIDECHAR 'No widechar support'
+$TS_HELPER_MBSENCODE --invalid "${STRINGS[@]}" >> "$TS_OUTPUT" 2>> "$TS_ERRLOG"
ts_finalize_subtest
ts_init_subtest "safe-utf8"
-if [ "$HAVE_WIDECHAR" = true ]; then
- LC_ALL=C.UTF-8 \
- $TS_HELPER_MBSENCODE --safe "${STRINGS[@]}" >> "$TS_OUTPUT" 2>> "$TS_ERRLOG"
-else
- ts_skip 'No widechar support'
-fi
+ts_skip_config HAVE_WIDECHAR 'No widechar support'
+LC_ALL=C.UTF-8 \
+$TS_HELPER_MBSENCODE --safe "${STRINGS[@]}" >> "$TS_OUTPUT" 2>> "$TS_ERRLOG"
ts_finalize_subtest
ts_init_subtest "invalid-utf8"
-if [ "$HAVE_WIDECHAR" = true ]; then
- LC_ALL=C.UTF-8 \
- $TS_HELPER_MBSENCODE --invalid "${STRINGS[@]}" >> "$TS_OUTPUT" 2>> "$TS_ERRLOG"
-else
- ts_skip 'No widechar support'
-fi
+ts_skip_config HAVE_WIDECHAR 'No widechar support'
+LC_ALL=C.UTF-8 \
+$TS_HELPER_MBSENCODE --invalid "${STRINGS[@]}" >> "$TS_OUTPUT" 2>> "$TS_ERRLOG"
ts_finalize_subtest
ts_finalize
ts_check_prog "mksquashfs"
ts_check_prog "veritysetup"
-grep -q '#define HAVE_CRYPTSETUP' ${top_builddir}/config.h || ts_skip "no dm-verity support"
+ts_skip_config HAVE_CRYPTSETUP "no dm-verity support"
# Make a squashfs and prepare verity device out of it
mksquashfs $TS_SELF $SQUASHFS &>/dev/null || ts_skip "error: mksquashfs on $TS_SELF"