linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Christoph Hellwig <hch@lst.de>, Joel Becker <jlbec@evilplan.org>,
	linux-kernel@vger.kernel.org,
	Bodo Stroesser <bostroesser@gmail.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Brendan Higgins <brendanhiggins@google.com>,
	Yanko Kaneti <yaneti@declera.com>
Subject: Re: [PATCH v4 3/3] configfs: Add unit tests
Date: Mon, 9 Aug 2021 16:59:53 +0200	[thread overview]
Message-ID: <20210809145953.GB21234@lst.de> (raw)
In-Reply-To: <20210805043503.20252-4-bvanassche@acm.org>

> text and binary attribute support. This is how I run these tests:
> 
> set -e
> if [ -e .config ]; then
>     make ARCH=um mrproper
> fi
> if [ ! -e .kunit/.kunitconfig ]; then
>     cat <<EOF >.kunit/.kunitconfig
> CONFIG_CONFIGFS_FS=y
> CONFIG_CONFIGFS_KUNIT_TEST=y
> CONFIG_KUNIT=y
> CONFIG_PROVE_LOCKING=y
> CONFIG_SYSFS=y
> CONFIG_UBSAN=y
> EOF
>     cp .kunit/.kunitconfig .kunit/.config
> fi
> ./tools/testing/kunit/kunit.py run

This is very useful documentation, but shouldn't it go into a README.kunit
or similar instead of a commit message?

> +config CONFIGFS_KUNIT_TEST
> +	bool "Configfs Kunit test" if !KUNIT_ALL_TESTS
> +	depends on CONFIGFS_FS && KUNIT=y
> +	default KUNIT_ALL_TESTS

Why does it depend on KUNIT=y?  What is the issue with a modular KUNIT
build?


> +static int mkdir(const char *name, umode_t mode)
> +{
> +	struct dentry *dentry;
> +	struct path path;
> +	int err;
> +
> +	err = get_file_mode(name);
> +	if (err >= 0 && S_ISDIR(err))
> +		return 0;
> +
> +	dentry = kern_path_create(AT_FDCWD, name, &path, LOOKUP_DIRECTORY);
> +	if (IS_ERR(dentry))
> +		return PTR_ERR(dentry);
> +
> +	err = vfs_mkdir(&init_user_ns, d_inode(path.dentry), dentry, mode);
> +	done_path_create(&path, dentry);

To me this sounds like userspace would be a better place for these
kinds of tests.

  reply	other threads:[~2021-08-09 15:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-05  4:35 [PATCH v4 0/3] Restore the kernel v5.13 text attribute write behavior Bart Van Assche
2021-08-05  4:35 ` [PATCH v4 1/3] configfs: " Bart Van Assche
2021-08-05  4:35 ` [PATCH v4 2/3] kunit: Add support for suite initialization and cleanup Bart Van Assche
2021-08-05  4:35 ` [PATCH v4 3/3] configfs: Add unit tests Bart Van Assche
2021-08-09 14:59   ` Christoph Hellwig [this message]
2021-08-09 18:31     ` Bart Van Assche
2021-08-10 16:50       ` Christoph Hellwig
2021-08-10 18:45         ` Bart Van Assche
2021-08-10 20:50           ` Shuah Khan
2021-08-11  9:00             ` Brendan Higgins
2022-03-01 20:03               ` Brendan Higgins
2021-08-10 22:00     ` Brendan Higgins
2021-08-11  3:13       ` Bart Van Assche
2021-08-09 14:56 ` [PATCH v4 0/3] Restore the kernel v5.13 text attribute write behavior Christoph Hellwig

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=20210809145953.GB21234@lst.de \
    --to=hch@lst.de \
    --cc=bostroesser@gmail.com \
    --cc=brendanhiggins@google.com \
    --cc=bvanassche@acm.org \
    --cc=jlbec@evilplan.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=yaneti@declera.com \
    /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;
as well as URLs for NNTP newsgroup(s).