diff mbox series

[testsuite,2/3] tests/filesystem: pipe "yes" to mkfs.* to fix jfs test

Message ID 20201031115601.157591-3-omosnace@redhat.com (mailing list archive)
State Superseded
Headers show
Series Test all filesystems by default | expand

Commit Message

Ondrej Mosnacek Oct. 31, 2020, 11:56 a.m. UTC
mkfs.jfs is reluctant to overwrite the device without the user's
consent, so shout a stream of y's on it to avoid the test getting stuck.
We can't universally pass -q to mkfs.*, because not all mkfs.* tools
support it.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
---
 tests/filesystem/Filesystem.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tests/filesystem/Filesystem.pm b/tests/filesystem/Filesystem.pm
index 2365ce8..c14e760 100644
--- a/tests/filesystem/Filesystem.pm
+++ b/tests/filesystem/Filesystem.pm
@@ -133,7 +133,7 @@  sub make_fs {
     attach_dev( $mk_dev, $mk_dir );
 
     print "Make $mk_type filesystem on $mk_dev\n";
-    $result = system("mkfs.$mk_type $mk_dev >& /dev/null");
+    $result = system("yes | mkfs.$mk_type $mk_dev >& /dev/null");
     if ( $result != 0 ) {
         system("losetup -d $mk_dev 2>/dev/null");
         print "mkfs.$mk_type failed to create filesystem on $mk_dev\n";