public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 21/23] test/py: convert fs-test.sh to pytest
Date: Tue, 25 Sep 2018 13:47:33 +0900	[thread overview]
Message-ID: <20180925044732.GA27322@linaro.org> (raw)
In-Reply-To: <CAPnjgZ3D_h4Ruf6cSJZ5H1bp-_evPvVQCAGrcsMff1VFHKw=hw@mail.gmail.com>

Simon,

Sorry for not responding soon.

On Fri, Sep 14, 2018 at 12:54:57PM +0200, Simon Glass wrote:
> Hi Akashi,
> 
> On 4 September 2018 at 09:49, AKASHI Takahiro
> <takahiro.akashi@linaro.org> wrote:
> > In this commit, the same set of test cases as in test/fs/fs-test.sh
> > is provided using pytest framework.
> > Actually, fs-test.sh provides three variants:"sb" (sb command), "nonfs"
> > (fatxx and etc.) and "fs" (hostfs), and this patch currently supports
> > only "nonfs" variant; So it is not a replacement of fs-test.sh for now.
> >
> > Simple usage:
> >   $ py.test test/py/tests/test_fs [<other options>]
> >
> > You may also specify filesystem types to be tested:
> >   $ py.test test/py/tests/test_fs --fs-type fat32 [<other options>]
> >
> > Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> > ---
> >  test/py/tests/test_fs/conftest.py    | 216 ++++++++++++++++++++
> >  test/py/tests/test_fs/fstest_defs.py |  10 +
> >  test/py/tests/test_fs/test_basic.py  | 287 +++++++++++++++++++++++++++
> >  3 files changed, 513 insertions(+)
> >  create mode 100644 test/py/tests/test_fs/conftest.py
> >  create mode 100644 test/py/tests/test_fs/fstest_defs.py
> >  create mode 100644 test/py/tests/test_fs/test_basic.py
> 
> Thanks for doing this!
> 
> Can you also please delete the old shell script?

No, we can't.
As I said in the commit message, my script currently supports
only one of three test variants in fs-test.sh, "nonfs."
"sb" and "fs" are yet to be implemented (if necessary).

> Does this get automatically executed with 'make tests'?

Yes, of course.

> If not, is it possible to do that easily, if we reduce the size of files, etc?
> 
> >
> > diff --git a/test/py/tests/test_fs/conftest.py b/test/py/tests/test_fs/conftest.py
> > new file mode 100644
> > index 000000000000..9155ccf84266
> > --- /dev/null
> > +++ b/test/py/tests/test_fs/conftest.py
> > @@ -0,0 +1,216 @@
> > +# SPDX-License-Identifier:      GPL-2.0+
> > +# Copyright (c) 2018, Linaro Limited
> > +# Author: Takahiro Akashi <takahiro.akashi@linaro.org>
> > +
> > +import os
> > +import os.path
> > +import pytest
> > +import re
> > +from subprocess import call, check_call, check_output, CalledProcessError
> > +from fstest_defs import *
> > +
> > +supported_fs_basic = ['fat16', 'fat32', 'ext4']
> > +
> > +#
> > +# Filesystem test specific setup
> > +#
> > +def pytest_addoption(parser):
> 
> Please can you add full function comments to each function? You can
> see other tests or binman for the format to use.
> [...]

OK.

-Takahiro Akashi


> Regards,
> Simon

  reply	other threads:[~2018-09-25  4:47 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-04  7:49 [U-Boot] [PATCH v2 00/23] subject: fs: fat: extend FAT write operations AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 01/23] fs: fat: guard the content of include/fat.h AKASHI Takahiro
2018-09-04  8:52   ` Alexander Graf
2018-09-04 10:46     ` Heinrich Schuchardt
2018-09-05  1:54       ` AKASHI Takahiro
2018-09-05  5:53         ` Heinrich Schuchardt
2018-09-05  1:14     ` AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 02/23] fs: fat: extend get_fs_info() for write use AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 03/23] fs: fat: handle "." and ".." of root dir correctly with fat_itr_resolve() AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 04/23] fs: fat: make directory iterator global for write use AKASHI Takahiro
2018-09-04  9:01   ` Alexander Graf
2018-09-04 10:50     ` Heinrich Schuchardt
2018-09-04 10:57       ` Alexander Graf
2018-09-05  2:14         ` AKASHI Takahiro
2018-09-05  8:16           ` Alexander Graf
2018-09-06  2:29             ` AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 05/23] fs: fat: assure iterator's ->dent belongs to ->clust AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 06/23] Revert "fs: fat: cannot write to subdirectories" AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 07/23] fs: fat: check and normailze file name AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 08/23] fs: fat: write returns error code instead of -1 AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 09/23] fs: fat: support write with sub-directory path AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 10/23] fs: fat: refactor write interface for a file offset AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 11/23] fs: fat: support write with non-zero offset AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 12/23] cmd: fat: add offset parameter to fatwrite AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 13/23] fs: add mkdir interface AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 14/23] fs: fat: remember the starting cluster number of directory AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 15/23] fs: fat: support mkdir AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 16/23] cmd: fat: add fatmkdir command AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 17/23] efi_loader: file: support creating a directory AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 18/23] efi_loader: implement a pseudo "file delete" AKASHI Takahiro
2018-09-04  9:16   ` Alexander Graf
2018-09-05  2:51     ` AKASHI Takahiro
2018-09-05  8:22       ` Alexander Graf
2018-09-06  2:43         ` AKASHI Takahiro
2018-09-06  6:09           ` Alexander Graf
2018-09-04  7:49 ` [U-Boot] [PATCH v2 19/23] fs-test: fix false positive error at Test Case 12 AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 20/23] fs-test: update the test result as of v2018.09 AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 21/23] test/py: convert fs-test.sh to pytest AKASHI Takahiro
2018-09-14 10:54   ` Simon Glass
2018-09-25  4:47     ` AKASHI Takahiro [this message]
2018-09-04  7:49 ` [U-Boot] [PATCH v2 22/23] test/py: fs: add extended write operation test AKASHI Takahiro
2018-09-04  7:49 ` [U-Boot] [PATCH v2 23/23] test/py: fs: add fstest/mkdir test AKASHI Takahiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180925044732.GA27322@linaro.org \
    --to=takahiro.akashi@linaro.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox