diff mbox series

[2/5] ext4/044: skip test if the file system does not have a journal

Message ID 20220625030718.1215980-3-tytso@mit.edu (mailing list archive)
State New, archived
Headers show
Series Misceillaneous ext4 test fix ups | expand

Commit Message

Theodore Ts'o June 25, 2022, 3:07 a.m. UTC
This test mounts the file system using "mount -t ext3"; if the file
system config creates the file system without the jbd2 journal, the
"mount -t ext3" will fail.  So skip this test in that case.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 tests/ext4/044 | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Zorro Lang June 28, 2022, 4:28 a.m. UTC | #1
On Fri, Jun 24, 2022 at 11:07:15PM -0400, Theodore Ts'o wrote:
> This test mounts the file system using "mount -t ext3"; if the file
> system config creates the file system without the jbd2 journal, the
> "mount -t ext3" will fail.  So skip this test in that case.
> 
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> ---
>  tests/ext4/044 | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/tests/ext4/044 b/tests/ext4/044
> index 46e44053..fd27ae2d 100755
> --- a/tests/ext4/044
> +++ b/tests/ext4/044
> @@ -16,11 +16,17 @@ _begin_fstest auto quick
>  _supported_fs ext4
>  _require_scratch
>  _require_test_program "t_get_file_time"
> +_require_dumpe2fs
>  
>  echo "Silence is golden"
>  
>  echo "Test timestamps with 256 inode size one device $SCRATCH_DEV" >$seqres.full
>  _scratch_mkfs -t ext3 -I 256 >> $seqres.full 2>&1
> +
> +$DUMPE2FS_PROG -h $SCRATCH_DEV 2>> $seqres.full | grep '^Filesystem features' | grep -q has_journal
> +if [ $? -ne 0 ]; then
> +    _notrun "ext4 file system formatted without a journal"
> +fi

Can _has_metadata_journaling help that?

Thanks,
Zorro

>  _scratch_mount
>  
>  # Create file
> -- 
> 2.31.0
>
Zorro Lang June 28, 2022, 4:32 a.m. UTC | #2
On Tue, Jun 28, 2022 at 12:28:17PM +0800, Zorro Lang wrote:
> On Fri, Jun 24, 2022 at 11:07:15PM -0400, Theodore Ts'o wrote:
> > This test mounts the file system using "mount -t ext3"; if the file
> > system config creates the file system without the jbd2 journal, the
> > "mount -t ext3" will fail.  So skip this test in that case.
> > 
> > Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> > ---
> >  tests/ext4/044 | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/tests/ext4/044 b/tests/ext4/044
> > index 46e44053..fd27ae2d 100755
> > --- a/tests/ext4/044
> > +++ b/tests/ext4/044
> > @@ -16,11 +16,17 @@ _begin_fstest auto quick
> >  _supported_fs ext4
> >  _require_scratch
> >  _require_test_program "t_get_file_time"
> > +_require_dumpe2fs
> >  
> >  echo "Silence is golden"
> >  
> >  echo "Test timestamps with 256 inode size one device $SCRATCH_DEV" >$seqres.full
> >  _scratch_mkfs -t ext3 -I 256 >> $seqres.full 2>&1
> > +
> > +$DUMPE2FS_PROG -h $SCRATCH_DEV 2>> $seqres.full | grep '^Filesystem features' | grep -q has_journal
> > +if [ $? -ne 0 ]; then
> > +    _notrun "ext4 file system formatted without a journal"
> > +fi
> 
> Can _has_metadata_journaling help that?

Or use _require_metadata_journaling directly?

> 
> Thanks,
> Zorro
> 
> >  _scratch_mount
> >  
> >  # Create file
> > -- 
> > 2.31.0
> >
Theodore Ts'o June 28, 2022, 6:20 p.m. UTC | #3
On Tue, Jun 28, 2022 at 12:32:29PM +0800, Zorro Lang wrote:
> > 
> > Can _has_metadata_journaling help that?
> 
> Or use _require_metadata_journaling directly?

Yep, that's just what we need.  I'll fix this in the next version of
these patches.

						- Ted
diff mbox series

Patch

diff --git a/tests/ext4/044 b/tests/ext4/044
index 46e44053..fd27ae2d 100755
--- a/tests/ext4/044
+++ b/tests/ext4/044
@@ -16,11 +16,17 @@  _begin_fstest auto quick
 _supported_fs ext4
 _require_scratch
 _require_test_program "t_get_file_time"
+_require_dumpe2fs
 
 echo "Silence is golden"
 
 echo "Test timestamps with 256 inode size one device $SCRATCH_DEV" >$seqres.full
 _scratch_mkfs -t ext3 -I 256 >> $seqres.full 2>&1
+
+$DUMPE2FS_PROG -h $SCRATCH_DEV 2>> $seqres.full | grep '^Filesystem features' | grep -q has_journal
+if [ $? -ne 0 ]; then
+    _notrun "ext4 file system formatted without a journal"
+fi
 _scratch_mount
 
 # Create file