From mboxrd@z Thu Jan 1 00:00:00 1970 From: AKASHI Takahiro Date: Tue, 25 Sep 2018 13:47:33 +0900 Subject: [U-Boot] [PATCH v2 21/23] test/py: convert fs-test.sh to pytest In-Reply-To: References: <20180904074948.18146-1-takahiro.akashi@linaro.org> <20180904074948.18146-22-takahiro.akashi@linaro.org> Message-ID: <20180925044732.GA27322@linaro.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > 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 [] > > > > You may also specify filesystem types to be tested: > > $ py.test test/py/tests/test_fs --fs-type fat32 [] > > > > Signed-off-by: AKASHI Takahiro > > --- > > 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 > > + > > +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