diff mbox series

[v3,09/10] shell: Add test for TST_ALL_FILESYSTEMS=1

Message ID 20220804121946.19564-10-pvorel@suse.cz
State Superseded
Headers show
Series [v3,01/10] tst_test.sh: Fix tst_mkfs() for tmpfs | expand

Commit Message

Petr Vorel Aug. 4, 2022, 12:19 p.m. UTC
Unfortunately GitHub Actions don't have loop devices, thus cannot be run
in CI:

tst_format_device 1 TINFO: timeout per run is 0h 5m 0s
/__w/ltp/ltp/lib/tst_device.c:139: TINFO: No free devices found

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Reviewed-by: Li Wang <liwang@redhat.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 lib/newlib_tests/shell/tst_all_filesystems.sh | 27 +++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100755 lib/newlib_tests/shell/tst_all_filesystems.sh

Comments

Richard Palethorpe Sept. 2, 2022, 9:40 a.m. UTC | #1
Hi,

Acked-by: Richard Palethorpe <rpalethorpe@suse.com>

Petr Vorel <pvorel@suse.cz> writes:

> Unfortunately GitHub Actions don't have loop devices, thus cannot be run
> in CI:
>
> tst_format_device 1 TINFO: timeout per run is 0h 5m 0s
> /__w/ltp/ltp/lib/tst_device.c:139: TINFO: No free devices found
>
> Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
> Reviewed-by: Li Wang <liwang@redhat.com>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  lib/newlib_tests/shell/tst_all_filesystems.sh | 27 +++++++++++++++++++
>  1 file changed, 27 insertions(+)
>  create mode 100755 lib/newlib_tests/shell/tst_all_filesystems.sh
>
> diff --git a/lib/newlib_tests/shell/tst_all_filesystems.sh b/lib/newlib_tests/shell/tst_all_filesystems.sh
> new file mode 100755
> index 000000000..8509a7481
> --- /dev/null
> +++ b/lib/newlib_tests/shell/tst_all_filesystems.sh
> @@ -0,0 +1,27 @@
> +#!/bin/sh
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +# Copyright (c) 2022 Petr Vorel <pvorel@suse.cz>
> +
> +TST_ALL_FILESYSTEMS=1
> +TST_TESTFUNC=test
> +TST_CNT=2
> +
> +test1()
> +{
> +	tst_res TPASS "device using filesystem"
> +}
> +
> +test2()
> +{
> +	local pattern
> +
> +
> +	if [ "$TST_FS_TYPE" = "exfat" -o "$TST_FS_TYPE" = "ntfs" ]; then
> +		pattern="|fuseblk"
> +	fi
> +
> +	EXPECT_PASS "grep -E '$TST_MNTPOINT ($TST_FS_TYPE${pattern})' /proc/mounts"
> +}
> +
> +. tst_test.sh
> +tst_run
> -- 
> 2.37.1
diff mbox series

Patch

diff --git a/lib/newlib_tests/shell/tst_all_filesystems.sh b/lib/newlib_tests/shell/tst_all_filesystems.sh
new file mode 100755
index 000000000..8509a7481
--- /dev/null
+++ b/lib/newlib_tests/shell/tst_all_filesystems.sh
@@ -0,0 +1,27 @@ 
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2022 Petr Vorel <pvorel@suse.cz>
+
+TST_ALL_FILESYSTEMS=1
+TST_TESTFUNC=test
+TST_CNT=2
+
+test1()
+{
+	tst_res TPASS "device using filesystem"
+}
+
+test2()
+{
+	local pattern
+
+
+	if [ "$TST_FS_TYPE" = "exfat" -o "$TST_FS_TYPE" = "ntfs" ]; then
+		pattern="|fuseblk"
+	fi
+
+	EXPECT_PASS "grep -E '$TST_MNTPOINT ($TST_FS_TYPE${pattern})' /proc/mounts"
+}
+
+. tst_test.sh
+tst_run