Re: [U-Boot] [PATCH v2 3/7] test: fs: run fsck after on fs image after the tests are run

2019-02-01 Thread Tom Rini
On Fri, Feb 01, 2019 at 06:00:15PM +0100, Jean-Jacques Hiblot wrote:
> 
> On 01/02/2019 16:18, Tom Rini wrote:
> >On Fri, Feb 01, 2019 at 03:33:36PM +0100, Jean-Jacques Hiblot wrote:
> >
> >>This is to check the integrity of the FS after the test operations.
> >>This is useful to make sure that the operations are implemented properly,
> >>and are not going to create silent corruptions.
> >>Currently only the integrity of EXT4 filesystems is checked.
> >>
> >>Signed-off-by: Jean-Jacques Hiblot 
> >>
> >>---
> >>
> >>Changes in v2:
> >>- Add a FS integrity check at the end of the FS tests
> >>
> >>  test/py/tests/test_fs/conftest.py | 13 +
> >>  1 file changed, 13 insertions(+)
> >>
> >>diff --git a/test/py/tests/test_fs/conftest.py 
> >>b/test/py/tests/test_fs/conftest.py
> >>index 745ed0ed38..e742cda662 100644
> >>--- a/test/py/tests/test_fs/conftest.py
> >>+++ b/test/py/tests/test_fs/conftest.py
> >>@@ -216,6 +216,15 @@ def mount_fs(fs_type, device, mount_point):
> >>  except CalledProcessError:
> >>  raise
> >>+
> >>+def fsck(img, fs_type):
> >>+try:
> >>+if fs_type == 'ext4':
> >>+check_call('fsck.ext4 -n -f %s' % img, shell=True)
> >>+except CalledProcessError:
> >>+raise
> >>+
> >>+
> >Why don't we just call 'fsck -f -n ...' and check all filesystems?
> 
> >Force and "make no changes" are both general fsck options and not
> 
> Strange. those options do not appear in the help or manpage.
> 
> I'll switch to fsck in the next version

Ugh, I take it back and blame myself.  You can't just do /sbin/fsck
--help and get something like I expected but didn't read closely enough
to see it was plumbing down to fsck.ext4.  So what you have above is
right and the it falls on me to add a patch to fsck.vfat or so later.

Reviewed-by: Tom Rini 

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/7] test: fs: run fsck after on fs image after the tests are run

2019-02-01 Thread Jean-Jacques Hiblot


On 01/02/2019 16:18, Tom Rini wrote:

On Fri, Feb 01, 2019 at 03:33:36PM +0100, Jean-Jacques Hiblot wrote:


This is to check the integrity of the FS after the test operations.
This is useful to make sure that the operations are implemented properly,
and are not going to create silent corruptions.
Currently only the integrity of EXT4 filesystems is checked.

Signed-off-by: Jean-Jacques Hiblot 

---

Changes in v2:
- Add a FS integrity check at the end of the FS tests

  test/py/tests/test_fs/conftest.py | 13 +
  1 file changed, 13 insertions(+)

diff --git a/test/py/tests/test_fs/conftest.py 
b/test/py/tests/test_fs/conftest.py
index 745ed0ed38..e742cda662 100644
--- a/test/py/tests/test_fs/conftest.py
+++ b/test/py/tests/test_fs/conftest.py
@@ -216,6 +216,15 @@ def mount_fs(fs_type, device, mount_point):
  except CalledProcessError:
  raise
  
+

+def fsck(img, fs_type):
+try:
+if fs_type == 'ext4':
+check_call('fsck.ext4 -n -f %s' % img, shell=True)
+except CalledProcessError:
+raise
+
+

Why don't we just call 'fsck -f -n ...' and check all filesystems?
Force and "make no changes" are both general fsck options and not
filesystem specific.  And if we're messing up FAT as part of the tests
we should know that now :)


When I tried to enable fsck on all FS, I discovered that calling fsck() 
at this point won't work.


This is because of the "life-cycle" of pytest fixtures works. How it is 
done today makes failure report unreliable (the error is reported for 
the test after the failed one).


I'll try to come up with something but it'll take some time to get used 
to pytest. Meanwhile I'll drop this from theĀ  series.


JJ






___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/7] test: fs: run fsck after on fs image after the tests are run

2019-02-01 Thread Jean-Jacques Hiblot


On 01/02/2019 16:18, Tom Rini wrote:

On Fri, Feb 01, 2019 at 03:33:36PM +0100, Jean-Jacques Hiblot wrote:


This is to check the integrity of the FS after the test operations.
This is useful to make sure that the operations are implemented properly,
and are not going to create silent corruptions.
Currently only the integrity of EXT4 filesystems is checked.

Signed-off-by: Jean-Jacques Hiblot 

---

Changes in v2:
- Add a FS integrity check at the end of the FS tests

  test/py/tests/test_fs/conftest.py | 13 +
  1 file changed, 13 insertions(+)

diff --git a/test/py/tests/test_fs/conftest.py 
b/test/py/tests/test_fs/conftest.py
index 745ed0ed38..e742cda662 100644
--- a/test/py/tests/test_fs/conftest.py
+++ b/test/py/tests/test_fs/conftest.py
@@ -216,6 +216,15 @@ def mount_fs(fs_type, device, mount_point):
  except CalledProcessError:
  raise
  
+

+def fsck(img, fs_type):
+try:
+if fs_type == 'ext4':
+check_call('fsck.ext4 -n -f %s' % img, shell=True)
+except CalledProcessError:
+raise
+
+

Why don't we just call 'fsck -f -n ...' and check all filesystems?



Force and "make no changes" are both general fsck options and not


Strange. those options do not appear in the help or manpage.

I'll switch to fsck in the next version


filesystem specific.  And if we're messing up FAT as part of the tests
we should know that now :)





___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/7] test: fs: run fsck after on fs image after the tests are run

2019-02-01 Thread Tom Rini
On Fri, Feb 01, 2019 at 03:33:36PM +0100, Jean-Jacques Hiblot wrote:

> This is to check the integrity of the FS after the test operations.
> This is useful to make sure that the operations are implemented properly,
> and are not going to create silent corruptions.
> Currently only the integrity of EXT4 filesystems is checked.
> 
> Signed-off-by: Jean-Jacques Hiblot 
> 
> ---
> 
> Changes in v2:
> - Add a FS integrity check at the end of the FS tests
> 
>  test/py/tests/test_fs/conftest.py | 13 +
>  1 file changed, 13 insertions(+)
> 
> diff --git a/test/py/tests/test_fs/conftest.py 
> b/test/py/tests/test_fs/conftest.py
> index 745ed0ed38..e742cda662 100644
> --- a/test/py/tests/test_fs/conftest.py
> +++ b/test/py/tests/test_fs/conftest.py
> @@ -216,6 +216,15 @@ def mount_fs(fs_type, device, mount_point):
>  except CalledProcessError:
>  raise
>  
> +
> +def fsck(img, fs_type):
> +try:
> +if fs_type == 'ext4':
> +check_call('fsck.ext4 -n -f %s' % img, shell=True)
> +except CalledProcessError:
> +raise
> +
> +

Why don't we just call 'fsck -f -n ...' and check all filesystems?
Force and "make no changes" are both general fsck options and not
filesystem specific.  And if we're messing up FAT as part of the tests
we should know that now :)

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot