mbox series

[blktests,v2,0/2] nvme: add test for unprivileged passthrough

Message ID 20230214044739.1903364-1-shinichiro.kawasaki@wdc.com (mailing list archive)
Headers show
Series nvme: add test for unprivileged passthrough | expand

Message

Shin'ichiro Kawasaki Feb. 14, 2023, 4:47 a.m. UTC
Per suggestion by Kanchan, add a new test case to test unprivileged passthrough
of NVME character devices. The first patch adds a feature to run commands with
normal user privilege. The second patch adds the test case using the feature.

Changes from v2:
* Added the first patch to add normal user privilege support to blktests
* Adjusted the test case to the functions for normal user privilege support

Kanchan Joshi (1):
  nvme/046: add test for unprivileged passthrough

Shin'ichiro Kawasaki (1):
  check, common/rc: support normal user privilege

 Documentation/running-tests.md | 10 +++++++
 check                          |  1 +
 common/rc                      | 13 +++++++++
 tests/nvme/046                 | 50 ++++++++++++++++++++++++++++++++++
 tests/nvme/046.out             |  2 ++
 5 files changed, 76 insertions(+)
 create mode 100644 tests/nvme/046
 create mode 100644 tests/nvme/046.out

Comments

Kanchan Joshi Feb. 27, 2023, 6:05 a.m. UTC | #1
On Tue, Feb 14, 2023 at 01:47:37PM +0900, Shin'ichiro Kawasaki wrote:
>Per suggestion by Kanchan, add a new test case to test unprivileged passthrough
>of NVME character devices. The first patch adds a feature to run commands with
>normal user privilege. The second patch adds the test case using the feature.
>
>Changes from v2:
>* Added the first patch to add normal user privilege support to blktests
>* Adjusted the test case to the functions for normal user privilege support

Thanks, this looks way better. And works fine in my setup.
If required,
Tested-by: Kanchan Joshi <joshi.k@samsung.com>
Shin'ichiro Kawasaki Feb. 27, 2023, 11:24 a.m. UTC | #2
On Feb 27, 2023 / 11:35, Kanchan Joshi wrote:
> On Tue, Feb 14, 2023 at 01:47:37PM +0900, Shin'ichiro Kawasaki wrote:
> > Per suggestion by Kanchan, add a new test case to test unprivileged passthrough
> > of NVME character devices. The first patch adds a feature to run commands with
> > normal user privilege. The second patch adds the test case using the feature.
> > 
> > Changes from v2:
> > * Added the first patch to add normal user privilege support to blktests
> > * Adjusted the test case to the functions for normal user privilege support
> 
> Thanks, this looks way better. And works fine in my setup.
> If required,
> Tested-by: Kanchan Joshi <joshi.k@samsung.com>

Thanks for the confirmation. Sounds good.

I found two more minor points to improve:

1) tests/nvme/046 does not have executable mode bit. I will add it when I apply
   the patch.

2) I ran the test case with kernel version v6.1 and it failed. Does the test
   case require kernel version 6.2 or higher? If that is the case, one more line
   change will be required as follows. If you are ok with the change, I can fold
   this change in when I apply the patches.

diff --git a/tests/nvme/046 b/tests/nvme/046
index 5689a2b..b37b9e9 100644
--- a/tests/nvme/046
+++ b/tests/nvme/046
@@ -11,6 +11,7 @@ QUICK=1
 requires() {
 	_nvme_requires
 	_require_normal_user
+	_have_kver 6 2
 }
 
 test_device() {
Kanchan Joshi Feb. 27, 2023, 2:18 p.m. UTC | #3
On Mon, Feb 27, 2023 at 11:24:04AM +0000, Shinichiro Kawasaki wrote:
>On Feb 27, 2023 / 11:35, Kanchan Joshi wrote:
>> On Tue, Feb 14, 2023 at 01:47:37PM +0900, Shin'ichiro Kawasaki wrote:
>> > Per suggestion by Kanchan, add a new test case to test unprivileged passthrough
>> > of NVME character devices. The first patch adds a feature to run commands with
>> > normal user privilege. The second patch adds the test case using the feature.
>> >
>> > Changes from v2:
>> > * Added the first patch to add normal user privilege support to blktests
>> > * Adjusted the test case to the functions for normal user privilege support
>>
>> Thanks, this looks way better. And works fine in my setup.
>> If required,
>> Tested-by: Kanchan Joshi <joshi.k@samsung.com>
>
>Thanks for the confirmation. Sounds good.
>
>I found two more minor points to improve:
>
>1) tests/nvme/046 does not have executable mode bit. I will add it when I apply
>   the patch.
>
>2) I ran the test case with kernel version v6.1 and it failed. Does the test
>   case require kernel version 6.2 or higher? If that is the case, one more line
>   change will be required as follows. If you are ok with the change, I can fold
>   this change in when I apply the patches.

Yes, unprivileged passthrough exists from 6.2. Changes looks good.
Thanks.
Shin'ichiro Kawasaki Feb. 28, 2023, 4:07 a.m. UTC | #4
On Feb 27, 2023 / 19:48, Kanchan Joshi wrote:
> On Mon, Feb 27, 2023 at 11:24:04AM +0000, Shinichiro Kawasaki wrote:
> > On Feb 27, 2023 / 11:35, Kanchan Joshi wrote:
> > > On Tue, Feb 14, 2023 at 01:47:37PM +0900, Shin'ichiro Kawasaki wrote:
> > > > Per suggestion by Kanchan, add a new test case to test unprivileged passthrough
> > > > of NVME character devices. The first patch adds a feature to run commands with
> > > > normal user privilege. The second patch adds the test case using the feature.
> > > >
> > > > Changes from v2:
> > > > * Added the first patch to add normal user privilege support to blktests
> > > > * Adjusted the test case to the functions for normal user privilege support
> > > 
> > > Thanks, this looks way better. And works fine in my setup.
> > > If required,
> > > Tested-by: Kanchan Joshi <joshi.k@samsung.com>
> > 
> > Thanks for the confirmation. Sounds good.
> > 
> > I found two more minor points to improve:
> > 
> > 1) tests/nvme/046 does not have executable mode bit. I will add it when I apply
> >   the patch.
> > 
> > 2) I ran the test case with kernel version v6.1 and it failed. Does the test
> >   case require kernel version 6.2 or higher? If that is the case, one more line
> >   change will be required as follows. If you are ok with the change, I can fold
> >   this change in when I apply the patches.
> 
> Yes, unprivileged passthrough exists from 6.2. Changes looks good.
> Thanks.

All right, I've applied the patches. Thanks!